Skip to content

Commit 5086b37

Browse files
authored
install-from-source.sh: fix libssl Alpine pkgs (#1582)
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. This replaces the two other PRs that aimed to address this issue: - #1535 - #1574 Tested the updated workflow here: https://github.com/git-ecosystem/git-credential-manager/actions/runs/8698286553/job/23855027830
2 parents 1ed7037 + 7cda9db commit 5086b37

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)