Skip to content

Conversation

@blorente
Copy link

@blorente blorente commented Dec 9, 2025

Otherwise, depending on the tool target is usually not enough to use the tool as part of the Bazel build.

For instance: I'm trying to use pkg-config to compile the alsa-sys crate. I want to point the PKG_CONFIG env var to a pkg-config managed by rules_multitool, so I do it through an annotation:

crate.annotation(
    build_script_env = {
        "PKG_CONFIG": "$(execpath @multitool//tools/pkg-config:pkg-config)",
    },
    build_script_tools = [ # Works really well with multitool, since it selects for the `exec` platform.
        "@multitool//tools/pkg-config:pkg-config",
    ],
    crate = "alsa-sys",
)

Before this change, only the symlink got materialized in the sandbox, so it (understandably) failed to run. Now, the symlink's target is also materialized.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant