From patchwork Sat Dec 14 17:21:40 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Mathieu Othacehe X-Patchwork-Id: 16519 Return-Path: X-Original-To: patchwork@mira.cbaines.net Delivered-To: patchwork@mira.cbaines.net Received: by mira.cbaines.net (Postfix, from userid 113) id 6089D178DB; Sat, 14 Dec 2019 23:23:49 +0000 (GMT) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,FREEMAIL_FROM, T_DKIM_INVALID,URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.0 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mira.cbaines.net (Postfix) with ESMTP id 1762E178D7 for ; Sat, 14 Dec 2019 23:23:49 +0000 (GMT) Received: from localhost ([::1]:34500 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1igGlI-0001IX-4s for patchwork@mira.cbaines.net; Sat, 14 Dec 2019 18:23:48 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:41463) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1igGke-0000SW-Es for guix-patches@gnu.org; Sat, 14 Dec 2019 18:23:10 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1igGkc-0002Zj-LO for guix-patches@gnu.org; Sat, 14 Dec 2019 18:23:08 -0500 Received: from debbugs.gnu.org ([209.51.188.43]:58118) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1igGkc-0002Ot-D2 for guix-patches@gnu.org; Sat, 14 Dec 2019 18:23:06 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1igEY5-0002ZY-Uj for guix-patches@gnu.org; Sat, 14 Dec 2019 16:02:01 -0500 X-Loop: help-debbugs@gnu.org Subject: [bug#38612] Pass system and target arguments to gexp->file. Resent-From: Mathieu Othacehe Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Sat, 14 Dec 2019 21:02:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 38612 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: To: 38612@debbugs.gnu.org X-Debbugs-Original-To: guix-patches@gnu.org Received: via spool by submit@debbugs.gnu.org id=B.15763572819830 (code B ref -1); Sat, 14 Dec 2019 21:02:01 +0000 Received: (at submit) by debbugs.gnu.org; 14 Dec 2019 21:01:21 +0000 Received: from localhost ([127.0.0.1]:35810 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1igEXR-0002YU-6c for submit@debbugs.gnu.org; Sat, 14 Dec 2019 16:01:21 -0500 Received: from lists.gnu.org ([209.51.188.17]:58488) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1igEXP-0002YM-C4 for submit@debbugs.gnu.org; Sat, 14 Dec 2019 16:01:20 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:49892) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1igEXN-0001lz-MK for guix-patches@gnu.org; Sat, 14 Dec 2019 16:01:18 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1igEXM-0005Ic-Cw for guix-patches@gnu.org; Sat, 14 Dec 2019 16:01:17 -0500 Received: from mail-wm1-x330.google.com ([2a00:1450:4864:20::330]:51362) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1igEXM-0005ES-2F for guix-patches@gnu.org; Sat, 14 Dec 2019 16:01:16 -0500 Received: by mail-wm1-x330.google.com with SMTP id d73so2491173wmd.1 for ; Sat, 14 Dec 2019 13:01:15 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=user-agent:from:to:subject:date:message-id:mime-version; bh=DaMSgNhyBN4dlpRJ0HnYuGqPqNXcIMlYOy9XGqybzlA=; b=pNFxh4dZ9nXBCbrkvWBEHoCCssEGn7L+xGGqAM2Y/rsfWkZCFz57xZwsq7h53pNfXm 3rvI0MvWDVdSMvStbuprvuoJRY4aqz9Ru96tvpDnA9kiEiWMqtVzPry/IM2SDbDwTg+g zrI4rnJnYN8VArF6q4oRqUElp8yEilH8YzZ89LfGJAjBDAhiePzuvEI/aIrKL611D4cy H+TGLPnta93HId8mafZARKYtTaH1vLOssiSr/tGw9o4xJ/GHH7hFks804Q9UKWC0enfH rfOlLHaauJJxXdFNyKBhlq0M5F1MPZg8swIDhG0hyZGXQXWPPDNvR7h6ylvczNfKoYKe aViA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:user-agent:from:to:subject:date:message-id :mime-version; bh=DaMSgNhyBN4dlpRJ0HnYuGqPqNXcIMlYOy9XGqybzlA=; b=C3tw01nuK1z1HSIzMRNpDVmuq2gkZ4uJXWIusuT3nQvGoiZKQpJWwuG04//sObXgJZ mKcEuvLnFuw8k1+mSvd6jaL3g5la2/nYlXlK/F/ICldUPGiU1Hm3p/V3Jz3R6W29pCYf Y5g13ZNF+3SsLXynaUPW6EL2fTc5VAwe7746w3Wh0b6UWz45ZSMRUyrhwpJyFbk7jIfY FpltLwmqHQt9V1c8i7d7YJf388RTuTtzEBENKtMEeMgy2OqZ0X0q0hg1UGA0aXDmHnt7 U5XBMJpA/qIHWURiiai3J8/cTkqokjRRD1Ft2+rVHNJDcmV4BaU5rYn/64SJaszZdGg/ Be3w== X-Gm-Message-State: APjAAAVr5Ep6DoWH1K3F1iuvoR412JzHxYh/g6bV+euw3kE/d6X9ED2r Z7i6Kc+YDhgKFKG1jfMHCRRAfEFk X-Google-Smtp-Source: APXvYqznC312jfKoXLoG8kSeYBaO+gZfGDqtPaTtSr4RCdZy0Jq/OhbgyIQmXHGOnhnuRkfi75wQ/w== X-Received: by 2002:a05:600c:2c44:: with SMTP id r4mr19760852wmg.140.1576344102974; Sat, 14 Dec 2019 09:21:42 -0800 (PST) Received: from cervin ([2a01:e0a:fa:a50:7432:4a59:232e:bf96]) by smtp.gmail.com with ESMTPSA id r5sm14086937wrt.43.2019.12.14.09.21.41 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 14 Dec 2019 09:21:41 -0800 (PST) User-agent: mu4e 1.2.0; emacs 26.3 From: Mathieu Othacehe Date: Sat, 14 Dec 2019 18:21:40 +0100 Message-ID: <87a77ug6vv.fsf@gmail.com> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 209.51.188.43 X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org Sender: "Guix-patches" X-getmail-retrieved-from-mailbox: Patches Hello, The attached patch fixes issues encountered when cross-compiling a system. gexps passed to gexp->file were not honoring target argument. Mathieu From 67c3982503c4d9ab4c77b5df295957abbe60dfeb Mon Sep 17 00:00:00 2001 From: Mathieu Othacehe 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 ;;; Copyright © 2018 Clément Lassieur ;;; Copyright © 2018 Jan Nieuwenhuizen +;;; Copyright © 2019 Mathieu Othacehe ;;; ;;; 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 (($ 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 @@ -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