bug: --debug=explain gives wrong message

Gary Oberbrunner <[email protected]>
Newsgroups gmane.comp.programming.tools.scons.user
Message-ID <CAFChFyibHNb+X2xapDKVFGGOCZL0D2LE6wBw0WxX4hv9j502sQ@mail.gmail.com>
In some cases, --debug=explain gives the wrong message about why a target
is being rebuilt.
Try this:

=== SConstruct:
SConscript('src/SConscript-lictool', variant_dir='Build', duplicate=0)

=== src/SConscript:
import os
tgt=Command('tgt', ['src.txt'], f'echo hi {os.getpid()} > $TARGET')

=== src/src.txt: empty file

Run "scons --debug=explain" twice. The first time it rebuilds because tgt
doesn't exist, that's correct. The second time, the actual reason it
rebuilds is because the build action changed (it's set up to change every
time you run it), but the message says that "src.txt is a new dependency"
which (a) isn't correct, and (b) isn't the actual reason for the rebuild.

The reason appears to be that `explain` in scons/node/__init__.py checks
the Nodes for the old & new dependencies, and somehow the old dep Node is
`src/src.txt` while the new one is `Build/src.txt`. So it spuriously says
that the deps have changed. And a second issue is that in `explain` once it
has printed one kind of reason, it stops looking for other reasons, so it
doesn't print that the build action has also changed. That's as far as I've
tracked it so far.

--
Gary

_______________________________________________
Scons-users mailing list
[email protected]
https://pairlist4.pair.net/mailman/listinfo/scons-users
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.