Skip to content

GH-50991: [CI] Enable sccache just like ccache on Docker-based builds - #50992

Merged
pitrou merged 5 commits into
apache:mainfrom
pitrou:gh50991-sccache
Aug 26, 2026
Merged

GH-50991: [CI] Enable sccache just like ccache on Docker-based builds#50992
pitrou merged 5 commits into
apache:mainfrom
pitrou:gh50991-sccache

Conversation

@pitrou

@pitrou pitrou commented Aug 25, 2026

Copy link
Copy Markdown
Member

Rationale for this change

Enable sccache in more Docker-based builds on Crossbow CI, so as to make jobs faster and consume less resources.

Are these changes tested?

Yes, by existing Crossbow CI runs.

Example results:

Crossbow build before after
test-conda-python-3.11-dask-latest 21 min 12 min
test-debian-c-glib 25 min 8 min
test-fedora-python 29 min 13 min
test-ubuntu-ruby 24 min 8 min
wheel-manylinux-2-28-cp314-cp314-arm64 20 min 14 min

Are there any user-facing changes?

No.

@pitrou

pitrou commented Aug 25, 2026

Copy link
Copy Markdown
Member Author

@github-actions crossbow submit -g python

@pitrou

pitrou commented Aug 25, 2026

Copy link
Copy Markdown
Member Author

@github-actions crossbow submit wheellinuxcp314

@github-actions github-actions Bot added the awaiting review Awaiting review label Aug 25, 2026
@github-actions

Copy link
Copy Markdown

⚠️ GitHub issue #50991 has been automatically assigned in GitHub to PR creator.

@github-actions

Copy link
Copy Markdown

Revision: ef5090a

Submitted crossbow builds: ursacomputing/crossbow @ actions-1826ba0836

Task Status
example-python-minimal-build-fedora-conda GitHub Actions
example-python-minimal-build-ubuntu-venv GitHub Actions
test-conda-python-3.11 GitHub Actions
test-conda-python-3.11-dask-latest GitHub Actions
test-conda-python-3.11-dask-upstream_devel GitHub Actions
test-conda-python-3.11-hdfs-2.9.2 GitHub Actions
test-conda-python-3.11-hdfs-3.2.1 GitHub Actions
test-conda-python-3.11-hypothesis GitHub Actions
test-conda-python-3.11-pandas-2.2.2-numpy-2.0.2 GitHub Actions
test-conda-python-3.11-spark-master GitHub Actions
test-conda-python-3.12 GitHub Actions
test-conda-python-3.12-pandas-latest-numpy-latest GitHub Actions
test-conda-python-3.13 GitHub Actions
test-conda-python-3.13-pandas-latest-numpy-2.1.3 GitHub Actions
test-conda-python-3.13-pandas-latest-numpy-latest GitHub Actions
test-conda-python-3.14 GitHub Actions
test-conda-python-3.14-cpython-debug GitHub Actions
test-conda-python-3.14-pandas-nightly-numpy-nightly GitHub Actions
test-conda-python-3.14-pandas-upstream_devel-numpy-nightly GitHub Actions
test-conda-python-emscripten GitHub Actions
test-debian-13-python-3-amd64 GitHub Actions
test-debian-13-python-3-i386 GitHub Actions
test-fedora-42-python-3 GitHub Actions
test-ubuntu-24.04-python-3 GitHub Actions

@github-actions

This comment was marked as outdated.

@pitrou

pitrou commented Aug 25, 2026

Copy link
Copy Markdown
Member Author

@github-actions crossbow submit wheelmanylinuxcp314

@pitrou

pitrou commented Aug 25, 2026

Copy link
Copy Markdown
Member Author

@github-actions crossbow submit -g ruby

@github-actions

This comment was marked as outdated.

@github-actions

Copy link
Copy Markdown

Revision: 3561c77

Submitted crossbow builds: ursacomputing/crossbow @ actions-cada341cec

Task Status
test-debian-ruby GitHub Actions
test-ubuntu-ruby GitHub Actions

@pitrou

pitrou commented Aug 25, 2026

Copy link
Copy Markdown
Member Author

@github-actions crossbow submit wheelmanylinuxcp314

@pitrou

pitrou commented Aug 25, 2026

Copy link
Copy Markdown
Member Author

@github-actions crossbow submit wheelmanylinuxcp314

@github-actions

This comment was marked as outdated.

@pitrou

pitrou commented Aug 25, 2026

Copy link
Copy Markdown
Member Author

@github-actions crossbow submit wheelmanylinuxcp314

@github-actions

This comment was marked as outdated.

@pitrou

pitrou commented Aug 25, 2026

Copy link
Copy Markdown
Member Author

@github-actions crossbow submit wheelmanylinuxcp314

@github-actions

Copy link
Copy Markdown

Revision: b6c60bc

Submitted crossbow builds: ursacomputing/crossbow @ actions-505a98c871

Task Status
wheel-manylinux-2-28-cp314-cp314-amd64 GitHub Actions
wheel-manylinux-2-28-cp314-cp314-arm64 GitHub Actions
wheel-manylinux-2-28-cp314-cp314t-amd64 GitHub Actions
wheel-manylinux-2-28-cp314-cp314t-arm64 GitHub Actions

@github-actions

Copy link
Copy Markdown

Revision: 14269a9

Submitted crossbow builds: ursacomputing/crossbow @ actions-896a507684

Task Status
wheel-manylinux-2-28-cp314-cp314-amd64 GitHub Actions
wheel-manylinux-2-28-cp314-cp314-arm64 GitHub Actions
wheel-manylinux-2-28-cp314-cp314t-amd64 GitHub Actions
wheel-manylinux-2-28-cp314-cp314t-arm64 GitHub Actions

@pitrou

pitrou commented Aug 25, 2026

Copy link
Copy Markdown
Member Author

@github-actions crossbow submit wheellinuxcp314

@github-actions

Copy link
Copy Markdown

Revision: b398bf0

Submitted crossbow builds: ursacomputing/crossbow @ actions-853d2ba796

Task Status
wheel-manylinux-2-28-cp314-cp314-amd64 GitHub Actions
wheel-manylinux-2-28-cp314-cp314-arm64 GitHub Actions
wheel-manylinux-2-28-cp314-cp314t-amd64 GitHub Actions
wheel-manylinux-2-28-cp314-cp314t-arm64 GitHub Actions
wheel-musllinux-1-2-cp314-cp314-amd64 GitHub Actions
wheel-musllinux-1-2-cp314-cp314-arm64 GitHub Actions
wheel-musllinux-1-2-cp314-cp314t-amd64 GitHub Actions
wheel-musllinux-1-2-cp314-cp314t-arm64 GitHub Actions

@paultiq

paultiq commented Aug 25, 2026

Copy link
Copy Markdown
Contributor

FYI, I have this (wheels building with sccache) working on a branch... but the branch is a bit messy (I used OIDC permissions instead of akey/skey).

In case it's helpful: a few things that might be helpful, see:

  • SCCACHE_BASEDIR is really important, otherwise the random build dir will pollute the sccache key (lots of misses)
  • Added the following in python\CMakeLists.txt. This is longer than it needs to be, since you just need to check for SCCACHE_BUCKET, I guess.
find_program(SCCACHE_FOUND sccache)

if(NOT SCCACHE_FOUND AND DEFINED ENV{SCCACHE_PATH})
  message(STATUS "Did not find sccache, using envvar fallback.")
  set(SCCACHE_FOUND $ENV{SCCACHE_PATH})
endif()

# Only use sccache if a storage backend is configured
if(SCCACHE_FOUND
   AND NOT CMAKE_C_COMPILER_LAUNCHER
   AND NOT CMAKE_CXX_COMPILER_LAUNCHER
   AND (DEFINED ENV{SCCACHE_AZURE_BLOB_CONTAINER}
        OR DEFINED ENV{SCCACHE_BUCKET}
        OR DEFINED ENV{SCCACHE_DIR}
        OR DEFINED ENV{SCCACHE_GCS_BUCKET}
        OR DEFINED ENV{SCCACHE_MEMCACHED}
        OR DEFINED ENV{SCCACHE_REDIS}
       ))
  message(STATUS "Using sccache: ${SCCACHE_FOUND}")
  set(CMAKE_C_COMPILER_LAUNCHER ${SCCACHE_FOUND})
  set(CMAKE_CXX_COMPILER_LAUNCHER ${SCCACHE_FOUND})
endif()

And, other things I did:

  • explicitly disabled ARROW_USE_CCACHE
  • Uploaded the sccache logs, helpful for diagnosing cache misses (nearly impossible without)
  • Split the "build image" from "build wheel": this was just helpful to not pollute the build wheel time with the image build / docker pull.

There's a few things where I used OIDC to be ignored: AWS_SESSION_TOKEN and AWS_ROLE_ARN can be ignored,

@pitrou

pitrou commented Aug 25, 2026

Copy link
Copy Markdown
Member Author

@github-actions crossbow submit -g ruby

@pitrou

pitrou commented Aug 25, 2026

Copy link
Copy Markdown
Member Author

@github-actions crossbow submit -g r

@github-actions

Copy link
Copy Markdown

Revision: 37d53be

Submitted crossbow builds: ursacomputing/crossbow @ actions-4c426b805e

Task Status
test-debian-ruby GitHub Actions
test-ubuntu-ruby GitHub Actions

@github-actions

This comment was marked as outdated.

@pitrou
pitrou marked this pull request as ready for review August 25, 2026 19:22
@pitrou

pitrou commented Aug 25, 2026

Copy link
Copy Markdown
Member Author

@kou Would you like to take a look?

Also cc @rok

Comment thread compose.yaml Outdated
ulimits: *ulimits
environment:
<<: [*common, *ccache, *cpp]
<<: [*common, *ccache, *sccache, *cpp]

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I didn't manage to check if this tracks, but my AI reviewer wrote:

ubuntu-cpp-bundled-offline sets ARROW_OFFLINE=ON. In ci/scripts/cpp_build.sh, this clears /etc/resolv.conf before compilation. With *sccache added, Crossbow supplies SCCACHE_BUCKET and CMake selects remote sccache instead of local ccache.

On its first compiler invocation, sccache verifies the S3 backend. With networking disabled, server startup fails and compilation exits rather than falling back. I reproduced this using sccache 0.12.0 against an unreachable S3 endpoint.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmm, let's try it out then.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok, you're right, it seems that sccache breaks under this scenario.

sccache: error: Server startup failed: cache storage failed to read: Unexpected (temporary) at read => send http request

Context:
   url: https://s3.***.amazonaws.com/***/sccache/.sccache_check
   called: http_util::Client::send
   service: s3
   path: .sccache_check
   range: 0-

Source:
   error sending request for url (https://s3.***.amazonaws.com/***/sccache/.sccache_check): client error (Connect): dns error: failed to lookup address information: Try again: failed to lookup address information: Try again

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Huh, interesting.

@github-actions github-actions Bot added awaiting changes Awaiting changes and removed awaiting review Awaiting review labels Aug 25, 2026
Comment thread compose.yaml
secrets: *vcpkg-build-secrets
environment:
<<: [*common, *ccache]
<<: [*common, *ccache, *sccache]

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I can only see ccache installed in ci/docker/cpp-jni.dockerfile, but no sccache, so this likely doesn't do much.

@rok

rok commented Aug 25, 2026

Copy link
Copy Markdown
Member

Thank you for your (s)(c)cache crusade @pitrou !

@kou kou left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

+1

@github-actions github-actions Bot added awaiting merge Awaiting merge and removed awaiting changes Awaiting changes labels Aug 26, 2026
@pitrou

pitrou commented Aug 26, 2026

Copy link
Copy Markdown
Member Author

@github-actions crossbow submit -g cpp

@github-actions

Copy link
Copy Markdown

Revision: f5df088

Submitted crossbow builds: ursacomputing/crossbow @ actions-2cbd17ff51

Task Status
example-cpp-minimal-build-static GitHub Actions
example-cpp-minimal-build-static-system-dependency GitHub Actions
example-cpp-tutorial GitHub Actions
test-build-cpp-fuzz GitHub Actions
test-conda-cpp GitHub Actions
test-conda-cpp-valgrind GitHub Actions
test-debian-13-cpp-amd64 GitHub Actions
test-debian-13-cpp-i386 GitHub Actions
test-debian-experimental-cpp-gcc-15 GitHub Actions
test-fedora-42-cpp GitHub Actions
test-ubuntu-22.04-cpp GitHub Actions
test-ubuntu-22.04-cpp-bundled GitHub Actions
test-ubuntu-22.04-cpp-emscripten GitHub Actions
test-ubuntu-22.04-cpp-no-threading GitHub Actions
test-ubuntu-24.04-cpp GitHub Actions
test-ubuntu-24.04-cpp-bundled-offline GitHub Actions
test-ubuntu-24.04-cpp-gcc-13-bundled GitHub Actions
test-ubuntu-24.04-cpp-gcc-14 GitHub Actions
test-ubuntu-24.04-cpp-minimal-with-formats GitHub Actions
test-ubuntu-24.04-cpp-thread-sanitizer GitHub Actions

@pitrou

pitrou commented Aug 26, 2026

Copy link
Copy Markdown
Member Author

@github-actions crossbow submit test-ubuntu-24.04-cpp-bundled-offline

@github-actions

Copy link
Copy Markdown

Revision: 3e9e9ef

Submitted crossbow builds: ursacomputing/crossbow @ actions-6820ae6774

Task Status
test-ubuntu-24.04-cpp-bundled-offline GitHub Actions

@github-actions github-actions Bot added awaiting changes Awaiting changes and removed awaiting merge Awaiting merge labels Aug 26, 2026
@pitrou
pitrou merged commit bb76583 into apache:main Aug 26, 2026
56 of 58 checks passed
@pitrou pitrou removed the awaiting changes Awaiting changes label Aug 26, 2026
@pitrou
pitrou deleted the gh50991-sccache branch August 26, 2026 09:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants