-
Notifications
You must be signed in to change notification settings - Fork 253
Use correct file time for filesLoaded hash table keys #3872
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
Conversation
Ugh:
|
I'm confused, why did this start breaking now?! |
I think it's because we previously called |
I ended up simplifying this a bit so that we still get file time before we load the file, but call |
I'm confused about all the force pushes, and I have to repeatedly test the dropbox issue. If a single internal test is failing, why not just fix that? |
Sorry about that. An earlier push did "fix" that test, but as I thought about it some more, I think that probably wasn't the right thing to do. The file that's being loaded could run arbitrary code, so who knows what kind of shenanigans could happen between when we load the file and then get its file time. So I think grabbing the file time before we load it as we've been doing is probably the right move. So I force-pushed a new version, where we called The most recent force push keeps the |
Was this behavior important? It seemed the difference between absolute vs relative path in a test string. |
Actually, I think the test that failed indicated another bug: restart
testpkg = "./test.m2"
testpkg << ///newPackage("TestPackage")
export {"func"}; func = x -> x
beginDocumentation()
TEST "assert Equation(1 + 1, 2)"
/// << close
loadPackage("TestPackage", FileName => testpkg)
pkgtest = tests(0, "TestPackage")
locate pkgtest
changeDirectory ".."
locate pkgtest
code pkgtest Output: i6 : locate pkgtest
o6 = test.m2:4:5-4:32
o6 : FilePosition
i7 : changeDirectory ".."
o7 = /home/
i8 : locate pkgtest
o8 = test.m2:4:5-4:32
o8 : FilePosition
i9 : code pkgtest
stdio:13:4:(3): error: couldn't find file test.m2 Interestingly, |
The keys were filenames *after* we called realpath, but the keys were file times from *before* we called it, so they may have been incorrect for symlinks.
db0dd15
to
47acf12
Compare
Now that we call "realpath" when loading files, we should get the expected output on systems like macOS where the temporary directory is a symlink.
47acf12
to
9946d25
Compare
The cmake macOS build timed out, but it did pass the test that had been previously failing! -- running check(339, "Core") -- 1.70333s elapsed I think this might finally be ready. |
I don't want to tempt fate, so I'll rerun it just in case then merge it. |
The keys were filenames after we called realpath, but the keys were file times from before we called it, so they may have been incorrect for symlinks.
For example, consider the following situation, where
bar.m2
is a symlink tofoo.m2
:Current behavior:
foo.m2
wasn't updated, but the file time was!Proposed behavior: