-
-
Notifications
You must be signed in to change notification settings - Fork 203
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Improve tar packaging #394
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -26,7 +26,13 @@ jobs: | |
MINGW_W64_VERSION: ${{steps.get-versions.outputs.MINGW_W64_VERSION}} | ||
PYTHON_VERSION_MINGW: ${{steps.get-versions.outputs.PYTHON_VERSION_MINGW}} | ||
TAG: ${{steps.get-tag.outputs.TAG}} | ||
COMMIT_DATE_UNIX: ${{steps.get-tag.outputs.COMMIT_DATE_UNIX}} | ||
BUILD_DATE: ${{steps.get-tag.outputs.BUILD_DATE}} | ||
BUILD_DATE_UNIX: ${{steps.get-tag.outputs.BUILD_DATE_UNIX}} | ||
steps: | ||
- uses: actions/checkout@v4 | ||
with: | ||
sparse-checkout: . | ||
- name: Select build tag | ||
id: get-tag | ||
run: | | ||
|
@@ -36,6 +42,9 @@ jobs: | |
TAG=$(TZ=UTC date +%Y%m%d) | ||
fi | ||
echo TAG=$TAG >> $GITHUB_OUTPUT | ||
echo COMMIT_DATE_UNIX=$(git log -1 --pretty=%ct $GITHUB_SHA) >> $GITHUB_OUTPUT | ||
echo BUILD_DATE=$(date -u '+%FT%TZ') >> $GITHUB_OUTPUT | ||
echo BUILD_DATE_UNIX=$(date -d "${BUILD_DATE}" +%s) >> $GITHUB_OUTPUT | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Btw, I just realized, this doesn't work as intended. At this point, There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. See fix-build-date for a fix for this - if this seems reasonable to you, I'll push that to master. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Good catch, fix seems sensible There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Thanks, I'll push that then. The failure mode here, in producing a timestamp which is quite near to the intended one, but still not quite the same, was quite surprising too :-) |
||
cat $GITHUB_OUTPUT | ||
cat $GITHUB_OUTPUT >> parameters.txt | ||
- name: Check latest version | ||
|
@@ -66,6 +75,8 @@ jobs: | |
LLVM_VERSION: ${{needs.prepare.outputs.LLVM_VERSION}} | ||
MINGW_W64_VERSION: ${{needs.prepare.outputs.MINGW_W64_VERSION}} | ||
TAG: ${{needs.prepare.outputs.TAG}} | ||
SOURCE_DATE_EPOCH: ${{needs.prepare.outputs.COMMIT_DATE_UNIX}} | ||
BUILD_DATE: ${{needs.prepare.outputs.BUILD_DATE}} | ||
run: | | ||
sudo apt-get update && sudo apt-get install ninja-build | ||
# Skip dynamic library dependencies that might make it harder to | ||
|
@@ -77,7 +88,7 @@ jobs: | |
DISTRO=ubuntu-$(grep DISTRIB_RELEASE /etc/lsb-release | cut -f 2 -d =)-$(uname -m) | ||
NAME=llvm-mingw-$TAG-ucrt-$DISTRO | ||
mv llvm-mingw $NAME | ||
tar -Jcf ../$NAME.tar.xz --format=ustar --numeric-owner --owner=0 --group=0 $NAME | ||
tar -Jcf ../$NAME.tar.xz --format=ustar --numeric-owner --owner=0 --group=0 --sort=name --mtime="$BUILD_DATE" $NAME | ||
- uses: actions/upload-artifact@v4 | ||
with: | ||
name: linux-ucrt-x86_64-toolchain | ||
|
@@ -97,6 +108,7 @@ jobs: | |
env: | ||
LLVM_VERSION: ${{needs.prepare.outputs.LLVM_VERSION}} | ||
MINGW_W64_VERSION: ${{needs.prepare.outputs.MINGW_W64_VERSION}} | ||
SOURCE_DATE_EPOCH: ${{needs.prepare.outputs.COMMIT_DATE_UNIX}} | ||
run: | | ||
sudo apt-get update && sudo apt-get install ninja-build g++-aarch64-linux-gnu | ||
./build-all.sh $(pwd)/install/llvm-mingw --disable-clang-tools-extra --no-runtimes --host=aarch64-linux-gnu | ||
|
@@ -119,12 +131,13 @@ jobs: | |
- name: Package the toolchain | ||
env: | ||
TAG: ${{needs.prepare.outputs.TAG}} | ||
BUILD_DATE: ${{needs.prepare.outputs.BUILD_DATE}} | ||
run: | | ||
cd install | ||
DISTRO=ubuntu-$(grep DISTRIB_RELEASE /etc/lsb-release | cut -f 2 -d =)-aarch64 | ||
NAME=llvm-mingw-$TAG-ucrt-$DISTRO | ||
mv llvm-mingw $NAME | ||
tar -Jcf ../$NAME.tar.xz --format=ustar --numeric-owner --owner=0 --group=0 $NAME | ||
tar -Jcf ../$NAME.tar.xz --format=ustar --numeric-owner --owner=0 --group=0 --sort=name --mtime="$BUILD_DATE" $NAME | ||
- uses: actions/upload-artifact@v4 | ||
with: | ||
name: linux-ucrt-aarch64-toolchain | ||
|
@@ -149,6 +162,8 @@ jobs: | |
env: | ||
LLVM_VERSION: ${{needs.prepare.outputs.LLVM_VERSION}} | ||
MINGW_W64_VERSION: ${{needs.prepare.outputs.MINGW_W64_VERSION}} | ||
SOURCE_DATE_EPOCH: ${{needs.prepare.outputs.COMMIT_DATE_UNIX}} | ||
BUILD_DATE: ${{needs.prepare.outputs.BUILD_DATE}} | ||
run: | | ||
sudo apt-get update && sudo apt-get install ninja-build | ||
# Skip dynamic library dependencies that might make it harder to | ||
|
@@ -157,7 +172,7 @@ jobs: | |
LLVM_CMAKEFLAGS="-DLLVM_ENABLE_LIBXML2=OFF -DLLVM_ENABLE_TERMINFO=OFF" ./build-all.sh $(pwd)/install/llvm-mingw --disable-clang-tools-extra --disable-lldb --enable-asserts | ||
.github/workflows/store-version.sh install/llvm-mingw/versions.txt | ||
cd install | ||
tar -Jcf ../llvm-mingw-linux.tar.xz --format=ustar --numeric-owner --owner=0 --group=0 llvm-mingw | ||
tar -Jcf ../llvm-mingw-linux.tar.xz --format=ustar --numeric-owner --owner=0 --group=0 --sort=name --mtime="$BUILD_DATE" llvm-mingw | ||
- uses: actions/upload-artifact@v4 | ||
with: | ||
name: linux-asserts-toolchain | ||
|
@@ -177,6 +192,8 @@ jobs: | |
LLVM_VERSION: ${{needs.prepare.outputs.LLVM_VERSION}} | ||
MINGW_W64_VERSION: ${{needs.prepare.outputs.MINGW_W64_VERSION}} | ||
TAG: ${{needs.prepare.outputs.TAG}} | ||
SOURCE_DATE_EPOCH: ${{needs.prepare.outputs.COMMIT_DATE_UNIX}} | ||
BUILD_DATE: ${{needs.prepare.outputs.BUILD_DATE}} | ||
nolange marked this conversation as resolved.
Show resolved
Hide resolved
|
||
run: | | ||
brew install ninja gnu-tar | ||
# Disable zstd and python. Both are available on the runners, but | ||
|
@@ -189,7 +206,7 @@ jobs: | |
cd install | ||
NAME=llvm-mingw-$TAG-ucrt-macos-universal | ||
mv llvm-mingw $NAME | ||
gtar -Jcf ../$NAME.tar.xz --format=ustar --numeric-owner --owner=0 --group=0 $NAME | ||
gtar -Jcf ../$NAME.tar.xz --format=ustar --numeric-owner --owner=0 --group=0 --sort=name --mtime="$BUILD_DATE" $NAME | ||
- uses: actions/upload-artifact@v4 | ||
with: | ||
name: macos-ucrt-toolchain | ||
|
@@ -233,6 +250,8 @@ jobs: | |
LLVM_VERSION: ${{needs.prepare.outputs.LLVM_VERSION}} | ||
MINGW_W64_VERSION: ${{needs.prepare.outputs.MINGW_W64_VERSION}} | ||
TAG: ${{needs.prepare.outputs.TAG}} | ||
SOURCE_DATE_EPOCH: ${{needs.prepare.outputs.COMMIT_DATE_UNIX}} | ||
BUILD_DATE: ${{needs.prepare.outputs.BUILD_DATE}} | ||
run: | | ||
./build-all.sh $(pwd)/install/llvm-mingw --disable-clang-tools-extra --disable-lldb | ||
.github/workflows/store-version.sh install/llvm-mingw/versions.txt | ||
|
@@ -241,7 +260,7 @@ jobs: | |
cd install | ||
NAME=llvm-mingw-$TAG-ucrt-msys2-${{matrix.sys}} | ||
mv llvm-mingw $NAME | ||
tar -Jcf ../$NAME.tar.xz --format=ustar --numeric-owner --owner=0 --group=0 $NAME | ||
tar -Jcf ../$NAME.tar.xz --format=ustar --numeric-owner --owner=0 --group=0 --sort=name --mtime="$BUILD_DATE" $NAME | ||
- uses: actions/upload-artifact@v4 | ||
with: | ||
name: msys2-${{matrix.sys}}-toolchain | ||
|
@@ -281,6 +300,8 @@ jobs: | |
MINGW_W64_VERSION: ${{needs.prepare.outputs.MINGW_W64_VERSION}} | ||
PYTHON_VERSION_MINGW: ${{needs.prepare.outputs.PYTHON_VERSION_MINGW}} | ||
TAG: ${{needs.prepare.outputs.TAG}} | ||
SOURCE_DATE_EPOCH: ${{needs.prepare.outputs.COMMIT_DATE_UNIX}} | ||
BUILD_DATE: ${{needs.prepare.outputs.BUILD_DATE}} | ||
run: | | ||
sudo apt-get update && sudo apt-get install autoconf-archive ninja-build | ||
./build-cross-tools.sh /opt/llvm-mingw $(pwd)/install/llvm-mingw ${{matrix.arch}} --with-python | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why is
sparse-checkout
needed here? I guess it's nice for getting a smaller checkout if just wanting to inspect the git history, but the actual files within the llvm-mingw repo are quite minimal anyway?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It explicitly states that the files arent needed