[Scons-users] Pulling information out of sconsign

Tom Tanner (BLOOMBERG/ LONDON) ttanner2 at bloomberg.net
Tue May 17 03:35:12 EDT 2016


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.


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  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


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://pairlist4.pair.net/pipermail/scons-users/attachments/20160517/f0cd5b39/attachment.html>


More information about the Scons-users mailing list