Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[ci] Add template for setting *JAVA_HOME vars #9671

Merged
merged 6 commits into from
Jan 14, 2025
Merged

Conversation

pjcollins
Copy link
Member

@pjcollins pjcollins commented Jan 10, 2025

Adds a setup-jdk-variables.yaml template to set the JAVA_HOME and
JI_JAVA_HOME variables from a single script location.

A new JI_JAVA_HOME_DEFAULT variable will also be set to point to a
current JDK that can be used to run various Android SDK tools as needed.

Consolidating this logic should make it easier to update the default
JDK version we install and/or test against in the future.

Build jobs and some test jobs that run on custom agents will use the
default android-toolchain path that xaprepare installs into.

Most other test jobs will attempt to use the value of a preinstalled JDK
found at $JAVA_HOME_$(JAVA_VERSION)_$(OS_ARCH) if it is defined.

@pjcollins
Copy link
Member Author

/azp run

Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@pjcollins
Copy link
Member Author

/azp run

Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@pjcollins
Copy link
Member Author

pjcollins commented Jan 10, 2025

@pjcollins
Copy link
Member Author

/azp run

Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@pjcollins pjcollins marked this pull request as ready for review January 13, 2025 19:00
Copy link
Member

@jonathanpeppers jonathanpeppers left a comment

Choose a reason for hiding this comment

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

The changes look ok to me. 👍

You might double check some of the failing nightly test lanes, just to make sure they don't say "error can't find JDK".

Copy link
Contributor

@jpobst jpobst left a comment

Choose a reason for hiding this comment

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

👍 Looks good if the nightly test failures are expected. It appears our nightly tests are already in bad shape so I don't know if there's any new issues.

steps:
- pwsh: |
$agentOS="$(Agent.OS)"
$agentArch="$(Agent.OSArchitecture)"
Copy link
Contributor

Choose a reason for hiding this comment

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

There is likely a bug here because $(Agent.OSArchitecture) will be ARM64, the environment variable is JAVA_HOME_17_arm64, and environment variable names are case sensitive on Mac/Linux. But I can fix this in my ARM64 PR since I can test it easier.

@pjcollins pjcollins merged commit 0475a60 into main Jan 14, 2025
74 of 80 checks passed
@pjcollins pjcollins deleted the dev/pjc/setup-jdk-ci branch January 14, 2025 00:14
grendello added a commit that referenced this pull request Jan 14, 2025
* main:
  [ci] Add template for setting JAVA_HOME vars (#9671)
  Bump com.android.tools.build:manifest-merger from 31.7.3 to 31.8.0 (#9678)
  Bump to dotnet/sdk@2dd591056f 10.0.100-alpha.1.25062.16 (#9679)
  Bump com.android.tools:r8 from 8.5.35 to 8.7.18 (#9677)
  Bump to dotnet/java-interop@4f06201 (#9676)
  Bump to dotnet/android-api-docs@492e524d (#9668)
  [build] Support JDK-21 (#9672)
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.

3 participants