Closed geoffromer closed 1 month ago
I should note, I think there are two separate bugs here:
toolchain/autoupdate_testdata.py
can fail in a clean client.From what I can tell of the repro, you do a build, then remove artifacts used as input to the build. bazel doesn't notice the removed artifacts (the prelude files) due to the symlinks.
I think the actual issue is with symlink_filegroup
, since the dependency is on the symlink rather than the data file. That's toolchain/install/BUILD. I'll think about if there's another approach there, I know @chandlerc was trying to work around a few issues.
Note, I'd typically define a "clean client" repro as:
git clone https://github.com/carbon-language/carbon-lang
cd carbon-lang/
toolchain/autoupdate_testdata.py
A clean client works fine for me. It's removing prelude files that's not detected.
Note, a simple repro here is to then do:
rm core/prelude/operators/as.carbon
toolchain/autoupdate_testdata.py
bazel
should catch this but doesn't.
Description of the bug:
Under certain conditions,
toolchain/autoupdate_testdata.py
fails with a cascade of "No such file or directory" errors.What did you do, or what's a simple way to reproduce the bug?
187a3608df
is the commit hash of #4209. Other before/after commit pairs would also work, so long as a prelude file is present whenbazel build //toolchain
is run, but absent whentoolchain/autoupdate_testdata.py
is run. Note that you might need to clear your Bazel cache to get these steps to work, because non-hermetic Bazel behavior seems to be part of the problem.What did you expect to happen?
I expected the script to run successfully.
What actually happened?
The script produced an error for each testdata file:
... and so on.
Any other information, logs, or outputs that you want to share?
I updated this line to log the name of the file, and got the following more illuminating error message:
The file in question is a symlink pointing to my git client's
core/prelude/operators/as.carbon
, which of course doesn't exist, hence the error.