This is just an idea, I'd really appreciate some feedback and ideas.
Is it conceivably possible to rewrite the generator in pure starlark? This would remove the bootstrapping problem of distributing generator binaries or hackily building the generator with the native cargo toolchain.
|
def cargo_bazel_bootstrap(name = "cargo_bazel_bootstrap", rust_version = rust_common.default_version): |
We're using a custom generator to work around some issues, but this makes the analysis phase almost a minute slower as repository rules are not remotely cacheable.
Finished release [optimized] target(s) in 38.77s
Failing a full rewrite, some more ideas:
- Rewrite only some functionality in starlark.
- Move some functionality out of the repository rule and into just a normal rule. This could be achieved with a macro. The normal rule could then check if repinning is required, whilst allowing the repository rule to generate the build files it needs.
Thanks for taking the time to read this :) Please don't hesitate to ask any questions.
This is just an idea, I'd really appreciate some feedback and ideas.
Is it conceivably possible to rewrite the generator in pure starlark? This would remove the bootstrapping problem of distributing generator binaries or hackily building the generator with the native cargo toolchain.
rules_rust/crate_universe/deps_bootstrap.bzl
Line 9 in 59fab4e
We're using a custom generator to work around some issues, but this makes the analysis phase almost a minute slower as repository rules are not remotely cacheable.
Failing a full rewrite, some more ideas:
Thanks for taking the time to read this :) Please don't hesitate to ask any questions.