Configure rules behaviour/toolchain attributes via build settings #1570
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
Configure rules via build settings instead of attributes on toolchain.
Eventually toolchain should contain only attributes that are scala version specific (ie jars, scalac opts, executables)
For backwards compatibility make this behaviour configurable (ie either use attributes on toolchain or build flags) by
//scala/settings:scala_toolchain_flags
boolean flag which defaults to false meaning keep current behaviour.Flags are put under
//scala/settings:*
with names matching to toolchain attributes.Motivation
Many scala toolchain attributes are not dependent on scala version, but rather control rules behaviour or enables some features. This becomes more relevant when multiple scala versions are used during the build, which would require setting same attributes to same values for each scala version.
This would prevent having different configs per scala version, but it's doable fairly easily. On the other hand I'm not sure this is needed. For example when strict_deps are enabled most likely it's irrelevant what scala version is used.
TODOS: add docs, add tests, remove toolchains for tests that flip single flag.