[Scons-users] Using CheckFunc() and CheckLib() breaks dependencies and makes scons ignore file changes
Pawel Winogrodzki
pawelwi at microsoft.com
Tue Feb 14 05:05:49 EST 2017
Hi all,
I think I found a bug in scons and would like to know, if this is already a known issue, and if so, when could a fix be expected. So far I've tried scons 2.5.1 and 2.4.1, and got a repro on both.
Repro steps for Windows, but this also happens on Linux:
1. Create a simple Environment object "env".
2. Make it build some library "foo".
3. Call env.Append(LIBS = ['foo']).
4. Create a Configure object "conf" from "env".
5. Call conf.CheckFunc('malloc') (for instance) and conf.Finish() (unnecessary for the sake of this example).
6. Use "env" to build an executable "bar".
This will make the CheckFunc() call build "foo.lib" while the script is being executed. As long as the lib is built correctly the developer might not notice any issues, but if the lib fails to build scons will indicate that it finished successfully, even though bar.exe is never created. In addition to that any changes to "foo.c" or any other source file, which was compiled by CheckFunc() will not be noticed by scons. Telling scons to explicitly build "foo.lib" will make scons finish successfully without performing any actions, as long as the lib was already built/failed to build in one of the previous runs of scons.
Another side effect is that CheckFunc() will return False, even if the function is available, but the lib failed to build.
In the attachment is a sample scons project showing this behavior. Currently it should build "bar.exe" correctly, but in the output scons will not show any indication, that "foo.lib" has been created. You can find that information inside config.log. If you change anything inside "foo.c", what would prevent it from compiling correctly, you should see the behavior I've described above. Of course make sure to clean up between every build. Calling "scons -c" is not enough - you have to delete all other files generated by scons or at least prevent it from using the cache to determine if a function is present on not.
Again, please let me know, if this is a known issue and how can I handle it (except for removing all CheckFunc() calls).
Thanks,
Pawel Winogrodzki
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://pairlist4.pair.net/pipermail/scons-users/attachments/20170214/5138d277/attachment-0001.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: SconsLibTest.zip
Type: application/x-zip-compressed
Size: 1468 bytes
Desc: SconsLibTest.zip
URL: <https://pairlist4.pair.net/pipermail/scons-users/attachments/20170214/5138d277/attachment-0001.bin>
More information about the Scons-users
mailing list