facebook / buck2

Build system, successor to Buck
https://buck2.build/
Apache License 2.0
3.33k stars 194 forks source link

Testing linker issue on windows (Use linkme to collect starlark globals) #620

Closed stepancheg closed 1 month ago

stepancheg commented 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.

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

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

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

facebook-github-bot commented 1 month ago

This pull request was exported from Phabricator. Differential Revision: D56078261