From 56f328fabbe25b0e70bd7fd19a859d9b8c9bf2f9 Mon Sep 17 00:00:00 2001 From: Craig Comstock Date: Fri, 1 May 2026 13:04:40 -0500 Subject: [PATCH 1/2] fix: add ci/fix-buildhost.sh to source /etc/profile especially for exotics which may have basic tools like ssh in odd places added to PATH in /etc/profile Ticket: ENT-14014 Changelog: none (cherry picked from commit a7aad11e7b72bdc5159359b0c49970e41d42e382) --- ci/fix-buildhost.sh | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100755 ci/fix-buildhost.sh diff --git a/ci/fix-buildhost.sh b/ci/fix-buildhost.sh new file mode 100755 index 000000000..7c1671ae3 --- /dev/null +++ b/ci/fix-buildhost.sh @@ -0,0 +1,12 @@ +if [ "$(uname)" = "HP-UX" ]; then + # /etc/profile contains tty code that won't work well when sourced and this VUE env var guards against running those bits + # https://ftp.mirrorservice.org/sites/www.bitsavers.org/pdf/hp/9000_hpux/9.x/B1171-90044_HP_Visual_User_Environment_System_Administration_Manual_Nov91.pdf + VUE=true + export VUE +fi + +if [ -f /etc/profile ]; then + # running on the proxied host or not we want to make sure local customizations are taken + # e.g. ent-14014: custom build of ssh needed for build-artifacts-cache needed and /etc/profile has PATH=/opt/craig/bin:$PATH + . /etc/profile +fi From a7bc04d643304d6c3dad0d1ea6fdba9d5f28c889 Mon Sep 17 00:00:00 2001 From: Craig Comstock Date: Fri, 1 May 2026 13:06:14 -0500 Subject: [PATCH 2/2] fix: tidy up ci/initialize-build-host.sh to be more quiet and fail if workspace cleanup fails Ticket: ENT-14029 Changelog: none (cherry picked from commit ad17ff8217d53d7624f27241c5ba07ad3b6d9b8d) --- ci/initialize-build-host.sh | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/ci/initialize-build-host.sh b/ci/initialize-build-host.sh index 1a4be22ea..c8203551a 100644 --- a/ci/initialize-build-host.sh +++ b/ci/initialize-build-host.sh @@ -72,6 +72,7 @@ set_github_status() return 0 } +# main() as it were, begin non-function definition section of script if broken_posix_shell >/dev/null 2>&1; then try_exec /usr/xpg4/bin/sh "$0" "$@" echo "No compatible shell script interpreter found." @@ -87,14 +88,14 @@ then trap set_github_status EXIT fi -# Make sure error detection and verbose output is on, if they aren't already. -set -x -e +# Make sure error detection is on, if it isn't already +set -e echo "Current user: $USER" echo "IP information:" -/sbin/ifconfig -a || true -/sbin/ip addr || true +command -v /sbin/ifconfig 2>/dev/null && /sbin/ifconfig -a || true +command -v /sbin/ip 2>/dev/null && /sbin/ip addr || true RSYNC="rsync --delete -zrlpt -T /tmp" @@ -371,7 +372,13 @@ then # job section yet. if [ -n "$WORKSPACE" ] then + $RSH $login rm -rf "$WORKSPACE_REMOTE" || true + # if the user can't delete it, try sudo, if sudo isn't available, that's ok, we tried $RSH $login sudo rm -rf "$WORKSPACE_REMOTE" || true + if $RSH $login ls "$WORKSPACE_REMOTE"; then + echo "$WORKSPACE_REMOTE is not removed on build host." + exit 2 + fi $RSH $login mkdir -p "$WORKSPACE_REMOTE" $RSYNC -e "$RSH" "$WORKSPACE"/ $login:"$WORKSPACE_REMOTE"/ fi