From: Mathieu Othacehe <m.othacehe@gmail.com>
To: 38612@debbugs.gnu.org
Subject: [bug#38612] Pass system and target arguments to gexp->file.
Date: Sat, 14 Dec 2019 18:21:40 +0100 [thread overview]
Message-ID: <87a77ug6vv.fsf@gmail.com> (raw)
[-- Attachment #1: Type: text/plain, Size: 156 bytes --]
Hello,
The attached patch fixes issues encountered when cross-compiling a
system. gexps passed to gexp->file were not honoring target argument.
Mathieu
[-- Attachment #2: 0001-gexp-Add-system-and-target-support-to-gexp-file.patch --]
[-- Type: text/x-diff, Size: 3592 bytes --]
From 67c3982503c4d9ab4c77b5df295957abbe60dfeb Mon Sep 17 00:00:00 2001
From: Mathieu Othacehe <m.othacehe@gmail.com>
Date: Sat, 14 Dec 2019 17:52:53 +0100
Subject: [PATCH] gexp: Add system and target support to gexp->file.
* guix/gexp.scm (gexp->file): Add system and target arguments and pass them to
gexp->derivation and load-path-expression calls,
(scheme-file-compiler): adapt accordingly to pass system and target arguments.
---
guix/gexp.scm | 22 +++++++++++++++++-----
1 file changed, 17 insertions(+), 5 deletions(-)
diff --git a/guix/gexp.scm b/guix/gexp.scm
index a96592ac76..ca436b5a66 100644
--- a/guix/gexp.scm
+++ b/guix/gexp.scm
@@ -2,6 +2,7 @@
;;; Copyright © 2014, 2015, 2016, 2017, 2018, 2019 Ludovic Courtès <ludo@gnu.org>
;;; Copyright © 2018 Clément Lassieur <clement@lassieur.org>
;;; Copyright © 2018 Jan Nieuwenhuizen <janneke@gnu.org>
+;;; Copyright © 2019 Mathieu Othacehe <m.othacehe@gmail.com>
;;;
;;; This file is part of GNU Guix.
;;;
@@ -456,7 +457,10 @@ This is the declarative counterpart of 'gexp->file'."
;; Compile FILE by returning a derivation that builds the file.
(match file
(($ <scheme-file> name gexp splice?)
- (gexp->file name gexp #:splice? splice?))))
+ (gexp->file name gexp
+ #:splice? splice?
+ #:system system
+ #:target target))))
;; Appending SUFFIX to BASE's output file name.
(define-record-type <file-append>
@@ -1603,7 +1607,9 @@ imported modules in its search path. Look up EXP's modules in MODULE-PATH."
(define* (gexp->file name exp #:key
(set-load-path? #t)
(module-path %load-path)
- (splice? #f))
+ (splice? #f)
+ (system (%current-system))
+ target)
"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.
@@ -1626,10 +1632,14 @@ Lookup EXP's modules in MODULE-PATH."
exp
(gexp ((ungexp exp)))))))))
#:local-build? #t
- #:substitutable? #f)
+ #:substitutable? #f
+ #:system system
+ #:target target)
(mlet %store-monad ((set-load-path
(load-path-expression modules module-path
- #:extensions extensions)))
+ #:extensions extensions
+ #:system system
+ #:target target)))
(gexp->derivation name
(gexp
(call-with-output-file (ungexp output)
@@ -1642,7 +1652,9 @@ Lookup EXP's modules in MODULE-PATH."
(gexp ((ungexp exp)))))))))
#:module-path module-path
#:local-build? #t
- #:substitutable? #f))))
+ #:substitutable? #f
+ #:system system
+ #:target target))))
(define* (text-file* name #:rest text)
"Return as a monadic value a derivation that builds a text file containing
--
2.24.0
next reply other threads:[~2019-12-14 23:23 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-12-14 17:21 Mathieu Othacehe [this message]
2019-12-15 14:50 ` [bug#38612] Pass system and target arguments to gexp->file Mathieu Othacehe
2019-12-20 21:45 ` Ludovic Courtès
2019-12-24 14:11 ` Mathieu Othacehe
2019-12-25 9:42 ` Mathieu Othacehe
2019-12-26 18:04 ` Ludovic Courtès
2019-12-26 18:54 ` Mathieu Othacehe
2019-12-27 18:05 ` Ludovic Courtès
2019-12-29 9:33 ` Mathieu Othacehe
2019-12-29 22:36 ` Ludovic Courtès
2019-12-30 8:40 ` Mathieu Othacehe
2019-12-26 17:58 ` Ludovic Courtès
2019-12-26 18:19 ` Mathieu Othacehe
2019-12-20 21:41 ` Ludovic Courtès
2019-12-24 14:08 ` Mathieu Othacehe
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://guix.gnu.org/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87a77ug6vv.fsf@gmail.com \
--to=m.othacehe@gmail.com \
--cc=38612@debbugs.gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://git.savannah.gnu.org/cgit/guix.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).