Skip to content

LLVMProfDataAction doesn't respect environment variables set by cc_toolchain_config #640

@kmARC

Description

@kmARC

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    P3We're not considering working on this, but happy to review a PR. (No assignee)

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions