Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Windows: Make runfiles symlink tree actions depend on the runfiles ar…
…tifacts. Windows distinguishes between symlinks to files and symlinks to directories. The code to create symlink trees on Windows thus inspects the targets of the links to learn what kind of symlink to make. Unfortunately, the symlinking code did not depend on the link targets actually being created. This race could lead to non-deterministic and non-functional symlink trees. Fix this problem by depending on runfiles artifacts in the SymtreeTreeAction when the host platform is Windows. It's certainly possible to avoid this os-dependent input dependency—by using in-memory Artifact state for the in-process implementation and extending the runfiles manifest format to indicate target type for build-runfiles-windows—but this commit is the most straightforward change that remediates the serious correctness issue represented by the previous state. This topic has a long history. When Windows runfiles trees were actually copies of artifacts, the "symlink" action obviously had to depend on the origin artifacts (41f4456). That code was removed in an interregnum period where runfiles trees weren't supported at all on Windows (0885abd). However, the dependency was not added back when Windows symlinked runfiles trees support was finally added (b592dbd). Closes #12018. PiperOrigin-RevId: 330496487
- Loading branch information