- The rule breaks compatibility with future LTS releases because a feature it depends on is removed from Bazel at HEAD.
- The rule breaks compatibility with the current or older LTS releases because a feature it depends on is only available in newer Bazel LTS releases.
Manageable migration process
While it’s obviously not feasible to guarantee compatibility between every version of Bazel and every version of the rule, our aim is to ensure that the migration process remains manageable for Bazel users. A manageable migration process is defined as a process where users are not forced to upgrade the rule’s major version and Bazel’s major version simultaneously, thereby allowing users to handle incompatible changes from one source at a time. For example, with the following compatibility matrix:- Migrating from rules_foo 1.x + Bazel 4.x to rules_foo 2.x + Bazel 5.x is not considered manageable, as the users need to upgrade the major version of rules_foo and Bazel at the same time.
- Migrating from rules_foo 2.x + Bazel 5.x to rules_foo 3.x + Bazel 6.x is considered manageable, as the users can first upgrade rules_foo from 2.x to 3.x without changing the major Bazel version, then upgrade Bazel from 5.x to 6.x.
| rules_foo 1.x | rules_foo 2.x | rules_foo 3.x | HEAD | |
|---|---|---|---|---|
| Bazel 4.x | ✅ | ❌ | ❌ | ❌ |
| Bazel 5.x | ❌ | ✅ | ✅ | ❌ |
| Bazel 6.x | ❌ | ❌ | ✅ | ✅ |
| HEAD | ❌ | ❌ | ❌ | ✅ |
Best practices
As Bazel rules authors, you can ensure a manageable migration process for users by following these best practices:- The rule should follow Semantic Versioning: minor versions of the same major version are backward compatible.
- The rule at HEAD should be compatible with the latest Bazel LTS release.
- The rule at HEAD should be compatible with Bazel at HEAD. To achieve this,
you can
- Set up your own CI testing with Bazel at HEAD
- Add your project to Bazel downstream testing; the Bazel team files issues to your project if breaking changes in Bazel affect your project, and you must follow our downstream project policies to address issues timely.
- The latest major version of the rule must be compatible with the latest Bazel LTS release.
- A new major version of the rule should be compatible with the last Bazel LTS release supported by the previous major version of the rule.
- Request backward-compatible features to be back-ported to the latest LTS release, check out release process for more details.
- Use bazel_features to do Bazel feature detection.