Closed stepancheg closed 1 month ago
Summary: I need to add more starlark globals in crates which buck2_interpreter_for_build does not depend on, and while LateBinding works, it requires more work.
buck2_interpreter_for_build
LateBinding
New idea is to use linkme.
We already use linkme to
https://www.internalfb.com/code/fbsource/[a60e45a76980bdb5849c16b1c57e23bdefef0b9a]/fbcode/buck2/app/buck2_build_api/src/interpreter/rule_defs/cmd_args/command_line_arg_like_type.rs?lines=39-40
buck2 help-env
https://www.internalfb.com/code/fbsource/[a60e45a76980bdb5849c16b1c57e23bdefef0b9a]/fbcode/buck2/app/buck2_core/src/env/registry.rs?lines=26-27
That would be third. It is
#[ctor]
so I'm not 100% sure. But how much cleaner code is now!
Empty
init_late_bindings() {}
are kept to avoid triggering various tools from linters to linkers, who may start removing dependencies.
Differential Revision: D56078261
This pull request was exported from Phabricator. Differential Revision: D56078261
Summary: I need to add more starlark globals in crates which
buck2_interpreter_for_build
does not depend on, and whileLateBinding
works, it requires more work.New idea is to use linkme.
We already use linkme to
https://www.internalfb.com/code/fbsource/[a60e45a76980bdb5849c16b1c57e23bdefef0b9a]/fbcode/buck2/app/buck2_build_api/src/interpreter/rule_defs/cmd_args/command_line_arg_like_type.rs?lines=39-40
buck2 help-env
https://www.internalfb.com/code/fbsource/[a60e45a76980bdb5849c16b1c57e23bdefef0b9a]/fbcode/buck2/app/buck2_core/src/env/registry.rs?lines=26-27
That would be third. It is
#[ctor]
(which resulted in introduction ofLateBinding
so I'm not 100% sure. But how much cleaner code is now!
Empty
are kept to avoid triggering various tools from linters to linkers, who may start removing dependencies.
Differential Revision: D56078261