From 9d66b1b202676b166a86ec02e764325381ea4d27 Mon Sep 17 00:00:00 2001 From: Josh Stone Date: Sun, 17 Mar 2024 11:45:07 -0700 Subject: ci: Build gccjit from a git archive A full `git clone` of GCC includes quite a lot of history, and it's completely unnecessary for building it in CI. We can use a GitHub archive URL to get a simple tarball that is much faster to download. Also, the `gcc-build` directory can be removed after install to reduce the image size even further. --- .../host-x86_64/dist-x86_64-linux/build-gccjit.sh | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) (limited to 'src/ci') diff --git a/src/ci/docker/host-x86_64/dist-x86_64-linux/build-gccjit.sh b/src/ci/docker/host-x86_64/dist-x86_64-linux/build-gccjit.sh index b22d60f2b1d..e2aaed4fbfb 100755 --- a/src/ci/docker/host-x86_64/dist-x86_64-linux/build-gccjit.sh +++ b/src/ci/docker/host-x86_64/dist-x86_64-linux/build-gccjit.sh @@ -1,5 +1,10 @@ #!/usr/bin/env bash +GIT_REPO="https://github.com/antoyo/gcc" + +# This commit hash needs to be updated to use a more recent gcc fork version. +GIT_COMMIT="78dc50f0e50e6cd1433149520bd512a4e0eaa1bc" + set -ex cd $1 @@ -7,13 +12,11 @@ cd $1 source shared.sh # Setting up folders for GCC -git clone https://github.com/antoyo/gcc gcc-src -cd gcc-src -# This commit hash needs to be updated to use a more recent gcc fork version. -git checkout 78dc50f0e50e6cd1433149520bd512a4e0eaa1bc +curl -L "$GIT_REPO/archive/$GIT_COMMIT.tar.gz" | + tar -xz --transform "s/gcc-$GIT_COMMIT/gcc-src/" -mkdir ../gcc-build ../gcc-install -cd ../gcc-build +mkdir gcc-build gcc-install +cd gcc-build # Building GCC. hide_output \ @@ -28,6 +31,7 @@ hide_output \ hide_output make -j$(nproc) hide_output make install -rm -rf ../gcc-src +cd .. +rm -rf gcc-src gcc-build ln -s /scripts/gcc-install/lib/libgccjit.so /usr/lib/x86_64-linux-gnu/libgccjit.so ln -s /scripts/gcc-install/lib/libgccjit.so /usr/lib/x86_64-linux-gnu/libgccjit.so.0 -- cgit 1.4.1-3-g733a5 From 7936e18213941c903f02bc84720ac535393a0328 Mon Sep 17 00:00:00 2001 From: Josh Stone Date: Sun, 17 Mar 2024 13:08:06 -0700 Subject: Use the rust-lang/gcc repo directly Co-authored-by: Urgau <3616612+Urgau@users.noreply.github.com> --- src/ci/docker/host-x86_64/dist-x86_64-linux/build-gccjit.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/ci') diff --git a/src/ci/docker/host-x86_64/dist-x86_64-linux/build-gccjit.sh b/src/ci/docker/host-x86_64/dist-x86_64-linux/build-gccjit.sh index e2aaed4fbfb..200823848fa 100755 --- a/src/ci/docker/host-x86_64/dist-x86_64-linux/build-gccjit.sh +++ b/src/ci/docker/host-x86_64/dist-x86_64-linux/build-gccjit.sh @@ -1,6 +1,6 @@ #!/usr/bin/env bash -GIT_REPO="https://github.com/antoyo/gcc" +GIT_REPO="https://github.com/rust-lang/gcc" # This commit hash needs to be updated to use a more recent gcc fork version. GIT_COMMIT="78dc50f0e50e6cd1433149520bd512a4e0eaa1bc" -- cgit 1.4.1-3-g733a5 From f512f9e94903b81030672678592aff44ae777e20 Mon Sep 17 00:00:00 2001 From: Josh Stone Date: Sun, 17 Mar 2024 13:10:49 -0700 Subject: Use `pushd` and `popd` Co-authored-by: Urgau <3616612+Urgau@users.noreply.github.com> --- src/ci/docker/host-x86_64/dist-x86_64-linux/build-gccjit.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/ci') diff --git a/src/ci/docker/host-x86_64/dist-x86_64-linux/build-gccjit.sh b/src/ci/docker/host-x86_64/dist-x86_64-linux/build-gccjit.sh index 200823848fa..5bc6f5cc216 100755 --- a/src/ci/docker/host-x86_64/dist-x86_64-linux/build-gccjit.sh +++ b/src/ci/docker/host-x86_64/dist-x86_64-linux/build-gccjit.sh @@ -16,7 +16,7 @@ curl -L "$GIT_REPO/archive/$GIT_COMMIT.tar.gz" | tar -xz --transform "s/gcc-$GIT_COMMIT/gcc-src/" mkdir gcc-build gcc-install -cd gcc-build +pushd gcc-build # Building GCC. hide_output \ @@ -31,7 +31,7 @@ hide_output \ hide_output make -j$(nproc) hide_output make install -cd .. +popd rm -rf gcc-src gcc-build ln -s /scripts/gcc-install/lib/libgccjit.so /usr/lib/x86_64-linux-gnu/libgccjit.so ln -s /scripts/gcc-install/lib/libgccjit.so /usr/lib/x86_64-linux-gnu/libgccjit.so.0 -- cgit 1.4.1-3-g733a5 From 24a0d7daffed6290c287cafc3cc81e70a4ce8b29 Mon Sep 17 00:00:00 2001 From: Nilstrieb <48135649+Nilstrieb@users.noreply.github.com> Date: Sat, 23 Mar 2024 17:06:02 +0100 Subject: Update upload-artifact to v4 This contains a breaking change around artifact merging no longer being done. This was not relied on, so it's fine. --- .github/workflows/ci.yml | 6 +++--- .github/workflows/dependencies.yml | 4 ++-- src/ci/github-actions/ci.yml | 2 +- 3 files changed, 6 insertions(+), 6 deletions(-) (limited to 'src/ci') diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 767ea29d636..f1c87b0a76e 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -166,7 +166,7 @@ jobs: run: src/ci/scripts/create-doc-artifacts.sh if: success() && !env.SKIP_JOB - name: upload artifacts to github - uses: actions/upload-artifact@v3 + uses: actions/upload-artifact@v4 with: name: "${{ env.DOC_ARTIFACT_NAME }}" path: obj/artifacts/doc @@ -576,7 +576,7 @@ jobs: run: src/ci/scripts/create-doc-artifacts.sh if: success() && !env.SKIP_JOB - name: upload artifacts to github - uses: actions/upload-artifact@v3 + uses: actions/upload-artifact@v4 with: name: "${{ env.DOC_ARTIFACT_NAME }}" path: obj/artifacts/doc @@ -715,7 +715,7 @@ jobs: run: src/ci/scripts/create-doc-artifacts.sh if: success() && !env.SKIP_JOB - name: upload artifacts to github - uses: actions/upload-artifact@v3 + uses: actions/upload-artifact@v4 with: name: "${{ env.DOC_ARTIFACT_NAME }}" path: obj/artifacts/doc diff --git a/.github/workflows/dependencies.yml b/.github/workflows/dependencies.yml index c182f3245e5..1e6c9cb8c7c 100644 --- a/.github/workflows/dependencies.yml +++ b/.github/workflows/dependencies.yml @@ -67,13 +67,13 @@ jobs: # Remove first line that always just says "Updating crates.io index" run: cargo update 2>&1 | sed '/crates.io index/d' | tee -a cargo_update.log - name: upload Cargo.lock artifact for use in PR - uses: actions/upload-artifact@v3 + uses: actions/upload-artifact@v4 with: name: Cargo-lock path: Cargo.lock retention-days: 1 - name: upload cargo-update log artifact for use in PR - uses: actions/upload-artifact@v3 + uses: actions/upload-artifact@v4 with: name: cargo-updates path: cargo_update.log diff --git a/src/ci/github-actions/ci.yml b/src/ci/github-actions/ci.yml index 972ef359337..80e23574404 100644 --- a/src/ci/github-actions/ci.yml +++ b/src/ci/github-actions/ci.yml @@ -261,7 +261,7 @@ x--expand-yaml-anchors--remove: <<: *step - name: upload artifacts to github - uses: actions/upload-artifact@v3 + uses: actions/upload-artifact@v4 with: # name is set in previous step name: ${{ env.DOC_ARTIFACT_NAME }} -- cgit 1.4.1-3-g733a5