Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(cli): use localExecRoot if possible when constructing path to res…
…ults files (#7299) Synced from #768 by withered-magic: use `localExecRoot` if possible when constructing path to results files during `aspect lint` --- Currently, when remote caching is enabled and `readBEPFile` needs to handle `bytestream` URIs, it constructs the path to the corresponding results file using the workspace root, such that the resulting path looks something like `/path/to/workspace/bazel-out/k8-fastbuild/bin/path/to/file`. However, this only works if the convenience symlinks are in place; if the convenience symlinks have been disabled, e.g. if `--experimental_convenience_symlinks=ignore` is specified in `.bazelrc`, then such paths are no longer valid, and `aspect lint` fails with the following sort of error: ``` Error: failed to find lint results file /path/to/workspace/bazel-out/k8-fastbuild/bin/file1.AspectRulesLintESLint.out.exit_code: stat /path/to/workspace/bazel-out/k8-fastbuild/bin/file1.AspectRulesLintESLint.out.exit_code: no such file or directory ``` Therefore, in the case when the convenience symlinks are missing, the path to the results file must be constructed using the execroot as the base. Fortunately, since we are already processing BEP events, we can simply use the `workspaceInfo` event to record the current execroot and later use it to construct paths as needed. --- ### Changes are visible to end-users: yes - Searched for relevant documentation and updated as needed: yes - Breaking change (forces users to change their own code or config): no - Suggested release notes appear below: yes ### Test plan - Manual testing; please provide instructions so we can reproduce: Added a repro with instructions here: https://github.com/withered-magic/aspect-cli-repro Closes [#768](#768) Co-authored-by: withered-magic <[email protected]> GitOrigin-RevId: 9141bac4333aeb052c0f9aec1e6b3683a45d2adc
- Loading branch information