Skip to content

cc targets fail to build when path mapping is enabled, even when Cpp action path mapping is not enabled #334

@jjudd

Description

@jjudd

When trying out this toolchain in our main monorepo I noticed that enabling path mapping --experimental_output_paths=strip causes cc targets to fail to build, even though path mapping hasn't been enabled for Cpp actions.

I created a minimal repro case here: https://github.com/lucidsoftware/toolchains_llvm_bootstrapped_path_mapping_repro

Summary of the issue
It looks like this is an issue with this toolchain + path mapping and the RunBinary + CopyToDirectory actions.

Building a cc target with path mapping enabled results in an error like the following:

ERROR: /home/redacted/.cache/bazel/_bazel_redacted/c1aba044061d2d9d86019fc7d2ccee63/external/llvm+/runtimes/libcxx/BUILD.bazel:28:13: RunBinary external/llvm+/runtimes/libcxx/libc++.a failed: (Exit 1): llvm-ar failed: error executing RunBinary command (from _run_binary rule target @@llvm+//runtimes/libcxx:c++) external/llvm++http_archive+llvm-toolchain-minimal-21.1.8-linux-amd64/bin/llvm-ar rc bazel-out/k8-fastbuild/bin/external/llvm+/runtimes/libcxx/libc++.a '--format=gnu'

Use --sandbox_debug to see verbose messages from the sandbox and retain the sandbox build root for debugging
external/llvm++http_archive+llvm-toolchain-minimal-21.1.8-linux-amd64/bin/llvm-ar: error: bazel-out/k8-fastbuild/bin/external/llvm+/runtimes/libcxx/libc++.a: No such file or directory

This goes away if you opt out of path mapping for those actions:

common --modify_execution_info=RunBinary=-supports-path-mapping
common --modify_execution_info=CopyToDirectory=-supports-path-mapping

Metadata

Metadata

Assignees

Labels

No labels
No labels

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions