diff options
author | Daniel Bertalan <dani@danielbertalan.dev> | 2023-05-27 17:54:17 +0200 |
---|---|---|
committer | Andrew Kaster <andrewdkaster@gmail.com> | 2023-05-28 05:05:09 -0600 |
commit | 58da4c93fbc2dcd9bde273d0e0bf3f4a07d3a5c8 (patch) | |
tree | 20f60fc1cb822ce68729083cf165bf565f7a8080 /Toolchain | |
parent | 18ee6e457dda39901d230be7a42b1fee3e3a78d6 (diff) | |
download | serenity-58da4c93fbc2dcd9bde273d0e0bf3f4a07d3a5c8.zip |
Toolchain+CI: Remove cache handling logic from `BuildIt.sh`
Instead of manually compressing/decompressing a toolchain tarball if
`TRY_USE_LOCAL_TOOLCHAIN` is set, let's use the cache action's automatic
built-in compression (which is zstd, I believe).
Diffstat (limited to 'Toolchain')
-rwxr-xr-x | Toolchain/BuildIt.sh | 65 |
1 files changed, 2 insertions, 63 deletions
diff --git a/Toolchain/BuildIt.sh b/Toolchain/BuildIt.sh index 62f6b2a2af..1f2f2e0510 100755 --- a/Toolchain/BuildIt.sh +++ b/Toolchain/BuildIt.sh @@ -130,51 +130,7 @@ PROGRAM done fi -# === CHECK CACHE AND REUSE === - -pushd "$DIR" - if [ "${TRY_USE_LOCAL_TOOLCHAIN}" = "y" ] ; then - # The actual logic had to be moved to .github/workflows/cmake.yml. - # Github Actions guarantees that Toolchain/Cache/ is empty on a cache - # miss, and non-empty on a cache hit. - # The following logic is correct *only* because of that. - - mkdir -p Cache - echo "Cache (before):" - ls -l Cache - CACHED_TOOLCHAIN_ARCHIVE="Cache/ToolchainBinariesGithubActions.tar.gz" - if [ -r "${CACHED_TOOLCHAIN_ARCHIVE}" ] ; then - echo "Cache at ${CACHED_TOOLCHAIN_ARCHIVE} exists!" - echo "Extracting toolchain from cache:" - if tar xzf "${CACHED_TOOLCHAIN_ARCHIVE}" ; then - echo "Done 'building' the toolchain." - echo "Cache unchanged." - exit 0 - else - echo - echo - echo - echo "Could not extract cached toolchain archive." - echo "This means the cache is broken and *should be removed*!" - echo "As Github Actions cannot update a cache, this will unnecessarily" - echo "slow down all future builds for this hash, until someone" - echo "resets the cache." - echo - echo - echo - rm -f "${CACHED_TOOLCHAIN_ARCHIVE}" - fi - else - echo "Cache at ${CACHED_TOOLCHAIN_ARCHIVE} does not exist." - echo "Will rebuild toolchain from scratch, and save the result." - fi - echo "::group::Actually building Toolchain" - fi -popd - - # === DOWNLOAD AND PATCH === - pushd "$DIR/Tarballs" md5="" if [ -e "$BINUTILS_PKG" ]; then @@ -289,7 +245,7 @@ pushd "$DIR/Build/$ARCH" --with-sysroot="$SYSROOT" \ --enable-shared \ --disable-nls \ - ${TRY_USE_LOCAL_TOOLCHAIN:+"--quiet"} || exit 1 + ${CI:+"--quiet"} || exit 1 if [ "$SYSTEM_NAME" = "Darwin" ]; then # under macOS generated makefiles are not resolving the "intl" # dependency properly to allow linking its own copy of @@ -346,7 +302,7 @@ pushd "$DIR/Build/$ARCH" --enable-threads=posix \ --enable-initfini-array \ --with-linker-hash-style=gnu \ - ${TRY_USE_LOCAL_TOOLCHAIN:+"--quiet"} || exit 1 + ${CI:+"--quiet"} || exit 1 echo "XXX build gcc and libgcc" buildstep "gcc/build" "$MAKE" -j "$MAKEJOBS" all-gcc || exit 1 @@ -365,20 +321,3 @@ popd pushd "$DIR/Local/$ARCH/$ARCH-pc-serenity/bin" buildstep "mold_symlink" ln -s ../../../mold/bin/mold ld.mold popd - - -# == SAVE TO CACHE == - -pushd "$DIR" - if [ "${TRY_USE_LOCAL_TOOLCHAIN}" = "y" ] ; then - echo "::endgroup::" - echo "Building cache tar:" - - rm -f "${CACHED_TOOLCHAIN_ARCHIVE}" # Just in case - - tar czf "${CACHED_TOOLCHAIN_ARCHIVE}" Local/ - - echo "Cache (after):" - ls -l Cache - fi -popd |