When LLVMProfDataAction runs llvm-profdata, the environment configuration is only forwarded from --action_env, but not from the toolchain configuration. ctx.actions.run() doesn't use the env keyword argument at all:
|
ctx.actions.run( |
|
mnemonic = "LLVMProfDataAction", |
|
executable = llvm_profdata, |
|
tools = [all_files], |
|
arguments = [ctx.actions.args().add("merge").add("-o").add(profile_artifact).add(raw_profile_artifact)], |
|
inputs = [raw_profile_artifact], |
|
outputs = [profile_artifact], |
|
use_default_shell_env = True, |
|
progress_message = "LLVMProfDataAction: Generating %{output}", |
|
) |
This causes the action fail in our case, where llvm-profdata is part of the fully hermetic C++ toolchain and therefore requires the hermetic location of its libraries to be added to LD_LIBRARY_PATH.
A naive implementation (which works in our case) is shown on the WIP PR #639.
When
LLVMProfDataActionrunsllvm-profdata, the environment configuration is only forwarded from--action_env, but not from the toolchain configuration.ctx.actions.run()doesn't use theenvkeyword argument at all:rules_cc/cc/private/rules_impl/fdo/fdo_context.bzl
Lines 306 to 315 in cdf9913
This causes the action fail in our case, where
llvm-profdatais part of the fully hermetic C++ toolchain and therefore requires the hermetic location of its libraries to be added toLD_LIBRARY_PATH.A naive implementation (which works in our case) is shown on the WIP PR #639.