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

Ensure GPG temp dir can be created for long build folder paths on linux riscv64 #3663

Merged
merged 5 commits into from
Feb 21, 2024
Merged
11 changes: 6 additions & 5 deletions sbin/prepareWorkspace.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#!/bin/bash
# shellcheck disable=SC2155,SC1091,SC2196
# shellcheck disable=SC2155,SC1091,SC2196,SC2235

################################################################################
# Licensed under the Apache License, Version 2.0 (the "License");
Expand Down Expand Up @@ -319,10 +319,11 @@ 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 [ -r /etc/alpine-release ] && [ "$(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
## This affects riscv64 & Alpine docker images and also evaluation pipelines
if ( [ -r /etc/alpine-release ] && [ "$(pwd | wc -c)" -gt 83 ] ) || \
( [ "${BUILD_CONFIG[OS_KERNEL_NAME]}" == "linux" ] && [ "${BUILD_CONFIG[OS_ARCHITECTURE]}" == "riscv64" ] && [ "$(pwd | wc -c)" -gt 83 ] ); then
# Use /tmp in preference to $HOME as fails gpg operation if PWD > 83 characters
# Also cannot create ~/.gpg-temp within a docker context
GNUPGHOME="$(mktemp -d /tmp/.gpg-temp.XXXXXX)"
else
GNUPGHOME="${BUILD_CONFIG[WORKSPACE_DIR]:-$PWD}/.gpg-temp"
Expand Down
Loading