Skip to content

Conversation

@reidbaker
Copy link
Contributor

@reidbaker reidbaker commented Aug 18, 2025

We are seeing failures because java is not installed on builds where java should be installed.
https://ci.chromium.org/ui/p/flutter/builders/try/Linux%20Engine%20Drone/3520859/overview

Thread on this topic.
https://chat.google.com/room/AAAAm69vf-M/dDN5s5vjedA

Hypothesis is that java is installed but some builds need java 21 instead of 17.

Related to #173986

Pre-launch Checklist

  • I read the [Contributor Guide] and followed the process outlined there for submitting PRs.
  • I read the [Tree Hygiene] wiki page, which explains my responsibilities.
  • I read and followed the [Flutter Style Guide], including [Features we expect every widget to implement].
  • I signed the [CLA].
  • I listed at least one issue that this PR fixes in the description above.
  • I updated/added relevant documentation (doc comments with ///).
  • I added new tests to check the change I am making, or this PR is [test-exempt].
  • I followed the [breaking change policy] and added [Data Driven Fixes] where supported.
  • All existing and new tests are passing.

@github-actions github-actions bot added the engine flutter/engine related. See also e: labels. label Aug 18, 2025
Copy link
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request updates the default Java version from 17 to 21 for Linux, Mac, and Windows builds in the engine's CI configuration, with the aim of resolving build failures. The changes in .ci.yaml correctly bump the version number. My review includes a suggestion to use YAML anchors to define the Java version in a single place, which would improve the maintainability of this configuration file. As a potential follow-up, it would be beneficial to review and rename related files that reference the old Java version in their names (e.g., dev/devicelab/bin/tasks/android_java17_dependency_smoke_tests.dart) to maintain consistency across the codebase.

dependencies: >-
[
{"dependency": "open_jdk", "version": "version:17"},
{"dependency": "open_jdk", "version": "version:21"},
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

Since the Java version is updated in three places, consider using a YAML anchor to define it once. This would improve maintainability by ensuring consistency and simplifying future updates, especially if this experimental change is made permanent. 1

For example, you could define a java_version anchor:

# At the top of the file, perhaps in a 'vars' section
vars:
  java_version: &java_version "version:21"

And then reference it where needed:

          {"dependency": "open_jdk", "version": *java_version}

Style Guide References

Footnotes

  1. The style guide encourages writing code correctly for better maintainability. Using YAML anchors to avoid repeating the version string aligns with this principle by making the configuration cleaner and easier to update. (link)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

engine flutter/engine related. See also e: labels.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant