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

--remote_download_outputs=toplevel results in output files being deleted #15715

Closed
adam-azarchs opened this issue Jun 21, 2022 · 1 comment
Closed
Labels
P2 We'll consider working on this in future. (Assignee optional) team-Remote-Exec Issues and PRs for the Execution (Remote) team type: bug

Comments

@adam-azarchs
Copy link
Contributor

Description of the bug:

Running bazel test --nobuild_runfile_links --build_tests_only --remote_download_outputs=toplevel deletes previously-downloaded files from the output directory.

Removing any of the three flags seems to make the problem go away, however at a very significant performance cost (adding several minutes to a build that's otherwise just a few seconds) during development. Deleting those runfiles causes significant pain as people may have e.g. active jupyter notebooks running against files from there.

This behavior seems weird to me because most of the time bazel will not delete files which it wasn't planning to touch during a particular build (which has, in the past, caused a different set of problems when things escape the runfiles symlink tree to find things they shouldn't be finding).

What's the simplest, easiest way to reproduce this bug? Please provide a minimal example if possible.

With remote execution configured,

  1. bazel build //:my_target, where my_target has stuff in runfiles which may also be in the runfiles for some tests in the repo.
  2. bazel test --nobuild_runfile_links --build_tests_only --remote_download_outputs=toplevel //....

After the second command is executed, many things in bazel-bin/my_target.runfiles/ will be broken symlinks because the files they pointed to were deleted by the second command.

Which operating system are you running Bazel on?

linux

What is the output of bazel info release?

release 5.2.0

If bazel info release returns development version or (@non-git), tell us how you built Bazel.

No response

What's the output of git remote get-url origin; git rev-parse master; git rev-parse HEAD ?

No response

Have you found anything relevant by searching the web?

No response

Any other information, logs, or outputs that you want to share?

No response

@sgowroji sgowroji added type: bug untriaged team-Remote-Exec Issues and PRs for the Execution (Remote) team labels Jun 22, 2022
@meisterT meisterT added P2 We'll consider working on this in future. (Assignee optional) and removed untriaged labels Jul 14, 2022
@coeuvre
Copy link
Member

coeuvre commented Sep 7, 2023

I believe this should be fixed by recent changes. Also see #18580 about --nobuild_runfile_links.

@coeuvre coeuvre closed this as completed Sep 7, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
P2 We'll consider working on this in future. (Assignee optional) team-Remote-Exec Issues and PRs for the Execution (Remote) team type: bug
Projects
None yet
Development

No branches or pull requests

4 participants