0
votes

I have a scons project with many SConscript files in the subdirectories. In one of those SConscript files I want to check if particular library is installed on the build host. Here is code snippet:

Import("env")

conf = Configure(env)
if conf.CheckLibWithHeader(...):
    doSomething()

env.Library(...)

When I execute build scons fails with strnge error without error message like this:

scons: *** 
File "/path/to/SConscript", line 3, in <module>

Line 3 is where I call Configure(). I guess I am doing something not allowed with Configure() function but I cannot find any explanation in scons documentation.

Please help me to debug this.

1
Well, the first thing you'll want to do is excluding side effects from your example and error description. This means, try to run only the SConscript that seems to fail alone, commenting out the invocations of SConscript in all other places. If this still shows the described error, replace your env setup with a simple env = Environment in your top-level build file. If the error still shows, then please post your full top-level SConstruct and the called SConscript here...and then we can take it from there. - dirkbaechle
Is there a config.log? If so please post it's contents - bdbaddog
I have solution for this issue. Will post it here few hours later. (config.log has no relevant information). - igor.sol

1 Answers

0
votes

So the problem was in one of the sibling SConscript files. There was a call to Configure(env) but configuration object was not disposed with conf.Finish() call.

This was an issue because SCons does not allow to create more than one configuration object at any moment. I found this rule by analysing SCons sources - I don't know if this is documented.

Thus when I made my call to Configure(env) SCons thrown an exception because it seen there is another active configuration object orphaned by sibling SConscript.