Skip to content

Commit e24a7bc

Browse files
peffgitster
authored andcommitted
ci: unify ubuntu and ubuntu32 dependencies
The script to install dependencies has two separate entries for 32-bit and 64-bit Ubuntu systems. This increases the maintenance burden since both should need roughly the same packages. That hasn't been too bad so far because we've stayed on the same 32-bit image since 2017. Trying to move to a newer image revealed several problems with the linux32 job: - newer images complain about using "linux32 --32bit i386", due to seccomp restrictions. We can loosen these with a docker option, but I don't think running it is even doing anything. We use it only for pretending to "apt" that we're on a 32-bit machine, but inside the container image apt is already configured as a 32-bit system (even though the kernel outside the container is obviously 64-bit). Using the same apt invocation for both architectures just gets rid of this call entirely. - we set DEBIAN_FRONTEND to avoid hanging on packages that ask the user questions. This wasn't a problem on the old image, but it is on newer ones. The 64-bit stanza handles this already. As a bonus, the 64-bit stanza uses "apt -q" instead of redirecting output to /dev/null. This would have saved me a lot of debugging time trying to figure out why it was hanging. :) - the old image seems to have zlib-dev installed by default, but newer ones do not. In addition, there were probably many tests being skipped on the 32-bit build because we didn't have support packages installed (e.g., gpg). Now we'll run them. We do need to keep some parts split off just for 64-bit systems: our p4 and lfs installs reference x86_64/amd64 binaries. The downloaded jgit should work in theory, since it's just a jar file embedded in a shell script that relies on the system java. But the system java in our image is too old, so I've left it as 64-bit only for now. Signed-off-by: Jeff King <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 48c5594 commit e24a7bc

File tree

1 file changed

+16
-18
lines changed

1 file changed

+16
-18
lines changed

ci/install-dependencies.sh

Lines changed: 16 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ fedora-*)
3333
dnf -yq update >/dev/null &&
3434
dnf -yq install make gcc findutils diffutils perl python3 gettext zlib-devel expat-devel openssl-devel curl-devel pcre2-devel >/dev/null
3535
;;
36-
ubuntu-*)
36+
ubuntu-*|ubuntu32-*)
3737
# Required so that apt doesn't wait for user input on certain packages.
3838
export DEBIAN_FRONTEND=noninteractive
3939

@@ -45,25 +45,23 @@ ubuntu-*)
4545
libemail-valid-perl libio-pty-perl libio-socket-ssl-perl libnet-smtp-ssl-perl libdbd-sqlite3-perl libcgi-pm-perl \
4646
${CC_PACKAGE:-${CC:-gcc}} $PYTHON_PACKAGE
4747

48-
mkdir --parents "$CUSTOM_PATH"
49-
wget --quiet --directory-prefix="$CUSTOM_PATH" \
50-
"$P4WHENCE/bin.linux26x86_64/p4d" "$P4WHENCE/bin.linux26x86_64/p4"
51-
chmod a+x "$CUSTOM_PATH/p4d" "$CUSTOM_PATH/p4"
48+
case "$distro" in
49+
ubuntu-*)
50+
mkdir --parents "$CUSTOM_PATH"
5251

53-
wget --quiet "$LFSWHENCE/git-lfs-linux-amd64-$LINUX_GIT_LFS_VERSION.tar.gz"
54-
tar -xzf "git-lfs-linux-amd64-$LINUX_GIT_LFS_VERSION.tar.gz" \
55-
-C "$CUSTOM_PATH" --strip-components=1 "git-lfs-$LINUX_GIT_LFS_VERSION/git-lfs"
56-
rm "git-lfs-linux-amd64-$LINUX_GIT_LFS_VERSION.tar.gz"
52+
wget --quiet --directory-prefix="$CUSTOM_PATH" \
53+
"$P4WHENCE/bin.linux26x86_64/p4d" "$P4WHENCE/bin.linux26x86_64/p4"
54+
chmod a+x "$CUSTOM_PATH/p4d" "$CUSTOM_PATH/p4"
5755

58-
wget --quiet "$JGITWHENCE" --output-document="$CUSTOM_PATH/jgit"
59-
chmod a+x "$CUSTOM_PATH/jgit"
60-
;;
61-
ubuntu32-*)
62-
sudo linux32 --32bit i386 sh -c '
63-
apt update >/dev/null &&
64-
apt install -y build-essential libcurl4-openssl-dev \
65-
libssl-dev libexpat-dev gettext python >/dev/null
66-
'
56+
wget --quiet "$LFSWHENCE/git-lfs-linux-amd64-$LINUX_GIT_LFS_VERSION.tar.gz"
57+
tar -xzf "git-lfs-linux-amd64-$LINUX_GIT_LFS_VERSION.tar.gz" \
58+
-C "$CUSTOM_PATH" --strip-components=1 "git-lfs-$LINUX_GIT_LFS_VERSION/git-lfs"
59+
rm "git-lfs-linux-amd64-$LINUX_GIT_LFS_VERSION.tar.gz"
60+
61+
wget --quiet "$JGITWHENCE" --output-document="$CUSTOM_PATH/jgit"
62+
chmod a+x "$CUSTOM_PATH/jgit"
63+
;;
64+
esac
6765
;;
6866
macos-*)
6967
export HOMEBREW_NO_AUTO_UPDATE=1 HOMEBREW_NO_INSTALL_CLEANUP=1

0 commit comments

Comments
 (0)