From fe8136035812f1d596f8aafb182d3230af0a155d Mon Sep 17 00:00:00 2001 From: Ludovic Henry Date: Sat, 3 Feb 2024 15:22:02 +0000 Subject: [PATCH] Update GNUPGHOME variable more broadly It's an issue on linux-riscv64 valuation pipelines for jdk23. See https://ci.adoptium.net/job/build-scripts/job/jobs/job/evaluation/job/jobs/job/jdk23/job/jdk23-evaluation-linux-riscv64-temurin/2/console for example. --- .../alpine-linux.sh | 10 ++++++++++ .../platform-specific-configurations/linux.sh | 14 ++++++++++---- sbin/prepareWorkspace.sh | 9 --------- 3 files changed, 20 insertions(+), 13 deletions(-) diff --git a/build-farm/platform-specific-configurations/alpine-linux.sh b/build-farm/platform-specific-configurations/alpine-linux.sh index 1b3eedbcf..1c9342879 100644 --- a/build-farm/platform-specific-configurations/alpine-linux.sh +++ b/build-farm/platform-specific-configurations/alpine-linux.sh @@ -36,6 +36,16 @@ else export BUILD_ARGS="${BUILD_ARGS} --skip-freetype" fi +## This affects Alpine docker images and also evaluation pipelines +if [ "$(pwd | wc -c)" -gt 83 ]; then + # Use /tmp for alpine in preference to $HOME as Alpine fails gpg operation if PWD > 83 characters + # Alpine also cannot create ~/.gpg-temp within a docker context + GNUPGHOME="$(mktemp --directory /tmp/.gpg-temp.XXXXX)" +else + GNUPGHOME="${WORKSPACE:-$PWD}/.gpg-temp" +fi +export GNUPGHOME + BOOT_JDK_VARIABLE="JDK${JDK_BOOT_VERSION}_BOOT_DIR" if [ ! -d "$(eval echo "\$$BOOT_JDK_VARIABLE")" ]; then bootDir="$PWD/jdk-$JDK_BOOT_VERSION" diff --git a/build-farm/platform-specific-configurations/linux.sh b/build-farm/platform-specific-configurations/linux.sh index 3bc43a484..a6bb6c5bb 100755 --- a/build-farm/platform-specific-configurations/linux.sh +++ b/build-farm/platform-specific-configurations/linux.sh @@ -27,6 +27,16 @@ else export BUILD_ARGS="${BUILD_ARGS} --skip-freetype" fi +## This affects Alpine docker images and also evaluation pipelines +if [ "$(pwd | wc -c)" -gt 83 ]; then + # Use /tmp for alpine in preference to $HOME as Alpine fails gpg operation if PWD > 83 characters + # Alpine also cannot create ~/.gpg-temp within a docker context + GNUPGHOME="$(mktemp --directory /tmp/.gpg-temp.XXXXX)" +else + GNUPGHOME="${WORKSPACE:-$PWD}/.gpg-temp" +fi +export GNUPGHOME + NATIVE_API_ARCH=$(uname -m) if [ "${NATIVE_API_ARCH}" = "x86_64" ]; then NATIVE_API_ARCH=x64; fi if [ "${NATIVE_API_ARCH}" = "armv7l" ]; then NATIVE_API_ARCH=arm; fi @@ -136,10 +146,6 @@ function downloadBootJDK() { ARCH=$1 VER=$2 - export GNUPGHOME=$PWD/.gnupg-temp - if [ ! -d "$GNUPGHOME" ]; then - mkdir -m 700 "$GNUPGHOME" - fi export downloadArch case "$ARCH" in "riscv64") downloadArch="$NATIVE_API_ARCH";; diff --git a/sbin/prepareWorkspace.sh b/sbin/prepareWorkspace.sh index caddef32d..c94397fc7 100644 --- a/sbin/prepareWorkspace.sh +++ b/sbin/prepareWorkspace.sh @@ -319,15 +319,6 @@ checkingAndDownloadingAlsa() { curl -o "alsa-lib.tar.bz2" "$ALSA_BUILD_URL" curl -o "alsa-lib.tar.bz2.sig" "https://www.alsa-project.org/files/pub/lib/alsa-lib-${ALSA_LIB_VERSION}.tar.bz2.sig" - ## This affects Alpine docker images and also evaluation pipelines - if [ "$(pwd | wc -c)" -gt 83 ]; then - # Use /tmp for alpine in preference to $HOME as Alpine fails gpg operation if PWD > 83 characters - # Alpine also cannot create ~/.gpg-temp within a docker context - export GNUPGHOME="/tmp/.gpg-temp.$$" - else - export GNUPGHOME="${WORKSPACE:-$PWD}/.gpg-temp" - fi - echo "GNUPGHOME=$GNUPGHOME" mkdir -p "$GNUPGHOME" && chmod og-rwx "$GNUPGHOME" # Should we clear this directory up after checking?