Skip to content

Fix and update Bazel build/test configuration: - #483

Merged
copybara-service[bot] merged 1 commit into
masterfrom
test_996790401
Oct 13, 2026
Merged

copybara-service[bot] merged 1 commit into
masterfrom
test_996790401

Conversation

@copybara-service

@copybara-service copybara-service Bot commented Oct 9, 2026 •

Copy link
Copy Markdown

Fix and update Bazel build/test configuration:

  • Run Bazel CI tests under the configured matrix JDK runtimes rather than always using .bazelrc's default runtime (which prior to this CL was JDK 21).
  • Standardize the version matrix on [8, 11, 25].
    • I will have to bypass the Copybara presubmit for this CL because it will still be looking for a JDK 22 Flogger job instead of the new JDK 25 job (b/360096677). Maybe I should rename all our projects' "25" jobs to "latest LTS"....
    • I will "have to" update the Flogger branch-protection rules to require the new JDK 25 job instead of the JDK 22 job that I'm removing. (IIRC, nothing actually blocks on that, but it's nice for it to match our "real" rules.)
      • Huh, apparently GitHub is nudging me from branch-protection rules to "rulesets." I'm not going to worry about that now.
  • For Bazel toolchain/exec operations, use a JDK 25 (including allowing Java 25 language features), and for the bazel/mvn VM itself, have CI request JDK 27.
    • 25 (as the most recent LTS) is the newest version that Bazel has available for automatic download across all platforms. (It has 27 for Linux only.)
  • For selecting the language version, use --java_language_version=8 instead of --release or -source -target. It's shorter and more standard, and Bazel even silences the deprecation warning that we'd otherwise see when targeting 8.
  • Remove redundant debug-info javac options (-g) in Flogger: rules_java enables it (along with -parameters) by default nowadays.
  • Enable --experimental_one_version_enforcement=error as widely as we can.
  • Upgrade Flogger's bazel_common dep.
  • Set test --test_env=TZ=UTC.
  • Configure ci.yml to cache the right(?) Bazel information (~/.cache/bazel/*/cache, including cache/repos/v1, instead of ~/.cache/bazel/*/*/external).

Prep work:

  • Skip Flogger tests that use Mockito under Java 8. Mockito 5+ requires Java 11+. (It would make sense to skip under Java 9 and Java 10, too, but meh.)
  • Set --jvmopt=-Dnet.bytebuddy.experimental=true for Flogger to enable support for Java-25 class files.

Compare cl/996591293.

RELNOTES=n/a

@copybara-service copybara-service Bot changed the title Run Bazel CI tests under the configured matrix JDK runtimes rather than always using .bazelrc's default JDK 21 runtime. Fix and update Bazel build/test configuration: Oct 12, 2026
@copybara-service
copybara-service Bot force-pushed the test_996790401 branch 2 times, most recently from 61cc4e4 to 95b8100 Compare October 13, 2026 20:23
- Run Bazel CI tests under the configured matrix JDK runtimes rather than always using `.bazelrc`'s default runtime (which prior to this CL was JDK 21).
- Standardize the version matrix on [8, 11, 25].
  - I will have to bypass the Copybara presubmit for this CL because it will still be looking for a JDK 22 Flogger job instead of the new JDK 25 job (b/360096677). Maybe I should rename all our projects' "25" jobs to "latest LTS"....
  - I will "have to" update [the Flogger branch-protection rules](https://github.com/google/flogger/settings/branch_protection_rules/42636378) to require the new JDK 25 job instead of the JDK 22 job that I'm removing. (IIRC, nothing actually blocks on that, but it's nice for it to match our "real" rules.)
    - Huh, apparently GitHub is nudging me from branch-protection rules to ["rulesets."](https://docs.github.com/en/repositories/configuring-branches-and-merges-in-your-repository/managing-rulesets/about-rulesets) I'm not going to worry about that now.
- For Bazel toolchain/`exec` operations, use a JDK 25 (including allowing Java 25 language features), and for the `bazel`/`mvn` VM itself, have CI request JDK 27.
  - 25 (as the most recent LTS) is the newest version that Bazel has available for automatic download across all platforms. (It has 27 for Linux only.)
- For selecting the language version, use `--java_language_version=8` instead of `--release` or `-source -target`. It's shorter and more standard, and Bazel even silences the deprecation warning that we'd otherwise see when targeting 8.
- Remove redundant debug-info javac options (`-g`) in Flogger: `rules_java` enables it (along with `-parameters`) by default nowadays.
- Enable `--experimental_one_version_enforcement=error` as widely as we can.
- Upgrade Flogger's `bazel_common` dep.
- Set `test --test_env=TZ=UTC`.
- Configure `ci.yml` to cache the right(?) Bazel information (`~/.cache/bazel/*/cache`, including `cache/repos/v1`, instead of `~/.cache/bazel/*/*/external`).

Prep work:
- Skip Flogger tests that use Mockito under Java 8. Mockito 5+ requires Java 11+. (It would make sense to skip under Java 9 and Java 10, too, but meh.)
- Set `--jvmopt=-Dnet.bytebuddy.experimental=true` for Flogger to enable support for Java-25 class files.

Compare cl/996591293.

RELNOTES=n/a
PiperOrigin-RevId: 998856377
@copybara-service
copybara-service Bot merged commit 519e32b into master Oct 13, 2026
@copybara-service
copybara-service Bot deleted the test_996790401 branch October 13, 2026 20:32
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