continuous-integration icon indicating copy to clipboard operation
continuous-integration copied to clipboard

A pipeline should be able to suppress some flags from .bazelrc

Open aiuto opened this issue 4 years ago • 2 comments

While preparing Bazel 3.5 I encountered this problem

  • we flipped the default for a flag and removed it within the same release cycle. --experimental_allow_incremental_repository_updates
  • this caused rules_typescript to break. https://buildkite.com/bazel/bazel-at-head-plus-downstream/builds/1608#ceace0eb-4175-4b53-8717-71e722856fe6
Starting local Bazel server and connecting to it..
INFO: Reading rc options for 'version' from /var/lib/buildkite-agent/builds/bk-docker-fj3x/bazel-downstream-projects/rules_typescript/.bazelrc:
Inherited 'common' options: --experimental_allow_incremental_repository_updates
ERROR: --experimental_allow_incremental_repository_updates :: Unrecognized option: --experimental_allow_incremental_repository_updates
  • rules_typescript depended on the flag true, so it had to set it for 3.4.
  • if we change rules_typescript to not use the flag the tests will fail with the release bazel
  • if we do not change it, it fails with 3.5

But the problem is not really the issues. The point is that when we should be running overview pipelines without any experimental flags set. Individual rule sets might want that for their CI, but if we want a generally interoperable community, we can't allow any of them to require experimental features. So, pipelines like the federation need the ability to remove specific flags from .bazelrc. A regex to remove all --experimental, and/or all --incompatible would ensure that every rule set being tested in that pipeline is not at odds with any of the others. It should be a regex so we don't have to update the pipeline spec every time we add or remove a flag.

aiuto avatar Aug 21 '20 03:08 aiuto

Sounds like one important part of the fix is to not remove flipped flags immediately, but to make them undocumented no-ops and remove them after some time: https://cs.opensource.google/bazel/bazel/+/master:src/main/java/com/google/devtools/build/lib/bazel/rules/BazelRulesModule.java;l=51;drc=b100b1d65f45864efb8e9855cdce6e3de2deec66

philwo avatar Aug 21 '20 11:08 philwo

Yes! I didn't know about the graveyard. That should have been part of the incompatible flag policy docs from the beginning. The only change I would make is that when you move a flag there you add a comment with the release #, so that it is easy for people to clean out flags more than N releases old.

On Fri, Aug 21, 2020 at 7:11 AM Philipp Wollermann [email protected] wrote:

Sounds like one important part of the fix is to not remove flipped flags immediately, but to make them undocumented no-ops and remove them after some time: https://cs.opensource.google/bazel/bazel/+/master:src/main/java/com/google/devtools/build/lib/bazel/rules/BazelRulesModule.java;l=51;drc=b100b1d65f45864efb8e9855cdce6e3de2deec66

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/bazelbuild/continuous-integration/issues/1024#issuecomment-678237401, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAXHHHG44E5EJ56DH677BA3SBZI6NANCNFSM4QG3FGXA .

aiuto avatar Aug 21 '20 13:08 aiuto