Modern python packaging tools such as build build wheels in temporary directories.
This makes ccache ineffective for repeated builds.
A change like the one below helps partially, but only a small subset of the Cython modules give cache hits.
diff --git a/pkgs/sagemath-categories/setup.py b/pkgs/sagemath-categories/setup.py
index b2fbc8a6ac..d2f445e33c 100644
--- a/pkgs/sagemath-categories/setup.py
+++ b/pkgs/sagemath-categories/setup.py
@@ -20,6 +20,9 @@ sys.excepthook = excepthook
from sage_setup.setenv import setenv
setenv()
+os.environ['CCACHE_BASEDIR'] = sys.prefix
+os.environ['CCACHE_NOHASHDIR'] = '1'
+
import sage.env
sage.env.default_required_modules = sage.env.default_optional_modules = ()
print(f'##################### {sage.env.SAGE_SRC=}')
Modern python packaging tools such as
buildbuild wheels in temporary directories.This makes ccache ineffective for repeated builds.
A change like the one below helps partially, but only a small subset of the Cython modules give cache hits.