Skip to content

Commit 343c8bf

Browse files
authored
Fix package distribution. Specify OS explicitly (#4434) (#4435)
* Pass OS information explicitly to package-distribution * libssl3 variants for ubuntu24.04 * detail flag for time64
1 parent d0a3330 commit 343c8bf

File tree

3 files changed

+39
-16
lines changed

3 files changed

+39
-16
lines changed

.azure/obtemplates/build-linux-packages.yml

+1
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@ jobs:
4646
inputs:
4747
pwsh: false
4848
filePath: scripts/package-distribution.ps1
49+
arguments: -OS $(os)
4950
- script: | # prepare 2 sets of packages for signing with different keys (gen = general purpose, cbl = cbl-mariner)
5051
mkdir $(Build.SourcesDirectory)/artifacts/dist/gen
5152
find $(Build.SourcesDirectory)/artifacts/dist -type f -exec mv -t $(Build.SourcesDirectory)/artifacts/dist/gen/ {} +

scripts/make-packages.sh

+21-8
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,8 @@ CONFIG=Release
1414
NAME=libmsquic
1515
TLS=openssl
1616
TLSVERSION=1.1
17-
UBUNTU=
17+
TIME64DISTRO="False"
18+
XDP="False"
1819
CONFLICTS=
1920
DESCRIPTION="Microsoft implementation of the IETF QUIC protocol"
2021
VENDOR="Microsoft"
@@ -86,9 +87,13 @@ while :; do
8687
shift
8788
OUTPUT=$1
8889
;;
89-
-u|-ubuntu|--ubuntu)
90+
-x|-xdp|--xdp)
9091
shift
91-
UBUNTU=$1
92+
XDP=$1
93+
;;
94+
-time64|--time64)
95+
shift
96+
TIME64DISTRO=$1
9297
;;
9398
-t|-tls|--tls)
9499
shift
@@ -134,8 +139,9 @@ echo "ARCH=$ARCH PKGARCH=$PKGARCH ARTIFACTS=$ARTIFACTS"
134139
mkdir -p ${OUTPUT}
135140

136141
if [ "$OS" == "linux" ]; then
137-
# Ubuntu 24.04 dependencies are not fully validated on redhat/centos etc.
138-
if [ "$UBUNTU" != '2404' ]; then
142+
# XDP is only validated on Ubuntu 24.04 and x64
143+
if [ "$XDP" == "False" ] || [[ "$ARCH" == arm* ]]; then
144+
echo "Building rpm package"
139145
# RedHat/CentOS
140146
FILES="${ARTIFACTS}/libmsquic.${LIBEXT}.${VER_MAJOR}.${VER_MINOR}.${VER_PATCH}=/usr/${LIBDIR}/libmsquic.${LIBEXT}.${VER_MAJOR}.${VER_MINOR}.${VER_PATCH}"
141147
FILES="${FILES} ${ARTIFACTS}/libmsquic.${LIBEXT}.${VER_MAJOR}=/usr/${LIBDIR}/libmsquic.${LIBEXT}.${VER_MAJOR}"
@@ -183,7 +189,13 @@ if [ "$OS" == "linux" ]; then
183189
FILES="${FILES} ${ARTIFACTS}/libmsquic.lttng.${LIBEXT}.${VER_MAJOR}.${VER_MINOR}.${VER_PATCH}=/usr/${LIBDIR}/libmsquic.lttng.${LIBEXT}.${VER_MAJOR}.${VER_MINOR}.${VER_PATCH}"
184190
fi
185191

186-
if [ "$UBUNTU" == '2404' ]; then
192+
BITS=''
193+
if [ "$TIME64DISTRO" == "True" ]; then
194+
BITS='t64'
195+
fi
196+
197+
if [ "$XDP" == "True" ] && [[ "$ARCH" == x* ]]; then
198+
echo "Building deb package (XDP)"
187199
fpm \
188200
--force \
189201
--input-type dir \
@@ -192,7 +204,7 @@ if [ "$OS" == "linux" ]; then
192204
--name ${NAME} \
193205
--provides ${NAME} \
194206
--conflicts ${CONFLICTS} \
195-
--depends "libssl${TLSVERSION}" \
207+
--depends "libssl${TLSVERSION}${BITS}" \
196208
--depends "libnuma1" \
197209
--depends "libxdp1" \
198210
--depends "libnl-route-3-200" \
@@ -206,6 +218,7 @@ if [ "$OS" == "linux" ]; then
206218
--log error \
207219
${FILES} ${ARTIFACTS}/datapath_raw_xdp_kern.o=/usr/${LIBDIR}/datapath_raw_xdp_kern.o
208220
else
221+
echo "Building deb package"
209222
fpm \
210223
--force \
211224
--input-type dir \
@@ -214,7 +227,7 @@ if [ "$OS" == "linux" ]; then
214227
--name ${NAME} \
215228
--provides ${NAME} \
216229
--conflicts ${CONFLICTS} \
217-
--depends "libssl${TLSVERSION}" \
230+
--depends "libssl${TLSVERSION}${BITS}" \
218231
--depends "libnuma1" \
219232
--version ${VER_MAJOR}.${VER_MINOR}.${VER_PATCH} \
220233
--description "${DESCRIPTION}" \

scripts/package-distribution.ps1

+17-8
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,19 @@
66
77
#>
88

9+
param (
10+
[Parameter(Mandatory = $false)]
11+
[ValidateSet("ubuntu_2404", "ubuntu_2204", "ubuntu_2004", "")]
12+
[string]$OS = ""
13+
)
14+
15+
$UseXdp = $false
16+
$Time64Distro = $false
17+
if ($OS -eq "ubuntu_2404") {
18+
$UseXdp = $true
19+
$Time64Distro = $true
20+
}
21+
922
Set-StrictMode -Version 'Latest'
1023
$PSDefaultParameterValues['*:ErrorAction'] = 'Stop'
1124

@@ -167,17 +180,13 @@ foreach ($Build in $AllBuilds) {
167180
if ($BuildBaseName -like "*openssl3*") {
168181
$Tls = "openssl3"
169182
}
170-
$UbuntuVersion = "none"
171-
$match = [regex]::Match($BuildBaseName, "ubuntu_(\d{4})")
172-
if ($match.Success) {
173-
$UbuntuVersion = $match.Groups[1].Value
174-
}
183+
175184
if ($BuildBaseName -like "*arm64_*") {
176-
& $RootDir/scripts/make-packages.sh --output $DistDir --arch arm64 --tls $Tls --ubuntu $UbuntuVersion
185+
& $RootDir/scripts/make-packages.sh --output $DistDir --arch arm64 --tls $Tls --xdp $UseXdp --time64 $Time64Distro
177186
} elseif ($BuildBaseName -like "*arm_*") {
178-
& $RootDir/scripts/make-packages.sh --output $DistDir --arch arm --tls $Tls --ubuntu $UbuntuVersion
187+
& $RootDir/scripts/make-packages.sh --output $DistDir --arch arm --tls $Tls --xdp $UseXdp --time64 $Time64Distro
179188
} else {
180-
& $RootDir/scripts/make-packages.sh --output $DistDir --tls $Tls --ubuntu $UbuntuVersion # x64
189+
& $RootDir/scripts/make-packages.sh --output $DistDir --tls $Tls --xdp $UseXdp --time64 $Time64Distro # x64
181190
}
182191
Set-Location $OldLoc
183192
}

0 commit comments

Comments
 (0)