Skip to content

Conversation

@cehoffman
Copy link
Contributor

When rust_library creates a proc-macro, the macro_wrapper generates a rust_proc_macro_alias that handles the exec-dep semantics. However, if the caller specifies exec_compatible_with to constrain which execution platforms can build the proc-macro, this constraint wasn't being forwarded to the alias.

This matters when proc-macros need to be built with a specific toolchain. For example, when using nightly rustc for analysis (like dylint), proc-macros must also be built with nightly for ABI compatibility. Without forwarding exec_compatible_with, the alias could resolve to any execution platform, potentially building the proc-macro with the wrong toolchain.

Single line change - forward exec_compatible_with from kwargs to rust_proc_macro_alias.

When rust_library creates a proc-macro, the macro_wrapper generates a
rust_proc_macro_alias that handles the exec-dep semantics. However, if the
caller specifies exec_compatible_with to constrain which execution platforms
can build the proc-macro, this constraint wasn't being forwarded to the alias.

This matters when proc-macros need to be built with a specific toolchain. For
example, when using nightly rustc for analysis (like dylint), proc-macros must
also be built with nightly for ABI compatibility. Without forwarding
exec_compatible_with, the alias could resolve to any execution platform,
potentially building the proc-macro with the wrong toolchain.

Forward exec_compatible_with from kwargs to the rust_proc_macro_alias so
callers can properly constrain proc-macro execution platform selection.
@meta-cla meta-cla bot added the CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. label Jan 14, 2026
@meta-codesync
Copy link
Contributor

meta-codesync bot commented Jan 14, 2026

@facebook-github-bot has imported this pull request. If you are a Meta employee, you can view this in D90673792. (Because this pull request was imported automatically, there will not be any future comments.)

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

Labels

CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed.

1 participant