Skip to content

Commit 91e76ab

Browse files
authored
fix gradle caching (#4270)
## Motivation and Context Still seeing intermittent transient failures due to Gradle wrapper failing to download ## Description #4217 was meant to fix this, I think we just missed that the installation and wrapper is being downloaded to an intermediate image rather than the final image. The final image did not have the gradle wrapper binary nor the env variable related to it set. ``` > env | sort ... GRADLE_USER_HOME=/home/build/.gradle ... > [localbuild@047e7e4b0e64 build]$ ls -lsa /home/build/.gradle total 40 4 drwxr-xr-x. 10 build build 4096 Aug 15 14:39 . 4 drwxrwxr-x. 1 build build 4096 Aug 15 14:54 .. 4 drwxr-xr-x. 7 build build 4096 Aug 15 14:38 caches 4 drwxr-xr-x. 3 build build 4096 Aug 15 14:38 daemon 4 drwxr-xr-x. 2 build build 4096 Aug 15 14:38 jdks 4 drwxr-xr-x. 2 build build 4096 Aug 15 14:39 kotlin-profile 4 drwxr-xr-x. 5 build build 4096 Aug 15 14:38 native 4 drwxr-xr-x. 3 build build 4096 Aug 15 14:38 notifications 4 drwxr-xr-x. 3 build build 4096 Aug 15 14:39 .tmp 4 drwxr-xr-x. 3 build build 4096 Aug 15 14:38 wrapper ``` ## Testing Build image locally and see that gradle wrapper is present and GRADLE_USER_HOME is set. ---- _By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice._
1 parent ab1adb0 commit 91e76ab

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

tools/ci-build/Dockerfile

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,7 @@ RUN set -eux; \
9090

9191
FROM install_rust AS local_tools
9292
ARG rust_nightly_version
93+
ENV GRADLE_USER_HOME=/home/build/.gradle
9394
COPY . tools/ci-build
9495
# when `checkout_smithy_rs_tools` is set to true, this commit will be checked out
9596
ARG smithy_rs_commit_hash=main
@@ -229,13 +230,15 @@ COPY --chown=build:build --from=local_tools /opt/cargo/bin/mdbook /opt/cargo/bin
229230
COPY --chown=build:build --from=local_tools /opt/cargo/bin/mdbook-mermaid /opt/cargo/bin/mdbook-mermaid
230231
COPY --chown=build:build --from=nodejs /opt/nodejs /opt/nodejs
231232
COPY --chown=build:build --from=musl_toolchain /usr/local/musl/ /usr/local/musl/
233+
COPY --chown=build:build --from=local_tools /home/build/.gradle /home/build/.gradle
232234
ENV PATH=/opt/nodejs/bin:/opt/cargo/bin:$PATH:/usr/local/musl/bin/ \
233235
NODE_HOME=/opt/nodejs \
234236
CARGO_HOME=/opt/cargo \
235237
RUSTUP_HOME=/opt/rustup \
236238
RUST_STABLE_VERSION=${rust_stable_version} \
237239
RUST_NIGHTLY_VERSION=${rust_nightly_version} \
238240
CARGO_INCREMENTAL=0 \
241+
GRADLE_USER_HOME=/home/build/.gradle \
239242
LANG=en_US.UTF-8 \
240243
LC_ALL=en_US.UTF-8
241244
# SMITHY_RS_DOCKER_BUILD_IMAGE indicates to build scripts that they are being built inside of the Docker build image.

0 commit comments

Comments
 (0)