You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@armandomontanez and I have been working on improving toolchain configuration for C++, and we presented our work at bazelcon last year (youtube video, slides). Recently, I started working on decoupling this work from rules_cc.
I recommend looking at the example lang_library definition here and the toolchain definition here to see how rules_rust would makke use of it. It is most definitely not ready for use yet, but I wanted to ask whether rules_rust would be interested in onboarding.
The TLDR of how it works is that rules_rust would come up with a bunch of different actions (eg. compile, link, proc_macro_compile), and then rather than running ctx.actions.run, you would just call run_action(action_type = compile, variables = struct(source_files = [main.rs], libraries = [foo.dylib], output_file = [main], features = ["foo"], static = False, sysroot = path/to/sysroot), and the toolchain config would then calculate what tool to use, what input files it requires, and the command-line invocation to run.
A quick skim of issues on the issue tracker reveals that it can solve a variety of issues that commonly pop up, such as #2833, #1711, #1034, #3045, #2701 and #1623.
I believe that in the future, most toolchains will migrate to this, as it makes rulesets significantly easier to write, and makes toolchains far more customizable with zero effort from the ruleset maintainer.
The text was updated successfully, but these errors were encountered:
@armandomontanez and I have been working on improving toolchain configuration for C++, and we presented our work at bazelcon last year (youtube video, slides). Recently, I started working on decoupling this work from rules_cc.
I recommend looking at the example lang_library definition here and the toolchain definition here to see how rules_rust would makke use of it. It is most definitely not ready for use yet, but I wanted to ask whether rules_rust would be interested in onboarding.
The TLDR of how it works is that rules_rust would come up with a bunch of different actions (eg. compile, link, proc_macro_compile), and then rather than running
ctx.actions.run
, you would just callrun_action(action_type = compile, variables = struct(source_files = [main.rs], libraries = [foo.dylib], output_file = [main], features = ["foo"], static = False, sysroot = path/to/sysroot)
, and the toolchain config would then calculate what tool to use, what input files it requires, and the command-line invocation to run.A quick skim of issues on the issue tracker reveals that it can solve a variety of issues that commonly pop up, such as #2833, #1711, #1034, #3045, #2701 and #1623.
I believe that in the future, most toolchains will migrate to this, as it makes rulesets significantly easier to write, and makes toolchains far more customizable with zero effort from the ruleset maintainer.
The text was updated successfully, but these errors were encountered: