From 3df28f6f834f1a883f18d73d443a31aed6e4017c Mon Sep 17 00:00:00 2001 From: Eli Mallon Date: Thu, 1 Oct 2026 14:39:05 -0700 Subject: [PATCH] Revert "feat: faster builds with sccache" --- .ci/dockerfile-hash.yaml | 2 +- .github/workflows/build.yaml | 33 +--------------------------- .github/workflows/docker.yaml | 15 ++----------- .github/workflows/golangci-lint.yaml | 18 +-------------- Makefile | 5 ++--- docker/build.Dockerfile | 7 ------ meson.build | 2 +- util/linux-arm64-sccache.ini | 3 --- util/windows-amd64-sccache.ini | 3 --- 9 files changed, 8 insertions(+), 80 deletions(-) delete mode 100644 util/linux-arm64-sccache.ini delete mode 100644 util/windows-amd64-sccache.ini diff --git a/.ci/dockerfile-hash.yaml b/.ci/dockerfile-hash.yaml index 7436c12d3..5e27d0dcb 100644 --- a/.ci/dockerfile-hash.yaml +++ b/.ci/dockerfile-hash.yaml @@ -1,2 +1,2 @@ variables: - DOCKERFILE_HASH: 98a5c34fead8eced780eca85fa561a039ccbaa59 \ No newline at end of file + DOCKERFILE_HASH: 28cc8e519521a047f1da9084773cbf08b0428ee7 \ No newline at end of file diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index 87550c494..a4cc92fcc 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -14,8 +14,6 @@ jobs: linux: name: ${{ matrix.name }} runs-on: ubuntu-latest - # Only trusted pushes update the shared compiler cache. - cache-mode: ${{ github.event_name == 'push' && 'write' || 'read' }} strategy: matrix: include: @@ -85,13 +83,6 @@ jobs: fetch-depth: 0 ref: ${{ github.event.pull_request.head.sha }} - - name: Export GitHub Actions cache environment - uses: actions/github-script@v7 - with: - script: | - core.exportVariable('ACTIONS_RESULTS_URL', process.env.ACTIONS_RESULTS_URL || ''); - core.exportVariable('ACTIONS_RUNTIME_TOKEN', process.env.ACTIONS_RUNTIME_TOKEN || ''); - - name: mise check uses: jdx/mise-action@v2 with: @@ -105,9 +96,6 @@ jobs: password: ${{ github.token }} - name: make node - env: - SCCACHE_GHA_RW_MODE: - ${{ github.event_name == 'push' && 'READ_WRITE' || 'READ_ONLY' }} run: | sudo apt install podman -y # Ubuntu 24.04's crun (1.14.1) rejects the OCI spec version newer @@ -115,26 +103,7 @@ jobs: # and the 20260726 runner image update made that pairing fatal. sudo curl -fsSL -o /usr/bin/crun https://github.com/containers/crun/releases/download/1.28/crun-1.28-linux-amd64 sudo chmod +x /usr/bin/crun - sccache_opts="-e ACTIONS_RESULTS_URL -e ACTIONS_RUNTIME_TOKEN" - sccache_cmd="make linux-amd64 && make test-vod && make static-test && make check && make ci-lexicons" - sccache_cmd="export SCCACHE_GHA_ENABLED=on \ - SCCACHE_GHA_VERSION=1 \ - SCCACHE_GHA_RW_MODE=$SCCACHE_GHA_RW_MODE \ - SCCACHE_BASEDIRS=/app \ - CC='sccache gcc' \ - CXX='sccache g++' \ - RUSTC_WRAPPER=sccache \ - USE_SCCACHE=1; \ - set -e; \ - $sccache_cmd; \ - sccache --show-stats" - - make in-container \ - BUILDER_TARGET=builder-no-darwin \ - DOCKER_PWD_MOUNT_PATH=/app \ - DOCKER_BUILD_OPTS="--layers --cache-to ghcr.io/streamplace/streamplace --cache-from ghcr.io/streamplace/streamplace" \ - DOCKER_OPTS="-e STREAMPLACE_IGNORE_LEAKS=true -e STREAMPLACE_TEST_COUNT=1 -e CI=true -e GITHUB_ACTION=true $sccache_opts" \ - IN_CONTAINER_CMD="$sccache_cmd" + make in-container BUILDER_TARGET=builder-no-darwin DOCKER_PWD_MOUNT_PATH=/app DOCKER_BUILD_OPTS="--layers --cache-to ghcr.io/streamplace/streamplace --cache-from ghcr.io/streamplace/streamplace" DOCKER_OPTS="-e STREAMPLACE_IGNORE_LEAKS=true -e STREAMPLACE_TEST_COUNT=1 -e CI=true -e GITHUB_ACTION=true" IN_CONTAINER_CMD="make linux-amd64 && make test-vod && make static-test && make check && make ci-lexicons" - name: Publish Test Report if: success() || failure() diff --git a/.github/workflows/docker.yaml b/.github/workflows/docker.yaml index 3368d7bc5..6c49b22e8 100644 --- a/.github/workflows/docker.yaml +++ b/.github/workflows/docker.yaml @@ -89,8 +89,6 @@ jobs: binaries: name: linux binaries runs-on: ubuntu-latest - # build.yaml is the cache writer; this duplicate build only restores. - cache-mode: read outputs: version: ${{ steps.version.outputs.version }} steps: @@ -105,13 +103,6 @@ jobs: fetch-depth: 0 ref: ${{ github.event.pull_request.head.sha }} - - name: Export GitHub Actions cache environment - uses: actions/github-script@v7 - with: - script: | - core.exportVariable('ACTIONS_RESULTS_URL', process.env.ACTIONS_RESULTS_URL || ''); - core.exportVariable('ACTIONS_RUNTIME_TOKEN', process.env.ACTIONS_RUNTIME_TOKEN || ''); - - name: Log in to ghcr.io (build-layer cache) uses: docker/login-action@v3 with: @@ -120,16 +111,14 @@ jobs: password: ${{ github.token }} - name: Cross-compile linux amd64 + arm64 - env: - SCCACHE_GHA_RW_MODE: READ_ONLY run: | sudo apt install podman -y make in-container \ BUILDER_TARGET=builder-no-darwin \ DOCKER_PWD_MOUNT_PATH=/app \ DOCKER_BUILD_OPTS="--layers --cache-to ghcr.io/streamplace/streamplace --cache-from ghcr.io/streamplace/streamplace" \ - DOCKER_OPTS="-e CI=true -e GITHUB_ACTION=true -e ACTIONS_RESULTS_URL -e ACTIONS_RUNTIME_TOKEN" \ - IN_CONTAINER_CMD="export CC='sccache gcc' CXX='sccache g++' RUSTC_WRAPPER=sccache SCCACHE_GHA_ENABLED=on SCCACHE_GHA_VERSION=1 SCCACHE_GHA_RW_MODE=$SCCACHE_GHA_RW_MODE SCCACHE_BASEDIRS=/app USE_SCCACHE=1; set -e; make linux-amd64 && make linux-arm64 && sccache --show-stats && go run ./pkg/config/git/git.go -v > sp-version.txt" + DOCKER_OPTS="-e CI=true -e GITHUB_ACTION=true" \ + IN_CONTAINER_CMD="make linux-amd64 && make linux-arm64 && go run ./pkg/config/git/git.go -v > sp-version.txt" - name: Capture version id: version diff --git a/.github/workflows/golangci-lint.yaml b/.github/workflows/golangci-lint.yaml index 3f9bc55ef..7dfb71fbd 100644 --- a/.github/workflows/golangci-lint.yaml +++ b/.github/workflows/golangci-lint.yaml @@ -8,8 +8,6 @@ jobs: golangci: name: lint runs-on: ubuntu-latest - # build.yaml is the cache writer; this duplicate build only restores. - cache-mode: read timeout-minutes: 60 steps: - name: Maximize build space @@ -23,13 +21,6 @@ jobs: fetch-tags: true ref: ${{ github.event.pull_request.head.sha }} - - name: Export GitHub Actions cache environment - uses: actions/github-script@v7 - with: - script: | - core.exportVariable('ACTIONS_RESULTS_URL', process.env.ACTIONS_RESULTS_URL || ''); - core.exportVariable('ACTIONS_RUNTIME_TOKEN', process.env.ACTIONS_RUNTIME_TOKEN || ''); - - name: Log in to the Container registry uses: docker/login-action@v2 with: @@ -47,7 +38,7 @@ jobs: mkdir -p ~/.config/containers printf '[engine]\nlock_type = "file"\n' >> ~/.config/containers/containers.conf sudo ln -s $(realpath ./hack/golangci-lint) /usr/bin/golangci-lint - make golangci-lint-container BUILDER_TARGET=builder-no-darwin DOCKER_BUILD_OPTS="--layers --cache-to ghcr.io/streamplace/streamplace --cache-from ghcr.io/streamplace/streamplace" DOCKER_OPTS="-e ACTIONS_RESULTS_URL -e ACTIONS_RUNTIME_TOKEN -e SCCACHE_GHA_ENABLED=on -e SCCACHE_GHA_RW_MODE=READ_ONLY -e SCCACHE_GHA_VERSION=1 -e SCCACHE_BASEDIRS=$PWD -e 'CC=sccache gcc' -e 'CXX=sccache g++' -e RUSTC_WRAPPER=sccache" + make golangci-lint-container BUILDER_TARGET=builder-no-darwin DOCKER_BUILD_OPTS="--layers --cache-to ghcr.io/streamplace/streamplace --cache-from ghcr.io/streamplace/streamplace" - name: sanity-check wrapper from bash run: @@ -60,10 +51,3 @@ jobs: version: v2.1 args: --config=./.golangci.yaml install-mode: none - - - name: sccache statistics - if: always() - run: | - if podman container exists golangci-lint; then - podman exec golangci-lint sccache --show-stats - fi diff --git a/Makefile b/Makefile index ca6760b11..808a3ee2a 100644 --- a/Makefile +++ b/Makefile @@ -639,7 +639,7 @@ linux-arm64: && CC=aarch64-linux-gnu-gcc \ LD=aarch64-linux-gnu-ld \ CROSS_COMPILE=1 \ - MESON_SETUP_OPTS="--cross-file util/linux-arm64-gnu.ini $(if $(USE_SCCACHE),--cross-file util/linux-arm64-sccache.ini)" \ + MESON_SETUP_OPTS="--cross-file util/linux-arm64-gnu.ini" \ BUILDDIR=build-linux-arm64 \ CARGO_TARGET_AARCH64_UNKNOWN_LINUX_GNU_LINKER=aarch64-linux-gnu-gcc \ $(MAKE) -j $(shell nproc) archive @@ -650,7 +650,7 @@ windows-amd64: && CC=x86_64-w64-mingw32-gcc \ LD=x86_64-w64-mingw32-ld \ CROSS_COMPILE=1 \ - MESON_SETUP_OPTS="--cross-file util/windows-amd64-gnu.ini $(if $(USE_SCCACHE),--cross-file util/windows-amd64-sccache.ini)" \ + MESON_SETUP_OPTS="--cross-file util/windows-amd64-gnu.ini" \ BUILDDIR=build-windows-amd64 \ $(MAKE) -j $(shell nproc) archive @@ -770,7 +770,6 @@ dockerfile-hash-precommit: .PHONY: golangci-lint-container golangci-lint-container: docker-build-builder podman run \ - $(DOCKER_OPTS) \ -v $$(pwd):$$(pwd) \ -w $$(pwd) \ -e PKG_CONFIG_PATH=$$(pwd)/build-linux-amd64/lib/pkgconfig \ diff --git a/docker/build.Dockerfile b/docker/build.Dockerfile index 98a5c34fe..28cc8e519 100644 --- a/docker/build.Dockerfile +++ b/docker/build.Dockerfile @@ -98,13 +98,6 @@ RUN curl -L https://github.com/golangci/golangci-lint/releases/download/v${GOLAN && mv golangci-lint-${GOLANGCI_LINT_VERSION}-linux-amd64/golangci-lint /usr/local/bin/ \ && rm -rf golangci-lint.tar.gz golangci-lint-${GOLANGCI_LINT_VERSION}-linux-amd64 -ENV SCCACHE_VERSION 0.18.0 -RUN curl --fail --location https://github.com/mozilla/sccache/releases/download/v${SCCACHE_VERSION}/sccache-v${SCCACHE_VERSION}-x86_64-unknown-linux-musl.tar.gz -o sccache.tar.gz \ - && echo '45f1447fbe231e3037bde351ef70677dd212216c8d62ae7ca409fecc4d6acc89 sccache.tar.gz' | sha256sum --check - \ - && tar -xf sccache.tar.gz \ - && install -m 0755 sccache-v${SCCACHE_VERSION}-x86_64-unknown-linux-musl/sccache /usr/local/bin/sccache \ - && rm -rf sccache.tar.gz sccache-v${SCCACHE_VERSION}-x86_64-unknown-linux-musl - RUN gem install fpm ENV APTLY_VERSION 1.6.2 RUN curl --fail -L https://github.com/aptly-dev/aptly/releases/download/v${APTLY_VERSION}/aptly_${APTLY_VERSION}_linux_amd64.zip -o aptly.zip \ diff --git a/meson.build b/meson.build index c7a1a8f53..b6b4e419e 100644 --- a/meson.build +++ b/meson.build @@ -37,7 +37,7 @@ if meson.is_cross_build() 'GOOS': GOOS, 'GOARCH': GOARCH, 'CGO_ENABLED': '1', - 'CC': ' '.join(meson.get_compiler('c', native: false).cmd_array()), + 'CC': meson.get_compiler('c', native: false).cmd_array()[0], } endif diff --git a/util/linux-arm64-sccache.ini b/util/linux-arm64-sccache.ini deleted file mode 100644 index 88a370044..000000000 --- a/util/linux-arm64-sccache.ini +++ /dev/null @@ -1,3 +0,0 @@ -[binaries] -c = ['sccache', 'aarch64-linux-gnu-gcc'] -cpp = ['sccache', 'aarch64-linux-gnu-g++'] diff --git a/util/windows-amd64-sccache.ini b/util/windows-amd64-sccache.ini deleted file mode 100644 index c70590246..000000000 --- a/util/windows-amd64-sccache.ini +++ /dev/null @@ -1,3 +0,0 @@ -[binaries] -c = ['sccache', 'x86_64-w64-mingw32-gcc'] -cpp = ['sccache', 'x86_64-w64-mingw32-g++'] -- knotmirror 0.0.1