Skip to content

Commit ac6247a

Browse files
rumyaxkirill-ivlev
andauthored
Explain error when downloading Node Alpine ARM64 (#4822)
Co-authored-by: Kirill Ivlev <[email protected]>
1 parent 5aaa84f commit ac6247a

File tree

2 files changed

+15
-9
lines changed

2 files changed

+15
-9
lines changed

.vsts.ci.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ parameters:
3333
- name: alpine_arm64
3434
type: boolean
3535
displayName: Alpine (ARM64)
36-
default: false
36+
default: true
3737
- name: macOS_x64
3838
type: boolean
3939
displayName: macOS (x64)

src/Misc/externals.sh

Lines changed: 14 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -36,15 +36,20 @@ else
3636
fi
3737

3838
function failed() {
39-
local error=${1:-Undefined error}
40-
echo "Failed: $error" >&2
41-
exit 1
39+
local error=${1:-Undefined error}
40+
local command_identifier=$2
41+
echo "Failed: $error" >&2
42+
if [[ $command_identifier == 'download_node_alpine_arm64' ]]; then
43+
echo "Node for Alpine ARM64 not found in blob storage. If the version of Node (for tasks execution) has been updated, it should be built for Alpine ARM64 and uploaded to blob storage. Read documentation about the agent release for more info."
44+
fi
45+
exit 1
4246
}
4347

4448
function checkRC() {
4549
local rc=$?
50+
local command_identifier=$2
4651
if [ $rc -ne 0 ]; then
47-
failed "${1} failed with return code $rc"
52+
failed "${1} failed with return code $rc" $command_identifier
4853
fi
4954
}
5055

@@ -56,6 +61,7 @@ function acquireExternalTool() {
5661
# of the nested TEE-CLC-14.0.4 directory are moved up one directory, and then the empty directory
5762
# TEE-CLC-14.0.4 is removed.
5863
local dont_uncompress=$4
64+
local tool_name=$5
5965

6066
# Extract the portion of the URL after the protocol. E.g. vstsagenttools.blob.core.windows.net/tools/pdbstr/1/pdbstr.zip
6167
local relative_url="${download_source#*://}"
@@ -84,7 +90,7 @@ function acquireExternalTool() {
8490
# -S Show error. With -s, make curl show errors when they occur
8591
# -L Follow redirects (H)
8692
# -o FILE Write to FILE instead of stdout
87-
curl --retry 10 -fkSL -o "$partial_target" "$download_source" 2>"${download_target}_download.log" || checkRC 'curl'
93+
curl --retry 10 -fkSL -o "$partial_target" "$download_source" 2>"${download_target}_download.log" || checkRC 'curl' "download_${tool_name}"
8894

8995
# Move the partial file to the download target.
9096
mv "$partial_target" "$download_target" || checkRC 'mv'
@@ -205,11 +211,11 @@ else
205211
ARCH="linux-arm64-musl"
206212

207213
if [[ "$INCLUDE_NODE10" == "true" ]]; then
208-
acquireExternalTool "${CONTAINER_URL}/nodejs/${ARCH}/node-v${NODE10_VERSION}-${ARCH}.tar.gz" node10/bin fix_nested_dir
214+
acquireExternalTool "${CONTAINER_URL}/nodejs/${ARCH}/node-v${NODE10_VERSION}-${ARCH}.tar.gz" node10/bin fix_nested_dir false node_alpine_arm64
209215
fi
210216

211-
acquireExternalTool "${CONTAINER_URL}/nodejs/${ARCH}/node-v${NODE16_VERSION}-${ARCH}.tar.gz" node16/bin fix_nested_dir
212-
acquireExternalTool "${CONTAINER_URL}/nodejs/${ARCH}/node-v${NODE20_VERSION}-${ARCH}.tar.gz" node20_1/bin fix_nested_dir
217+
acquireExternalTool "${CONTAINER_URL}/nodejs/${ARCH}/node-v${NODE16_VERSION}-${ARCH}.tar.gz" node16/bin fix_nested_dir false node_alpine_arm64
218+
acquireExternalTool "${CONTAINER_URL}/nodejs/${ARCH}/node-v${NODE20_VERSION}-${ARCH}.tar.gz" node20_1/bin fix_nested_dir false node_alpine_arm64
213219
else
214220
case $PACKAGERUNTIME in
215221
"linux-musl-x64") ARCH="linux-x64-musl";;

0 commit comments

Comments
 (0)