-
-
Notifications
You must be signed in to change notification settings - Fork 315
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
MD5-timestamp decider does no longer follow symlinks #3880
Comments
Thanks for posting the issue. |
We just hit this bug in 4.3.0 after coming from scons-3.1.2, and it caused a lot of havoc in our company. We have disabled MD5-timestamp for now and will suffer the compile-time hit. |
probably this commit: 6cde83c |
It's frustrating that the explain code also produces deceptive information (the bit about gcc changing is just wrong), but that is a different problem - unfortunately the chosen decider is not the section of code that produces the explantion, that's its own function. Meanwhile, the commit pointed to looks dodgy to me - the |
Yeah, probably should not have the changes to getmtime and getsize. |
I'd say this wants some more eyeballs. #3638 was made to close #3516, problems with dangling symlinks as targets, but it seems to have left behind this problem with sources that are symlinks. As a quick test, If I remove the expanded code in the Line 735 in 57369e8
the detection of the symlinked target starts working again (for the test in this issue, Line 3604 in 57369e8
and that still passes after the change. I haven't had the energy to think through the whole logic here, and it would be good to work up a unit test for this case as well, so what do folks think? |
It's clear that the MD5 symlink behavior got broken and needs to be fixed (and a unit test added). However, is pre-clearing broken symlinks a desired behavior in the first place? My reference standard is make. Here is an example that compares behavior between make, scons-3.1.2, and scons-4.3.0. Note that "scons-3.1.2 --clean" does the "wrong" thing, in my opinion. scons should only clean the actual files that it generated (restoring the original system state as much as possible). |
Yes, (at least minimally) if SCons creates those symlinks. |
I absolutely agree. After further experimentation and thought, the current behavior of replacing the symlink is sane, and I withdraw my pre-clearing question. Trying to figure out a spec of when and when not to replace symlinks drove me insane :-). |
Yup. it's tricky. :) |
Suggestions for a test? I'm not seeing where to put something in the unit tests, though there is a |
It would be along the lines of @rodrigc's testcase. Make sure a file is rebuilt. |
The base filesystem node class has getmtime() and getsize() functions. Those were changed in an early commit to use the lstat() method if the node represented a symbolic link. However, we actually want the information of the file the symlink points to, or we can't detect changes to the mtime or size of the underlying file, and miss rebuilds if content-timestamp is used. Added a testcase which shows the failure to rebuild from the symlinked source. Fixes SCons#3880 Signed-off-by: Mats Wichmann <mats@linux.com>
The base filesystem node class has getmtime() and getsize() functions. Those were changed in an early commit to use the lstat() method if the node represented a symbolic link. However, we actually want the information of the file the symlink points to, or we can't detect changes to the mtime or size of the underlying file, and miss rebuilds if content-timestamp is used. Added a testcase which shows the failure to rebuild from the symlinked source. Fixes SCons#3880 Signed-off-by: Mats Wichmann <mats@linux.com>
The base filesystem node class has getmtime() and getsize() functions. Those were changed in an early commit to use the lstat() method if the node represented a symbolic link. However, we actually want the information of the file the symlink points to, or we can't detect changes to the mtime or size of the underlying file, and miss rebuilds if content-timestamp is used. Added a testcase which shows the failure to rebuild from the symlinked source. Fixes SCons#3880 Signed-off-by: Mats Wichmann <mats@linux.com>
probably this commit:
6cde83c
…On Thu, Mar 17, 2022 at 6:31 PM jhdub23 ***@***.***> wrote:
We just hit this bug in 4.3.0 after coming from scons-3.1.2, and it caused
a lot of havoc in our company. We have disabled MD5-timestamp for now and
suffer the compile-time hit.
—
Reply to this email directly, view it on GitHub
<#3880 (comment)>, or
unsubscribe
<https://github.com/notifications/unsubscribe-auth/ABOZRTBL7ZOJGEG2NHKCEOTVAO6GJANCNFSM4W6QB6AA>
.
You are receiving this because you are subscribed to this thread.Message
ID: ***@***.***>
|
I reported the issue to Debian yesterday, see https://bugs.debian.org/981584, and was asked by @bdbaddog to file it here
Describe the bug
I'm attaching a simple scons-test-project.tar.gz that:
Previously (what I'm proving at the bottom of this mail) scons used
to build hello2 when hello.c was changed. In the current version of
scons only hello gets rebuilt.
Initial compilation with scons 4:
The following command changes both hello.c and hello2.c...
... but hello2.c is not rebuilt:
After downgrading scons to 3.1.2+dfsg-0.1, it works as I would expect:
Initial compilation with scons 3:
Still both files are changed by the following command:
... and both are rebuilt:
Required information
The text was updated successfully, but these errors were encountered: