Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

🚩 Lift flags to configurations #240

Merged
merged 1 commit into from
May 18, 2024
Merged

Conversation

aaronmondal
Copy link
Contributor

Previously we passed Nix-specific configuration globally to Bazel's action_env. This caused every change in the Nix configs to invalidate the entire build graph.

The new setup no longer influences any rules_cc invocations and selectively injects flags only into the transitioned ll_toolchains when they're actually needed. This maximizes the potential for cache reuse after changing the nix configuration and is overall a more modular and idiomatic approach.

The new flags may be manually overridden via e.g.
--@rules_ll//ll:LL_CFLAGS=x:y:z.

This change also introduces *_string_flags attributes for ll_* rules which may be used to pass in Bazel-Skylib's string_flag targets to ll_* targets. These new flags follow the common pattern of supporting multiple arguments, separated by colons.

Previously we passed Nix-specific configuration globally to Bazel's
`action_env`. This caused every change in the Nix configs to invalidate
the entire build graph.

The new setup no longer influences any `rules_cc` invocations and
selectively injects flags only into the transitioned `ll_toolchains`
when they're actually needed. This maximizes the potential for cache
reuse after changing the nix configuration and is overall a more modular
and idiomatic approach.

The new flags may be manually overridden via e.g.
`--@rules_ll//ll:LL_CFLAGS=x:y:z`.

This change also introduces `*_string_flags` attributes for `ll_*` rules
which may be used to pass in Bazel-Skylib's `string_flag` targets to
`ll_*` targets. These new flags follow the common pattern of supporting
multiple arguments, separated by colons.
@aaronmondal aaronmondal merged commit 5ac0546 into eomii:main May 18, 2024
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant