Skip to content
Unverified Commit 98796250 authored by Landon James's avatar Landon James Committed by GitHub
Browse files

Move gradle cache step out of conditional (#4217)

## Motivation and Context
<!--- Why is this change required? What problem does it solve? -->
<!--- If it fixes an open issue, please link to the issue here -->
Improve the CI build Docker image by updating the gradle binary caching
logic to properly support both x86_64 and ARM64 (aarch64) architectures.

## Description
<!--- Describe your changes in detail -->
* Dynamically set JAVA_HOME based on the architecture of the build
machine
* Modified the smithy-rs repository cloning process to ensure gradle
binary caching works consistently

Note that this fixes a bug with our existing Dockerfile. We were
manually setting `JAVA_HOME` to the `x86_64` variant of the Java binary
from `yum`. This worked even on M series Macs because we never invoked
Java in the image build and the image currently only runs on `x86_64`
machines. But if you shelled into the container on a Mac and tried to
run Gradle it would fail because yum actually downloaded the `aarch64`
binary. The update to dynamically set `JAVA_HOME` accounts for this so
now the container should work equally well on `x86_64` or `aarch64`.

## Testing
<!--- Please describe in detail how you tested your changes -->
<!--- Include details of your testing environment, and the tests you ran
to -->
<!--- see how your change affects other areas of the code, etc. -->
Was able to build on my M1 mac and shell into the container and do some
basic gradle builds. It successfully builds and runs all CI on GH, so
should work in any environments we care about.


----

_By submitting this pull request, I confirm that you can use, modify,
copy, and redistribute this contribution, under the terms of your
choice._
parent 662330b5
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment