[cfe-dev] Difficulties preparing libtooling based workshop

Richard legalize at xmission.com
Sun Feb 2 16:30:42 PST 2014


Hi,

I'm trying to do a presentation next Wednesday (yes, in 3 days) for
the Utah Software Craftsmen group on building a C++ refactoring tool
using libtooling.  This is a dry-run for the presentation I proposed
to C++ Now 2014 (proposal decisions will be announced Feb. 15th).
The tool is based on llvm/tools/clang/tools/extra/remove-cstr-calls.
I'm running into roadblocks that seem unnecessary.

1) I must build from source because the prebuilt binaries don't include
libtooling headers or libraries, only libclang.  Why?

This is a live coding workshop and my participants will chew up 30-45
minutes of time just to download source and build the base libraries to
start coding.

2) following the "Getting Started" instructions fails the build
under Debug on Windows.  The asan runtime has a line of code in it like
this in asan_win.cc:

#if defined(_DEBUG)
#error Please build the runtime with a non-debug CRT: /MD or /MT
#endif

...which means the whole solution fails to build in debug and this
contingency isn't handled in CMakefiles.txt

3) there are a bunch of tests that fail on Windows along the lines of:

'echo': command not found

...which in turn fails the build for the projects that run these
tests, and in turn causes the whole solution to fail.

Attempting to do exec (CreateProcess) on 'echo' is not going to work
on Windows because 'echo' is an internal command to cmd.exe and is not
an executable in your path.  I'm not even certain it will work under
cygwin because echo is also an internal command under bash and is n ot
an executable in the path either.

A good chunk of my audience are Windows users and this isn't going to
leave a good taste in their mouth.

I can work around problems 2) and 3) myself. (I'm trying a build without
compiler-rt right now and this build problem must have been there for
a while because I found it in my experimental checkout from 5 months ago.)

I was able to build remove-cstr-calls without compiler-rt's asan
runtime, so obviously that's not a requirement.

What's really more of a problem for me is the lack of prebuilt
binaries for libtooling.  Is there enough packaging infrastructure in
place that I can get the necessary headers and libraries packaged up
with a simple command?

I did a check before the build was finished and I had up to 8 GB of built
files on my machine, so clearly providing a pre-built virtual machine or
a downloadable tarball simply isn't going to cut it.
-- 
"The Direct3D Graphics Pipeline" free book <http://tinyurl.com/d3d-pipeline>
     The Computer Graphics Museum <http://ComputerGraphicsMuseum.org>
         The Terminals Wiki <http://terminals.classiccmp.org>
  Legalize Adulthood! (my blog) <http://LegalizeAdulthood.wordpress.com>



More information about the cfe-dev mailing list