From 991c410bcff9e03761cc164896e44f0d1db8480a Mon Sep 17 00:00:00 2001 From: Christopher Baines Date: Mon, 2 Mar 2026 12:45:00 +0000 Subject: [PATCH] build-aux: Disable file port name canonicalization in a few places. I'm assuming this doesn't have any meaningful effect, and it seems to reduce the number of readlink calls by a lot. * build-aux/build-self.scm (build-program): Set %file-port-name-canonicalization to #f. (build): Ditto. * build-aux/compile-as-derivation.scm: Ditto. Change-Id: If43415c46c3911e84c76d1a9828b9c417a140a1b --- build-aux/build-self.scm | 6 ++++++ build-aux/compile-as-derivation.scm | 3 +++ 2 files changed, 9 insertions(+) diff --git a/build-aux/build-self.scm b/build-aux/build-self.scm index b0a427698f..942cf5f534 100644 --- a/build-aux/build-self.scm +++ b/build-aux/build-self.scm @@ -111,6 +111,9 @@ build daemon, from within the generated build program." #~(begin (use-modules (ice-9 match)) + ;; To avoid lots of readlink calls + (fluid-set! %file-port-name-canonicalization #f) + (eval-when (expand load eval) ;; (gnu packages …) modules are going to be looked up ;; under SOURCE. (guix config) is looked up in FRONT. @@ -246,6 +249,9 @@ Display a spinner when nothing happens." #:rest rest) "Return a derivation that unpacks SOURCE into STORE and compiles Scheme files." + ;; Avoid lots of readlink calls + (fluid-set! %file-port-name-canonicalization #f) + ;; Build the build program and then use it as a trampoline to build from ;; SOURCE. (mlet %store-monad ((build (build-program source version guile-version diff --git a/build-aux/compile-as-derivation.scm b/build-aux/compile-as-derivation.scm index 9da13893b5..c0b80e091f 100644 --- a/build-aux/compile-as-derivation.scm +++ b/build-aux/compile-as-derivation.scm @@ -20,6 +20,9 @@ (use-modules (srfi srfi-26)) +;; Avoid lots of readlink calls +(fluid-set! %file-port-name-canonicalization #f) + ;; Add ~/.config/guix/current to the search path. (eval-when (expand load eval) (and=> (or (getenv "XDG_CONFIG_HOME")