Skip to content
This repository was archived by the owner on Nov 30, 2023. It is now read-only.

Commit 30f120c

Browse files
authored
Resolve unexpected failure in Go, tighten logic fallback logic (#1403)
1 parent c03fc5b commit 30f120c

File tree

3 files changed

+12
-4
lines changed

3 files changed

+12
-4
lines changed

script-library/container-features/test-features.env

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,5 +50,5 @@ _VSC_INSTALL_DESKTOP_LITE=true
5050
_VSC_INSTALL_DOTNET=true
5151
_BUILD_ARG_DOTNET_VERSION=latest
5252
_BUILD_ARG_DOTNET_RUNTIMEONLY=false
53-
_VSC_INSTALL_FISH=true
53+
#_VSC_INSTALL_FISH=true
5454
_VSC_INSTALL_AWS_CLI=true

script-library/go-debian.sh

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -170,18 +170,26 @@ if [ "${TARGET_GO_VERSION}" != "none" ] && ! type go > /dev/null 2>&1; then
170170
set -e
171171
if [ "$exit_code" != "0" ]; then
172172
echo "(!) Download failed."
173-
# Try one break fix version number less if we get a failure
173+
# Try one break fix version number less if we get a failure. Use "set +e" since "set -e" can cause failures in valid scenarios.
174+
set +e
174175
major="$(echo "${TARGET_GO_VERSION}" | grep -oE '^[0-9]+' || echo '')"
175176
minor="$(echo "${TARGET_GO_VERSION}" | grep -oP '^[0-9]+\.\K[0-9]+' || echo '')"
176177
breakfix="$(echo "${TARGET_GO_VERSION}" | grep -oP '^[0-9]+\.[0-9]+\.\K[0-9]+' 2>/dev/null || echo '')"
178+
# Handle Go's odd version pattern where "0" releases omit the last part
177179
if [ "${breakfix}" = "" ] || [ "${breakfix}" = "0" ]; then
178180
((minor=minor-1))
179181
TARGET_GO_VERSION="${major}.${minor}"
182+
# Look for latest version from previous minor release
180183
find_version_from_git_tags TARGET_GO_VERSION "https://go.googlesource.com/go" "tags/go" "." "true"
181184
else
182185
((breakfix=breakfix-1))
183-
TARGET_GO_VERSION="${major}.${minor}.${breakfix}"
186+
if [ "${breakfix}" = "0" ]; then
187+
TARGET_GO_VERSION="${major}.${minor}"
188+
else
189+
TARGET_GO_VERSION="${major}.${minor}.${breakfix}"
190+
fi
184191
fi
192+
set -e
185193
echo "Trying ${TARGET_GO_VERSION}..."
186194
curl -fsSL -o /tmp/go.tar.gz "https://golang.org/dl/go${TARGET_GO_VERSION}.linux-${architecture}.tar.gz"
187195
fi

script-library/test/regression/run-scripts.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ fi
8181
if [ "${DISTRO}" = "debian" ]; then
8282
run_script awscli
8383
run_script azcli
84-
run_script fish "false ${USERNAME}"
84+
# run_script fish "false ${USERNAME}"
8585
run_script git-from-src "latest true"
8686
run_script git-lfs "" "2.13.3"
8787
run_script github

0 commit comments

Comments
 (0)