improve tar packaging

The generated tar archives contain the uid/gid of the builder,
if unpacked as root on another system those will denote nothing
or an unexpected user/group.

The expectation would be uid/gid = 0.

Use a simple enough tar format as well.

The Mac version of tar (bsdtar?) does not support those flags,
for CI the separate gnu-tar is installed.
This commit is contained in:
Norbert Lange authored and Martin Storsjö committed 2024-02-13 10:13:54 +02:00
1 parent 6b6b1240e2
commit 45ad09642f
4 files changed
+10 -10

No files matched your search

+2 -2
View File
@@ -30,7 +30,7 @@ fi
time docker build -f Dockerfile . -t mstorsjo/llvm-mingw:latest -t mstorsjo/llvm-mingw:$TAG
DISTRO=ubuntu-20.04-$(uname -m)
docker run --rm mstorsjo/llvm-mingw:latest sh -c "cd /opt && mv llvm-mingw llvm-mingw-$TAG-ucrt-$DISTRO && tar -Jcvf - llvm-mingw-$TAG-ucrt-$DISTRO" > llvm-mingw-$TAG-ucrt-$DISTRO.tar.xz
docker run --rm mstorsjo/llvm-mingw:latest sh -c "cd /opt && mv llvm-mingw llvm-mingw-$TAG-ucrt-$DISTRO && tar -Jcvf - --format=ustar --numeric-owner --owner=0 --group=0 llvm-mingw-$TAG-ucrt-$DISTRO" > llvm-mingw-$TAG-ucrt-$DISTRO.tar.xz
if [ -n "$NATIVEONLY" ]; then
exit 0
@@ -57,7 +57,7 @@ msvcrt_image=llvm-mingw-msvcrt-$(uuidgen)
temp_images="$temp_images $msvcrt_image"
time docker build -f Dockerfile.dev -t $msvcrt_image --build-arg DEFAULT_CRT=msvcrt .
docker run --rm $msvcrt_image sh -c "cd /opt && mv llvm-mingw llvm-mingw-$TAG-msvcrt-$DISTRO && tar -Jcvf - llvm-mingw-$TAG-msvcrt-$DISTRO" > llvm-mingw-$TAG-msvcrt-$DISTRO.tar.xz
docker run --rm $msvcrt_image sh -c "cd /opt && mv llvm-mingw llvm-mingw-$TAG-msvcrt-$DISTRO && tar -Jcvf - --format=ustar --numeric-owner --owner=0 --group=0 llvm-mingw-$TAG-msvcrt-$DISTRO" > llvm-mingw-$TAG-msvcrt-$DISTRO.tar.xz
for arch in i686 x86_64; do
temp=$(uuidgen)