Skip to content

Allow rules_rs to use cc_common.link#705

Open
dzbarsky wants to merge 1 commit intobazelbuild:mainfrom
dzbarsky:zbarsky/rules_rs
Open

Allow rules_rs to use cc_common.link#705
dzbarsky wants to merge 1 commit intobazelbuild:mainfrom
dzbarsky:zbarsky/rules_rs

Conversation

@dzbarsky
Copy link
Copy Markdown
Contributor

@dzbarsky dzbarsky commented Apr 26, 2026

rules_rs is an alternative Rust ruleset that is gaining adoption within the OS community. This change allows it to link against a cc_library using linkstamp, just like rules_rust is allowed to.

As an aside, this allowlist mechanism feels pretty unfortunate. It explicitly privileges Google rulesets and is mostly internal-only. I suspect the compile actions list may not even work if crubit is consumed as a bazel module instead of vendored into the repo like Google does? In addition, the entire open-source world pays the cost for these allowlist checks. Even after @fmeum 's optimizations in bazelbuild/bazel#28173 and bazelbuild/bazel#28178 they are non-0 cost. Perhaps these can be implemented as static analysis checks within Google instead of the entire world paying runtime cost?

@keith
Copy link
Copy Markdown
Member

keith commented Apr 26, 2026

FWIW for specific API that feel very stable I think we should remove them from the check. But I ofc also agree that this list is pretty aggressive. especially now that you can easily patch them out

@dzbarsky
Copy link
Copy Markdown
Contributor Author

FWIW for specific API that feel very stable I think we should remove them from the check. But I ofc also agree that this list is pretty aggressive. especially now that you can easily patch them out

Yes, I'm also +1 on stabilizing APIs, but for the benefit of Google folks who may not be super familiar with open-source Bazel I want to point out that only end users can patch this list, anyone publishing code consumed by others is unable to apply patches transparently, which is a huge pain point for other language rulesets, toolchains, etc :)

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.

2 participants