Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Ensure runfiles output manifest is gone before making it a link.
After 0763dd0, the test included in this CL fails like this: ``` ** test_switch_runfiles_from_enabled_to_disabled ******************************* Computing main repo mapping: Loading: Loading: 0 packages loaded Analyzing: target //:out (1 packages loaded, 0 targets configured) INFO: Analyzed target //:out (42 packages loaded, 172 targets configured). INFO: Found 1 target... [0 / 2] [Prepa] BazelWorkspaceStatusAction stable-status.txt Target //:out up-to-date: bazel-bin/out INFO: Elapsed time: 0.391s, Critical Path: 0.02s INFO: 5 processes: 4 internal, 1 local. INFO: Build completed successfully, 5 total actions Computing main repo mapping: Loading: Loading: 0 packages loaded WARNING: Build option --enable_runfiles has changed, discarding analysis cache (this can be expensive, see https://bazel.build/advanced/performance/iteration-speed). Analyzing: target //:out (1 packages loaded, 0 targets configured) INFO: Analyzed target //:out (1 packages loaded, 173 targets configured). INFO: Found 1 target... [0 / 3] [Prepa] BazelWorkspaceStatusAction stable-status.txt ERROR: workspace/BUILD:6:8: Executing genrule //:g failed: java.io.IOException: execroot/main/bazel-out/k8-opt-exec-ST-e846b08c7501/bin/cmd.runfiles/MANIFEST (File exists) Target //:out failed to build Use --verbose_failures to see the command lines of failed build steps. INFO: Elapsed time: 0.177s, Critical Path: 0.01s INFO: 4 processes: 4 internal. ERROR: Build did NOT complete successfully ``` This is because `FileSystemUtils.copyFile` ensured that the target was removed before writing to the target while `Path.createSymbolicLink` does not. Insert a `delete()` call to fix the problem. Also, rename `copyManifest` to `linkManifest` for accuracy. Closes #19382. PiperOrigin-RevId: 562519152 Change-Id: I8683f84daaa6f827a3022fead50687e4d2eb34d9
- Loading branch information