Skip to content

Commit b0026da

Browse files
committedApr 24, 2025·
ci: skip unavailable external software
The ci/install-dependencies.sh script used in a very early phase of our CI jobs downloads Perforce, Git-LFS, and JGit, used for running the test scripts. The test framework is prepared to properly skip the tests that depend on these external software, but the CI script is unnecessarily strict (due to its use of "set -e" in ci/lib.sh) and fails the entire CI run before even starting to test the rest of the system. Notice a failure to download to any of these external software, but keep going. We need to be careful about cleaning after a failed wget, as a later part of the script that does: if type jgit >/dev/null 2>&1 then echo "$(tput setaf 6)JGit Version$(tput sgr0)" jgit version else echo >&2 "WARNING: JGit wasn't installed, see above for clues why" fi will (surprise!) succeed running "type jgit", and then fail with "jgit version", taking the whole thing down due to "set -e". Signed-off-by: Junio C Hamano <[email protected]>
1 parent 683c54c commit b0026da

File tree

1 file changed

+22
-9
lines changed

1 file changed

+22
-9
lines changed
 

‎ci/install-dependencies.sh

Lines changed: 22 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -66,16 +66,29 @@ ubuntu-*|i386/ubuntu-*|debian-*)
6666
mkdir --parents "$CUSTOM_PATH"
6767

6868
wget --quiet --directory-prefix="$CUSTOM_PATH" \
69-
"$P4WHENCE/bin.linux26x86_64/p4d" "$P4WHENCE/bin.linux26x86_64/p4"
70-
chmod a+x "$CUSTOM_PATH/p4d" "$CUSTOM_PATH/p4"
71-
72-
wget --quiet "$LFSWHENCE/git-lfs-linux-amd64-$LINUX_GIT_LFS_VERSION.tar.gz"
69+
"$P4WHENCE/bin.linux26x86_64/p4d" \
70+
"$P4WHENCE/bin.linux26x86_64/p4" &&
71+
chmod a+x "$CUSTOM_PATH/p4d" "$CUSTOM_PATH/p4" || {
72+
rm -f "$CUSTOM_PATH/p4"
73+
rm -f "$CUSTOM_PATH/p4d"
74+
echo >&2 "P4 download (optional) failed"
75+
}
76+
77+
wget --quiet \
78+
"$LFSWHENCE/git-lfs-linux-amd64-$LINUX_GIT_LFS_VERSION.tar.gz" &&
7379
tar -xzf "git-lfs-linux-amd64-$LINUX_GIT_LFS_VERSION.tar.gz" \
74-
-C "$CUSTOM_PATH" --strip-components=1 "git-lfs-$LINUX_GIT_LFS_VERSION/git-lfs"
75-
rm "git-lfs-linux-amd64-$LINUX_GIT_LFS_VERSION.tar.gz"
76-
77-
wget --quiet "$JGITWHENCE" --output-document="$CUSTOM_PATH/jgit"
78-
chmod a+x "$CUSTOM_PATH/jgit"
80+
-C "$CUSTOM_PATH" --strip-components=1 \
81+
"git-lfs-$LINUX_GIT_LFS_VERSION/git-lfs" &&
82+
rm "git-lfs-linux-amd64-$LINUX_GIT_LFS_VERSION.tar.gz" || {
83+
rm -f "$CUSTOM_PATH/git-lfs"
84+
echo >&2 "LFS download (optional) failed"
85+
}
86+
87+
wget --quiet "$JGITWHENCE" --output-document="$CUSTOM_PATH/jgit" &&
88+
chmod a+x "$CUSTOM_PATH/jgit" || {
89+
rm -f "$CUSTOM_PATH/jgit"
90+
echo >&2 "JGit download (optional) failed"
91+
}
7992
;;
8093
esac
8194
;;

0 commit comments

Comments
 (0)
Please sign in to comment.