Skip to content

Conversation

@aherrmann
Copy link

@aherrmann aherrmann commented Feb 4, 2026

rules_zig needs to invoke cc_common.link with the main_output parameter when users request linking via the C toolchain. Motivation for this linking mode is provided in aherrmann/rules_zig#519. The need for access to the main_output parameter is motivated in aherrmann/rules_zig#519 (comment).

rules_zig used to work around this issue with the same hack that rules_rust and rules_mojo applied, but this is no longer available as of Bazel 9.0.0, see aherrmann/rules_zig#589. As described in bazelbuild/bazel#23838 (comment) there does not seem to be any other work around available. So, I would like to request to add rules_zig to the list of rule sets that are allowed to use the private cc_common.link API.

Note, this is a blocker for Bazel 9.0.0 support in rules_zig, see aherrmann/rules_zig#592.

rules_zig needs to invoke `cc_common.link` with the `main_output`
parameter when users request linking via the C toolchain.

See motivation in aherrmann/rules_zig#519 (comment).
rules_zig used to work around this issue with the same hack that
rules_rust and rules_mojo applied, but this is no longer available as of
Bazel 9.0.0, see aherrmann/rules_zig#589.
@aherrmann
Copy link
Author

The CI failure may be unrelated:

🚨 Error: The command exited with status 4
user command error: running "plugin docker-buildkite-plugin command" shell hook: The plugin docker-buildkite-plugin command hook exited with status 4

@fmeum
Copy link
Collaborator

fmeum commented Feb 4, 2026

@trybka This serves as additional justification for #578.

@keith
Copy link
Member

keith commented Feb 4, 2026

this is a good idea, if this is preferred by googlers I will submit a similar PR for rules_mojo

@trybka
Copy link
Collaborator

trybka commented Feb 4, 2026

If I get pushback on approving #578 then I will approve this and a similar one for rules_mojo.

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.

4 participants