Skip to content

Why don't other rules use _allowlist_function_transition #767

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
UebelAndre opened this issue Jun 17, 2021 · 2 comments
Closed

Why don't other rules use _allowlist_function_transition #767

UebelAndre opened this issue Jun 17, 2021 · 2 comments
Labels

Comments

@UebelAndre
Copy link
Collaborator

Or more specifically, do the other rules support transitions?

Semi-related to #276 since I'm interested in cross-compilation.

@UebelAndre
Copy link
Collaborator Author

cc @hlopko

@hlopko
Copy link
Member

hlopko commented Jun 23, 2021

All the rules work under transitions. What is special about rust_wasm_bindgen is that the rule itself performs the transition when analyzing wasm_file attribute (the target passed as this attribute will be built with a different configuration than the rust_wasm_bindgen). Transitions are quite a special hammer that is rarely needed. And we currently don't need it for the core Rust rules.

Configuration transitions have the potential to explode Bazel memory, cpu, and execution times if used incorrectly. _allowlist_function_transition is a way to limit usage of the transition when you want to be careful. If the rule doesn't use a transition this attribute is useless.

But yeah when the need arises, we can use transitions with core Rust rules just fine.

@hlopko hlopko closed this as completed Jun 23, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants