Skip to content

Commit 62ad14a

Browse files
stephanosiokeith-packard
authored andcommitted
ci: Use tar.xz format for Linux and macOS build artifacts
This commit updates the CI workflow to output .tar.xz archives for the Linux and macOS build artifacts. The XZ format uses the LZMA compression algorithm, which offers significantly improved data compression ratio. Note that the `-T0` XZ option is used to perform multi-threaded compression in spite of reduced compression ratio; otherwise, compressing the distribution bundle may take tens of minutes to complete. For more details, refer to the issue #567. Signed-off-by: Stephanos Ioannidis <[email protected]>
1 parent 01fbee4 commit 62ad14a

File tree

2 files changed

+26
-21
lines changed

2 files changed

+26
-21
lines changed

.github/workflows/ci.yml

Lines changed: 25 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -216,7 +216,7 @@ jobs:
216216
"name": "linux-x86_64",
217217
"runner": "zephyr-runner-linux-x64-4xlarge",
218218
"container": "ghcr.io/zephyrproject-rtos/sdk-build:v1.2.3",
219-
"archive": "tar.gz"
219+
"archive": "tar.xz"
220220
},'
221221
fi
222222
@@ -225,7 +225,7 @@ jobs:
225225
"name": "linux-aarch64",
226226
"runner": "zephyr-runner-linux-x64-4xlarge",
227227
"container": "ghcr.io/zephyrproject-rtos/sdk-build:v1.2.3",
228-
"archive": "tar.gz"
228+
"archive": "tar.xz"
229229
},'
230230
fi
231231
@@ -234,7 +234,7 @@ jobs:
234234
"name": "macos-x86_64",
235235
"runner": "zephyr_runner-macos-x86_64",
236236
"container": "",
237-
"archive": "tar.gz"
237+
"archive": "tar.xz"
238238
},'
239239
fi
240240
@@ -243,7 +243,7 @@ jobs:
243243
"name": "macos-aarch64",
244244
"runner": "zephyr_runner-macos-x86_64",
245245
"container": "",
246-
"archive": "tar.gz"
246+
"archive": "tar.xz"
247247
},'
248248
fi
249249
@@ -289,7 +289,7 @@ jobs:
289289
"runner": "ubuntu-20.04",
290290
"container": "",
291291
"bundle-host": "linux-x86_64",
292-
"bundle-archive": "tar.gz"
292+
"bundle-archive": "tar.xz"
293293
},'
294294
fi
295295
@@ -299,7 +299,7 @@ jobs:
299299
"runner": "macos-11",
300300
"container": "",
301301
"bundle-host": "macos-x86_64",
302-
"bundle-archive": "tar.gz"
302+
"bundle-archive": "tar.xz"
303303
},'
304304
fi
305305
@@ -754,8 +754,9 @@ jobs:
754754
ARCHIVE_NAME=toolchain_${{ matrix.host.name }}_${{ matrix.target }}
755755
ARCHIVE_FILE=${ARCHIVE_NAME}.${{ matrix.host.archive }}
756756
757-
if [ "${{ matrix.host.archive }}" == "tar.gz" ]; then
758-
${TAR} -zcvf ${ARCHIVE_FILE} \
757+
if [ "${{ matrix.host.archive }}" == "tar.xz" ]; then
758+
XZ_OPT="-T0" \
759+
${TAR} -Jcvf ${ARCHIVE_FILE} \
759760
--owner=0 --group=0 -C ${OUTPUT_BASE}/${OUTPUT_DIR} ${{ matrix.target }}
760761
elif [ "${{ matrix.host.archive }}" == "zip" ]; then
761762
pushd ${OUTPUT_BASE}/${OUTPUT_DIR}
@@ -918,9 +919,10 @@ jobs:
918919
ARTIFACT=${ARTIFACT[0]}
919920
ARTIFACT=$(basename ${ARTIFACT})
920921
ARCHIVE_NAME=hosttools_${{ matrix.host.name }}
921-
ARCHIVE_FILE=hosttools_${{ matrix.host.name }}.tar.gz
922+
ARCHIVE_FILE=hosttools_${{ matrix.host.name }}.tar.xz
922923
923-
${TAR} -zcvf ${ARCHIVE_FILE} --owner=0 --group=0 \
924+
XZ_OPT="-T0" \
925+
${TAR} -Jcvf ${ARCHIVE_FILE} --owner=0 --group=0 \
924926
-C ${ARTIFACT_ROOT} ${ARTIFACT}
925927
926928
# Compute checksum
@@ -1024,8 +1026,9 @@ jobs:
10241026
ARCHIVE_NAME=cmake_${{ matrix.host.name }}
10251027
ARCHIVE_FILE=${ARCHIVE_NAME}.${{ matrix.host.archive }}
10261028
1027-
if [ "${{ matrix.host.archive }}" == "tar.gz" ]; then
1028-
${TAR} -zcvf ${ARCHIVE_FILE} --owner=0 --group=0 \
1029+
if [ "${{ matrix.host.archive }}" == "tar.xz" ]; then
1030+
XZ_OPT="-T0" \
1031+
${TAR} -Jcvf ${ARCHIVE_FILE} --owner=0 --group=0 \
10291032
-C . cmake
10301033
elif [ "${{ matrix.host.archive }}" == "zip" ]; then
10311034
zip -r ${ARCHIVE_FILE} \
@@ -1130,8 +1133,8 @@ jobs:
11301133
11311134
echo "BUNDLE_ARCHIVE_NAME=${ARCHIVE_NAME}" >> $GITHUB_ENV
11321135
1133-
if [ "${{ matrix.host.archive }}" == "tar.gz" ]; then
1134-
EXTRACT="${TAR} -zxvf"
1136+
if [ "${{ matrix.host.archive }}" == "tar.xz" ]; then
1137+
EXTRACT="${TAR} -Jxvf"
11351138
elif [ "${{ matrix.host.archive }}" == "zip" ]; then
11361139
EXTRACT="unzip"
11371140
fi
@@ -1182,8 +1185,9 @@ jobs:
11821185
popd
11831186
11841187
# Create minimal (without toolchains) distribution bundle archive
1185-
if [ "${{ matrix.host.archive }}" == "tar.gz" ]; then
1186-
${TAR} -zcvf ${ARCHIVE_NAME}_minimal.${EXT} --owner=0 --group=0 \
1188+
if [ "${{ matrix.host.archive }}" == "tar.xz" ]; then
1189+
XZ_OPT="-T0" \
1190+
${TAR} -Jcvf ${ARCHIVE_NAME}_minimal.${EXT} --owner=0 --group=0 \
11871191
-C . ${ARCHIVE_DIR}
11881192
elif [ "${{ matrix.host.archive }}" == "zip" ]; then
11891193
zip -r ${ARCHIVE_NAME}_minimal.${EXT} ${ARCHIVE_DIR}
@@ -1211,8 +1215,9 @@ jobs:
12111215
popd
12121216
12131217
# Create full distribution bundle archive
1214-
if [ "${{ matrix.host.archive }}" == "tar.gz" ]; then
1215-
${TAR} -zcvf ${ARCHIVE_NAME}.${EXT} --owner=0 --group=0 \
1218+
if [ "${{ matrix.host.archive }}" == "tar.xz" ]; then
1219+
XZ_OPT="-T0" \
1220+
${TAR} -Jcvf ${ARCHIVE_NAME}.${EXT} --owner=0 --group=0 \
12161221
-C . ${ARCHIVE_DIR}
12171222
elif [ "${{ matrix.host.archive }}" == "zip" ]; then
12181223
zip -r ${ARCHIVE_NAME}.${EXT} ${ARCHIVE_DIR}
@@ -1377,8 +1382,8 @@ jobs:
13771382
13781383
# Extract distribution bundle archive
13791384
BUNDLE_FILE=${BUNDLE_NAME}.${{ matrix.testenv.bundle-archive }}
1380-
if [ "${{ matrix.testenv.bundle-archive }}" == "tar.gz" ]; then
1381-
${TAR} -zxvf ${ARTIFACT_ROOT}/${BUNDLE_FILE} -C tools
1385+
if [ "${{ matrix.testenv.bundle-archive }}" == "tar.xz" ]; then
1386+
${TAR} -Jxvf ${ARTIFACT_ROOT}/${BUNDLE_FILE} -C tools
13821387
elif [ "${{ matrix.testenv.bundle-archive }}" == "zip" ]; then
13831388
unzip ${ARTIFACT_ROOT}/${BUNDLE_FILE} -d tools
13841389
fi

scripts/template_setup_posix

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -186,7 +186,7 @@ esac
186186

187187
# Resolve release download base URI
188188
dl_rel_base="https://github.com/zephyrproject-rtos/sdk-ng/releases/download/v${version}"
189-
dl_toolchain_filename='toolchain_${host}_${toolchain}.tar.gz'
189+
dl_toolchain_filename='toolchain_${host}_${toolchain}.tar.xz'
190190

191191
# Print banner
192192
echo "Zephyr SDK ${version} Setup"

0 commit comments

Comments
 (0)