[Scons-users] bug: --debug=explain gives wrong message

Gary Oberbrunner garyo at oberbrunner.com
Fri Oct 15 13:39:24 EDT 2021


>
> You might look at #3684, #2997, #2996 and #2932 and see if they cover
> any of what you're seeing.


Yes, most of those are relevant to my issue. Thanks for the info! I won't
file a new bug; those cover it. Would love to see your better explain code
in SCons!

-- Gary

On Fri, Oct 15, 2021 at 1:32 PM Mats Wichmann <mats at wichmann.us> wrote:

>
> On 10/15/21 10:04, Gary Oberbrunner wrote:
> > 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.
>
> There are several issues on explain, which has the unfortunate
> characteristic that it does its own computation, rather than using the
> determination made by the decider.  I had some work in progress on
> improving the explain logic, but it ended up with some work Bill did and
> there didn't seem to be an appetite at the time to pursue the approach I
> had.
>
> You might look at #3684, #2997, #2996 and #2932 and see if they cover
> any of what you're seeing.
> _______________________________________________
> Scons-users mailing list
> Scons-users at scons.org
> https://pairlist4.pair.net/mailman/listinfo/scons-users
>


-- 
Gary
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://pairlist4.pair.net/pipermail/scons-users/attachments/20211015/b0ea240b/attachment.htm>


More information about the Scons-users mailing list