Skip to content

Commit 7cda9db

Browse files
committed
install-from-source.sh: fix libssl Alpine pkgs
The version of libssl available in the Alpine package feeds changed with version 3.15. The latest libssl package is 1.1 in 3.14.x and earlier, but newer versions only have libssl3. Add a check for the Alpine version in the install from source script and switch between installing libssl3 and libssl1.1 depending on the distro version. Also add another entry to the test matrix of distributions to include a 3.14.x Alpine version.
1 parent e4284a2 commit 7cda9db

File tree

2 files changed

+13
-1
lines changed

2 files changed

+13
-1
lines changed

.github/workflows/validate-install-from-source.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ jobs:
2424
- image: tgagor/centos-stream
2525
- image: redhat/ubi8
2626
- image: alpine
27+
- image: alpine:3.14.10
2728
- image: opensuse/leap
2829
- image: opensuse/tumbleweed
2930
- image: registry.suse.com/suse/sle15:15.4.27.11.31

src/linux/Packaging.Linux/install-from-source.sh

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -137,6 +137,10 @@ print_unsupported_distro() {
137137
echo "See https://gh.io/gcm/linux for details."
138138
}
139139

140+
version_at_least() {
141+
[ "$(printf '%s\n' "$1" "$2" | sort -V | head -n1)" = "$1" ]
142+
}
143+
140144
sudo_cmd=
141145

142146
# If the user isn't root, we need to use `sudo` for certain commands
@@ -189,7 +193,14 @@ case "$distribution" in
189193
$sudo_cmd apk update
190194

191195
# Install dotnet/GCM dependencies.
192-
install_packages apk add "curl git icu-libs krb5-libs libgcc libintl libssl1.1 libstdc++ zlib which bash coreutils gcompat"
196+
# Alpine 3.14 and earlier need libssl1.1, while later versions need libssl3.
197+
if ( version_at_least "3.15" $version ) then
198+
libssl_pkg="libssl3"
199+
else
200+
libssl_pkg="libssl1.1"
201+
fi
202+
203+
install_packages apk add "curl git icu-libs krb5-libs libgcc libintl $libssl_pkg libstdc++ zlib which bash coreutils gcompat"
193204

194205
ensure_dotnet_installed
195206
;;

0 commit comments

Comments
 (0)