回复: 回复: env.Textfile problem
liruncong2018 via Scons-users <[email protected]>
| Newsgroups | gmane.comp.programming.tools.scons.user |
|---|---|
| Message-ID | <[email protected]> |
Hi, After updated, 1) When ninja is not enabled, the last link is always executed when the compilation is repeated. log: ___________________________________________ scons: Reading SConscript files ... Newlib version:2.4.0 scons: done reading SConscript files. scons: Building targets ... scons: building associated VariantDir targets: build arm-none-eabi-gcc -o rtthread-beaglebone.elf -Wall -march=armv7-a -mtune=cortex-a8 -ftree-vectorize -ffast-math -mfpu=vfpv3-d16 -mfloat-abi=softfp -Wl,--gc-sections,-Map=rtthread-beaglebone.map,-cref,-u,Reset_Handler -T beaglebone_ram.lds -lm -lc @build/__link_objects.txt scons: done building targets. ___________________________________________ 2) When ninja is enabled, when recompiling, it always prints something that doesn't seem to actually execute the steps log: ___________________________________________ [1/56] Starting scons daemon...[2K [2/56] Defer to SCons to build build\__cpp_path.txt[2K [3/56] Defer to SCons to build build\__define_options.txt[2K [4/56] Defer to SCons to build build\__link_objects.txt scons: done building targets. ___________________________________________ Judging from the file time, these txt files(__cpp_path.txt/__define_options.txt/__link_objects.txt) are not actually generated. ------------------ 原始邮件 ------------------ 发件人: "Daniel Moody" <[email protected]>; 发送时间: 2022年5月18日(星期三) 上午6:11 收件人: "liruncong2018"<[email protected]>; 抄送: "SCons users mailing list"<[email protected]>; 主题: Re: [Scons-users] 回复: env.Textfile problem Also I added a new feature to my branch, now on the command line you can pass arguments to ninja invocation from scons command line with NINJA_CMD_ARGS= So for example scons ... NINJA_CMD_ARGS="-n" will mean you will see ninja execute with the dry run arg '-n'. On Tue, May 17, 2022 at 5:09 PM Daniel Moody <[email protected]> wrote: Hello liruncong, I reproduced the problem. The problem is that scons does not update the ninja file if the existing ninja file looks exactly the same. Because the define option -DTEST2 is hidden a generated file, scons detects the ninja file is the same and does not update. Ninja also detects the the ninja file is the same, and does not call on scons to regenerate the defineOptsFile. Originally you brought up the complaint that ninja always rebuilds some files and you think it should just say (ninja:no work to do). I added a new feature described previously to deal with this, but it seems it will not work with generated files like defineOptsFile. I reverted this feature in the ninja_integration_branch, you will have to see ninja calling to scons to check if some files should build, only scons can make the decision and ninja will detect if scons updated the files and if it should then rebuild things which depended on those files. On Tue, May 17, 2022 at 7:02 AM liruncong2018 <[email protected]> wrote: Hello Daniel Moody, Thanks for the reminder, I corrected the recompile problem (https://github.com/liruncong/NinJaTest/tree/EnvTextFile). But the problem of not recompiling after modifying defineOptsFile, I still have no idea. ------------------ 原始邮件 ------------------ 发件人: "Daniel Moody" <[email protected]>; 发送时间: 2022年5月17日(星期二) 下午2:03 收件人: "SCons users mailing list"<[email protected]>; 抄送: "liruncong2018"<[email protected]>; 主题: Re: [Scons-users] 回复: env.Textfile problem hello liruncong, First you should understand why it is recompiling every time with just scons. Are your @files being generated differently because of ordering of the contents? Can you pick one file which is always recompiled and use this as the target to build with --debug=explain option? On Sun, May 15, 2022 at 4:20 AM liruncong2018 via Scons-users <[email protected]> wrote: Hi, I originally wanted to reproduce the problem in the test project, but I did find another problem, scons is recompiled every time. Test code: liruncong/NinJaTest at EnvTextFile (github.com) However, this problem was not found in my actual project. The test project uses the gcc toolchain, and my actual project uses the armclang (clang) toolchain. When ninja is not enabled, it is all recompiled every time you compile. After enabling ninja, the first two executions are all recompiles, and the third start is normal (ninja: no work to do.). After normal (three times later), modify defineOptsFile as follows, scons (enable ninja) does not recompile, which should be problematic. defineOptsFile = env.Textfile("build/__define_options.txt", [ "-DTEST1", "-DTEST2" # new added ]) ------------------ 原始邮件 ------------------ 发件人: "Bill Deegan" <[email protected]>; 发送时间: 2022年5月15日(星期天) 上午7:20 收件人: "SCons users mailing list"<[email protected]>; 抄送: "liruncong2018"<[email protected]>; 主题: Re: [Scons-users] env.Textfile problem Not enough information to help you. What's your scons logic look like for this? On Sat, May 14, 2022 at 3:04 AM liruncong2018 via Scons-users <[email protected]> wrote: Hi, The source(env.Textfile second parameter) change did not trigger recompilation when using env.Textfile. scons version: Commits · dmoody256/scons (github.com) commit: force utf-8 _______________________________________________ Scons-users mailing list [email protected] https://pairlist4.pair.net/mailman/listinfo/scons-users _______________________________________________ Scons-users mailing list [email protected] https://pairlist4.pair.net/mailman/listinfo/scons-users _______________________________________________ Scons-users mailing list [email protected] https://pairlist4.pair.net/mailman/listinfo/scons-users