From 296974e232feb3bc32c2dc9a5a75f71aea919ae4 Mon Sep 17 00:00:00 2001 From: Janneke Nieuwenhuizen Date: Sun, 5 Jan 2025 14:08:56 +0100 Subject: [PATCH] REMOVEME Revert "gexp: Improve support of Unicode characters." -- avoid world rebuild at this time. Avoid a world rebuild just now. This reverts commit 1d5863fca8ca1e465bc7979f7606f254aa054c22. Change-Id: I117f9428a36055dcafcbc081b13f4c835b922503 --- doc/guix.texi | 11 ++++------- guix/gexp.scm | 24 ++++++------------------ 2 files changed, 10 insertions(+), 25 deletions(-) diff --git a/doc/guix.texi b/doc/guix.texi index 5fbdd0eac6..924f13f0f6 100644 --- a/doc/guix.texi +++ b/doc/guix.texi @@ -12414,9 +12414,7 @@ Return an object representing a text file called @var{name} with the given This is the declarative counterpart of @code{text-file}. @end deffn -@deffn {Procedure} computed-file @var{name} @var{gexp} @ - [#:local-build? #t] [#:guile] @ - [#:options '(#:env-vars (("LANG" . "C.UTF-8")))] +@deffn {Procedure} computed-file name gexp [#:local-build? #t] [#:options '()] Return an object representing the store item @var{name}, a file or directory computed by @var{gexp}. When @var{local-build?} is true (the default), the derivation is built locally. @var{options} is a list of @@ -12427,7 +12425,7 @@ This is the declarative counterpart of @code{gexp->derivation}. @deffn {Monadic Procedure} gexp->script @var{name} @var{exp} @ [#:guile (default-guile)] [#:module-path %load-path] @ - [#:system (%current-system)] [#:target 'current] [#:locale "C.UTF-8"] + [#:system (%current-system)] [#:target #f] Return an executable script @var{name} that runs @var{exp} using @var{guile}, with @var{exp}'s imported modules in its search path. Look up @var{exp}'s modules in @var{module-path}. @@ -12464,9 +12462,8 @@ This is the declarative counterpart of @code{gexp->script}. @deffn {Monadic Procedure} gexp->file @var{name} @var{exp} @ [#:set-load-path? #t] [#:module-path %load-path] @ - [#:splice? #f] [#:guile (default-guile)] @ - [#:system (%current-system)] [#:target 'current] @ - [#:locale "C.UTF-8"] + [#:splice? #f] @ + [#:guile (default-guile)] Return a derivation that builds a file @var{name} containing @var{exp}. When @var{splice?} is true, @var{exp} is considered to be a list of expressions that will be spliced in the resulting file. diff --git a/guix/gexp.scm b/guix/gexp.scm index c8aba91779..e44aea6420 100644 --- a/guix/gexp.scm +++ b/guix/gexp.scm @@ -597,10 +597,7 @@ (define-record-type (options computed-file-options)) ;list of arguments (define* (computed-file name gexp - #:key - guile - (local-build? #t) - (options '(#:env-vars (("LANG" . "C.UTF-8"))))) + #:key guile (local-build? #t) (options '())) "Return an object representing the store item NAME, a file or directory computed by GEXP. When LOCAL-BUILD? is #t (the default), it ensures the corresponding derivation is built locally. OPTIONS may be used to pass @@ -1703,9 +1700,6 @@ (define build (system base target) (system base compile)) - ;; Best effort. The locale is not installed in all contexts. - (false-if-exception (setlocale LC_ALL "C.UTF-8")) - (define modules (getenv "modules")) @@ -1996,8 +1990,7 @@ (define* (gexp->script name exp #:key (guile (default-guile)) (module-path %load-path) (system (%current-system)) - (target 'current) - (locale "C.UTF-8")) + (target 'current)) "Return an executable script NAME that runs EXP using GUILE, with EXP's imported modules in its search path. Look up EXP's modules in MODULE-PATH." (mlet* %store-monad ((target (if (eq? target 'current) @@ -2040,8 +2033,7 @@ (define* (gexp->script name exp ;; These derivations are not worth offloading or ;; substituting. #:local-build? #t - #:substitutable? #f - #:env-vars `(("LANG" . ,locale))))) + #:substitutable? #f))) (define* (gexp->file name exp #:key (guile (default-guile)) @@ -2049,8 +2041,7 @@ (define* (gexp->file name exp #:key (module-path %load-path) (splice? #f) (system (%current-system)) - (target 'current) - (locale "C.UTF-8")) + (target 'current)) "Return a derivation that builds a file NAME containing EXP. When SPLICE? is true, EXP is considered to be a list of expressions that will be spliced in the resulting file. @@ -2090,8 +2081,7 @@ (define extensions (gexp-extensions exp)) #:local-build? #t #:substitutable? #f #:system system - #:target target - #:env-vars `(("LANG" . ,locale))) + #:target target) (gexp->derivation name (gexp (call-with-output-file (ungexp output) @@ -2108,8 +2098,7 @@ (define extensions (gexp-extensions exp)) #:local-build? #t #:substitutable? #f #:system system - #:target target - #:env-vars `(("LANG" . ,locale)))))) + #:target target)))) (define* (text-file* name #:rest text) "Return as a monadic value a derivation that builds a text file containing @@ -2119,7 +2108,6 @@ (define* (text-file* name #:rest text) (define builder (gexp (call-with-output-file (ungexp output "out") (lambda (port) - (set-port-encoding! port "UTF-8") (display (string-append (ungexp-splicing text)) port))))) (gexp->derivation name builder