From 63432ec02271507c5fe53a8f5d531eafd2174a0d Mon Sep 17 00:00:00 2001 From: Max Horn Date: Fri, 16 Oct 2026 13:03:49 +0200 Subject: [PATCH 1/4] Enable ccache, with its cache outside the build env Install ccache in the build env, which activates the existing gcc/g++ symlinks, and point it at a ccache/ directory next to envs/. The build env's path contains the GAP version, so a cache inside it would never be reused; outside it, CI can persist it across builds. Building the packages takes 40-70 of the 55-90 minutes the gap-system/gap CI job needs, almost all of it in libsemigroups, semigroups, Normaliz and CARAT, which change rarely. Assisted-by: Claude Code (Opus 5.5) --- .gitignore | 1 + cygwin-gap-build.list | 1 + release_gap.sh | 23 +++++++++++++++++++++++ 3 files changed, 25 insertions(+) diff --git a/.gitignore b/.gitignore index d290454..4762d87 100644 --- a/.gitignore +++ b/.gitignore @@ -2,6 +2,7 @@ .*.sw[po] # Directories created during the build, containing build artifacts +ccache dist download envs diff --git a/cygwin-gap-build.list b/cygwin-gap-build.list index fb3b417..fc5f1da 100644 --- a/cygwin-gap-build.list +++ b/cygwin-gap-build.list @@ -1,5 +1,6 @@ autoconf automake +ccache cddlib-devel gcc-core gcc-core diff --git a/release_gap.sh b/release_gap.sh index b7ee9ad..f9fdfe5 100755 --- a/release_gap.sh +++ b/release_gap.sh @@ -40,6 +40,23 @@ download/setup-x86_64.exe --site ${CYGWIN_MIRROR} \ if [ -x envs/build-${GAP_VERSION}-x86_64/usr/bin/ccache ]; then ln -s /usr/bin/ccache envs/build-${GAP_VERSION}-x86_64/usr/local/bin/gcc ln -s /usr/bin/ccache envs/build-${GAP_VERSION}-x86_64/usr/local/bin/g++ + + # The cache lives outside the build env, whose path contains the GAP + # version, so that CI can keep it across builds. subcyg clears the + # environment, hence a profile script; it receives a Windows path because + # a POSIX path means something else in the build env's Cygwin. + # CCACHE_BASEDIR makes the versioned paths below /opt relative, and the + # compiler is reinstalled for every build, so check its content, not its + # mtime. + mkdir -p ccache + cat > envs/build-${GAP_VERSION}-x86_64/etc/profile.d/ccache.sh < Date: Sat, 17 Oct 2026 19:33:32 +0200 Subject: [PATCH 2/4] Detect ccache in the build env by its .exe name From the host Cygwin, `[ -x .../usr/bin/ccache ]` is false although setup installed ccache there, so the ccache setup never ran. Test for ccache.exe instead, and create /usr/local/bin before linking into it. Assisted-by: Generative AI --- release_gap.sh | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/release_gap.sh b/release_gap.sh index f9fdfe5..1c03fca 100755 --- a/release_gap.sh +++ b/release_gap.sh @@ -37,7 +37,9 @@ download/setup-x86_64.exe --site ${CYGWIN_MIRROR} \ --arch x86_64 --no-admin --no-shortcuts --quiet-mode # Install symlinks for CCACHE -if [ -x envs/build-${GAP_VERSION}-x86_64/usr/bin/ccache ]; then +# (test the real file name: `-x .../ccache` fails from the host Cygwin) +if [ -f envs/build-${GAP_VERSION}-x86_64/usr/bin/ccache.exe ]; then + mkdir -p envs/build-${GAP_VERSION}-x86_64/usr/local/bin ln -s /usr/bin/ccache envs/build-${GAP_VERSION}-x86_64/usr/local/bin/gcc ln -s /usr/bin/ccache envs/build-${GAP_VERSION}-x86_64/usr/local/bin/g++ From a235b801f7b30b1bc13622a6af6488efe0a97e69 Mon Sep 17 00:00:00 2001 From: Max Horn Date: Sat, 17 Oct 2026 21:10:27 +0200 Subject: [PATCH 3/4] Look for ccache where setup installs it The build env mounts its bin/ directory as /usr/bin, so setup installs ccache.exe into envs/build-*/bin. The test on envs/build-*/usr/bin never succeeded, whatever the file name, and the ccache setup never ran. Assisted-by: Generative AI --- release_gap.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/release_gap.sh b/release_gap.sh index 1c03fca..82f3e18 100755 --- a/release_gap.sh +++ b/release_gap.sh @@ -37,8 +37,8 @@ download/setup-x86_64.exe --site ${CYGWIN_MIRROR} \ --arch x86_64 --no-admin --no-shortcuts --quiet-mode # Install symlinks for CCACHE -# (test the real file name: `-x .../ccache` fails from the host Cygwin) -if [ -f envs/build-${GAP_VERSION}-x86_64/usr/bin/ccache.exe ]; then +# (the build env mounts its bin/ as /usr/bin, so that is where setup puts it) +if [ -f envs/build-${GAP_VERSION}-x86_64/bin/ccache.exe ]; then mkdir -p envs/build-${GAP_VERSION}-x86_64/usr/local/bin ln -s /usr/bin/ccache envs/build-${GAP_VERSION}-x86_64/usr/local/bin/gcc ln -s /usr/bin/ccache envs/build-${GAP_VERSION}-x86_64/usr/local/bin/g++ From 46a0f857e46ba77c22df6305aead7154f56fa4a6 Mon Sep 17 00:00:00 2001 From: Max Horn Date: Sat, 17 Oct 2026 22:39:23 +0200 Subject: [PATCH 4/4] Show all output of commands run by subcyg subcyg follows the command's output file with tail -F, which starts at its last 10 lines. Whatever a command prints before tail starts, a second after the command, was cut to those 10 lines, such as the hit and miss counts of `ccache -s`. Start at the first line instead. Assisted-by: Generative AI --- tools/subcyg | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/subcyg b/tools/subcyg index d41f583..93b18bf 100755 --- a/tools/subcyg +++ b/tools/subcyg @@ -53,7 +53,7 @@ pid=$! # sometimes there can be a delay. sleep 1 if [ -f "$subcyg_root$outtmp" ]; then - tail -F --pid=$pid "$subcyg_root$outtmp" 2>/dev/null + tail -n +1 -F --pid=$pid "$subcyg_root$outtmp" 2>/dev/null if [ $? -eq 130 ]; then # tail was interrupted by Ctrl-C, so treat this as though the # wrapped command were terminated as well.