[Scons-users] Pulling information out of sconsign

Evan Driscoll driscoll at cs.wisc.edu
Tue May 17 10:44:46 EDT 2016


On 2016-05-17 02:35, Tom Tanner (BLOOMBERG/ LONDON) wrote:
> Sadly scons doesn't store the fully expanded command line inside the
> .sconsign file. I actually did this where I work and the changes are
> small but increases the size of the file hugely, and it should be
> noted that it doesn't make so much sense for commands that are
> actually python functions.

That's too bad; I guess I'll see if I can figure out another way. Maybe 
'scons |& grep gcc > commands.txt' :-).

Evan


> 

> From: scons-users at scons.org At: May 17 2016 04:00:09
> To: scons-users at scons.org
> Subject: Re:[Scons-users] Pulling information out of sconsign
> 
>> I have perhaps somewhat of a strange question. I would like to be
>> able
>> to pull information out about what SCons builds for input to other
>> tools. In other words, I want what command lines are run during the
>> build. Obviously something that's generated by a Python function or
>> something would be out-of-scope.
>> 
>> There are some programs out there that can watch an arbitrary build
>> and
>> come up with that list, but I figured that it might be better for
>> SCons
>> users to grab them out of the sconsign file, since SCons "happens"
>> to
>> keep that information around anyway.
>> 
>> ...or so I thought.
>> 
>> I played around with sconsign.py for a while, and from what I can
>> tell,
>> it looks like only the unexpanded command line is stored. For
>> example:
>> 
>> $ scons-local/scons.py -Q
>> g++ -o main.o -c main.cpp
>> g++ -o my-program main.o
>> 
>> $ scons-local/sconsign.py -a .sconsign.dblite
>> === .:
>> SConstruct:
>> main.cpp:
>> main.o:
>> f72bb500d79e0c1126b5ddbdd0d0e795 [$CXX -o $TARGET -c $CXXFLAGS
>> $CCFLAGS $_CCCOMCOM $SOURCES]
>> my-program:
>> 300ad4d70c13ca0a3cd54f1fa0bcae6d [$LINK -o $TARGET $LINKFLAGS
>> $__RPATH $SOURCES $_LIBDIRFLAGS $_LIBFLAGS]
>> === /usr/bin:
>> g++:
>> 
>> (The above is with scons-local 2.5.0, but that's not the only
>> version
>> I've mucked about with.)
>> 
>> But I don't see a way to get information about what $CXXFLAGS, etc.
>> expanded to at the time of compilation.
>> 
>> I also tried mucking about, modifying sconsign.py to print out
>> objects
>> at a lower level and stuff like that. While very interesting, I also
>> 
>> didn't seemingly make any progress on it.
>> 
>> I'm now thinking that what I want isn't there... but am I missing
>> something and it really is?
>> 
>> (Alternatively, my main motivation is to spit out something like the
>> 
>> Compilation Database that the LLVM folks defined.
>> http://clang.llvm.org/docs/JSONCompilationDatabase.html [1] Is there
>> an
>> alternative way to get something that could be easily turned into
>> that?)
>> 
>> Evan
>> 
>> _______________________________________________
>> Scons-users mailing list
>> Scons-users at scons.org
>> https://pairlist4.pair.net/mailman/listinfo/scons-users [2]
> 
> 
> 
> Links:
> ------
> [1] http://clang.llvm.org/docs/JSONCompilationDatabase.html
> [2] https://pairlist4.pair.net/mailman/listinfo/scons-users
> 
> _______________________________________________
> Scons-users mailing list
> Scons-users at scons.org
> https://pairlist4.pair.net/mailman/listinfo/scons-users


More information about the Scons-users mailing list