Skip to content
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

stale files in bazel-bin/toolchain/install/prefix_root/lib/carbon/core can cause autoupdate to fail #4208

Open
zygoloid opened this issue Aug 9, 2024 · 1 comment
Assignees

Comments

@zygoloid
Copy link
Contributor

zygoloid commented Aug 9, 2024

The autoupdate script uses bazel run //toolchain/testing:file_test --autoupdate, which runs in a non-hermetic mode that can see files left behind in bazel-bin/.... This causes some strange failures. To reproduce:

  • Add a .carbon file to core/prelude/
  • Run autoupdate, or build the driver, or run the tests. This causes the file to be copied into bazel-bin/toolchain/install/prefix_root.
  • Remove the .carbon file again
  • Rerun autoupdate

Result: when scanning for prelude files, the file in prefix_root is found. But then when running tests, the prelude is loaded from the top of the workspace instead, and the .carbon file is not found. Net result: all the non-no_prelude tests fail with an "No such file or directory" error.

@chandlerc
Copy link
Contributor

A theory was that this had to do with changing directory after we collect the list of files, but that's not the issue.

The thing left behind is actually a dangling symlink, so listing the directory finds it but it fails when we try to open it.

Still pondering whether there is an effective way to return to hermeticity here...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants