You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 576ef68
Browse filesBrowse the repository at this point in the historyBrowse files
build: make sccache's preprocessor cache work in isolated wheel builds (#3139)
* build: drop the empty venv include dir from build_ext include_dirs
In a virtualenv, setuptools' build_ext appends <sys.exec_prefix>/include.
Under PEP 517 build isolation that is a fresh /tmp/build-env-<random>
per build, so every compile command differs and sccache's preprocessor
cache, which hashes the -I flags, never hits. Drop the directory when it
holds no files; it contributes no headers then, so compilation is
unchanged. The helper lives in _build_shared.py and is applied in both
packages' build_ext.finalize_options, with tests in the shared
build_shared mixins.
* build: keep build-env library dirs out of cuda.bindings Extensions
Cython copies each Extension's library_dirs into the metadata comment
of the generated .cpp. Under PEP 517 build isolation, platlib and
<sys.prefix>/lib are /tmp/build-env-<random> paths, so the generated
sources differ per build, and sccache's preprocessor cache, which
hashes the raw source, misses even when the object cache hits.
Drop platlib: nothing links from site-packages itself. Add
<sys.prefix>/lib (where a conda environment can provide
libcudart_static.a) in build_ext.finalize_options instead, so the
link line still has it but the generated sources no longer do.
* ci: enable sccache's GHA preprocessor cache in Linux wheel builds
rapidsai/sccache can store preprocessor-cache entries in the GHA cache
alongside object entries. A preprocessor hit skips running the
preprocessor, which the object cache alone always has to do to compute
its key. The two preceding commits make the compile commands and the
generated sources stable across isolated builds, so these entries can
now hit.
* build: follow symlinked dirs when checking the venv include dir
drop_empty_venv_include_dir() used os.walk() without followlinks, so a
<venv>/include whose only content is symlinked directories (for example
linked header trees) looked empty. The helper then dropped the -I flag
even though headers were reachable through it, breaking compiles that
need them.
Walk with followlinks=True so headers behind symlinked directories
count as files, and add regression tests for a symlinked directory that
holds a header and for one that is empty.
* build: do not add <sys.prefix>/lib to library_dirs twice
build_ext.finalize_options unconditionally appended <sys.prefix>/lib.
Skip the append when the directory is already in library_dirs, so a
repeated finalize_options call or a pre-populated list does not produce
a duplicate -L flag.
0 commit comments