From f543fe44e06a6b4ed1f107dbf87c71de0909f32a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ludovic=20Court=C3=A8s?= Date: Sun, 31 Aug 2025 16:10:56 +0200 Subject: [PATCH] =?UTF-8?q?build-self:=20Remove=202018-era=20compatibility?= =?UTF-8?q?=20shim=20for=20=E2=80=98gexp->script=E2=80=99.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * build-aux/build-self.scm (load-path-expression, gexp->script): Remove. Change-Id: I956e2b8461c1a3ab719f923aef857efc03ebb174 --- build-aux/build-self.scm | 49 ---------------------------------------- 1 file changed, 49 deletions(-) diff --git a/build-aux/build-self.scm b/build-aux/build-self.scm index ad2aeea6323..7dce08fed07 100644 --- a/build-aux/build-self.scm +++ b/build-aux/build-self.scm @@ -134,55 +134,6 @@ (define %xz #+(and xz (file-append xz "/bin/xz"))))))) - -;;; -;;; 'gexp->script'. -;;; -;;; This is our own variant of 'gexp->script' with an extra #:module-path -;;; parameter, which was unavailable in (guix gexp) until commit -;;; 1ae16033f34cebe802023922436883867010850f (March 2018.) -;;; - -(define (load-path-expression modules path) - "Return as a monadic value a gexp that sets '%load-path' and -'%load-compiled-path' to point to MODULES, a list of module names. MODULES -are searched for in PATH." - (mlet %store-monad ((modules (imported-modules modules - #:module-path path)) - (compiled (compiled-modules modules - #:module-path path))) - (return (gexp (eval-when (expand load eval) - (set! %load-path - (cons (ungexp modules) %load-path)) - (set! %load-compiled-path - (cons (ungexp compiled) - %load-compiled-path))))))) - -(define* (gexp->script name exp - #:key (guile (default-guile)) - (module-path %load-path)) - "Return an executable script NAME that runs EXP using GUILE, with EXP's -imported modules in its search path." - (mlet %store-monad ((set-load-path - (load-path-expression (gexp-modules exp) - module-path))) - (gexp->derivation name - (gexp - (call-with-output-file (ungexp output) - (lambda (port) - ;; Note: that makes a long shebang. When the store - ;; is /gnu/store, that fits within the 128-byte - ;; limit imposed by Linux, but that may go beyond - ;; when running tests. - (format port - "#!~a/bin/guile --no-auto-compile~%!#~%" - (ungexp guile)) - - (write '(ungexp set-load-path) port) - (write '(ungexp exp) port) - (chmod port #o555)))) - #:module-path module-path))) - (define (date-version-string) "Return the current date and hour in UTC timezone, for use as a poor