From patchwork Wed Dec 25 09:42:48 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Mathieu Othacehe X-Patchwork-Id: 19440 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 767E317983; Wed, 25 Dec 2019 09:43:11 +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 16B4217920 for ; Wed, 25 Dec 2019 09:43:10 +0000 (GMT) Received: from localhost ([::1]:45126 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ik3C9-00030a-Fi for patchwork@mira.cbaines.net; Wed, 25 Dec 2019 04:43:09 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:49966) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ik3C3-0002zG-N9 for guix-patches@gnu.org; Wed, 25 Dec 2019 04:43:05 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ik3C2-0004An-CU for guix-patches@gnu.org; Wed, 25 Dec 2019 04:43:03 -0500 Received: from debbugs.gnu.org ([209.51.188.43]:47323) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1ik3C2-0004Ae-8z for guix-patches@gnu.org; Wed, 25 Dec 2019 04:43:02 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1ik3C2-0000M7-3H for guix-patches@gnu.org; Wed, 25 Dec 2019 04:43:02 -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: Wed, 25 Dec 2019 09:43:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 38612 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: To: Ludovic =?utf-8?q?Court=C3=A8s?= Cc: 38612@debbugs.gnu.org Received: via spool by 38612-submit@debbugs.gnu.org id=B38612.15772669791358 (code B ref 38612); Wed, 25 Dec 2019 09:43:02 +0000 Received: (at 38612) by debbugs.gnu.org; 25 Dec 2019 09:42:59 +0000 Received: from localhost ([127.0.0.1]:53296 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ik3By-0000Lq-WA for submit@debbugs.gnu.org; Wed, 25 Dec 2019 04:42:59 -0500 Received: from mail-wr1-f52.google.com ([209.85.221.52]:36858) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ik3Bx-0000Ld-F7 for 38612@debbugs.gnu.org; Wed, 25 Dec 2019 04:42:58 -0500 Received: by mail-wr1-f52.google.com with SMTP id z3so21518786wru.3 for <38612@debbugs.gnu.org>; Wed, 25 Dec 2019 01:42:57 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=references:user-agent:from:to:cc:subject:in-reply-to:date :message-id:mime-version; bh=TwdAzxsNwH7+LENQg3nruwAWsqLTxKSBhLOY40Yobqk=; b=hNGc7M2fQTqvAupwSGdgqBImd39AwcRBGeaCb/y6hxsdI5F/tn36FFhADHiHJl+Sxj 0bZYR2gTzzSb6SKXPgXkHpP4UKh89n/of5LEBiInN28QFcqyV60ETVWSmCxQ9hS5/31w RthX8eBva+1VuUHxvwEV+B4Xn1YCJVbZzcq9VHcWcbRdZbQQ6TJ4cITW9l5+I4UDNcjm p8PZlGI1dt/4zwDhfSvY94z6oCk/rA3fqSxpWymJKUuTMLNLvSCrFuHhjWNBuh85VCJA 8maWt3ryIeLEOTnzUpswBKojTRAhPcACYuNEOvHZd2TXji3numl18aPiyIYg0Aq19iBy Yynw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:references:user-agent:from:to:cc:subject :in-reply-to:date:message-id:mime-version; bh=TwdAzxsNwH7+LENQg3nruwAWsqLTxKSBhLOY40Yobqk=; b=o31nBUE/LpPzXclQ+FxwNdf5Yobim3ot4KKMM7cvQg5N6uCTZat3PK5m3T+5Cleopm lQ2CJ+BD/lytHgq0kyY1YYHjeh/DJG5SAXZGz0uGaAqfa2PTtSrcXiR8slD3NBLaYdgK YnwWj8wNqvXqewSmBPwgYBkmtA5OoSAUjdbKoLHp+l7atgDYn9dZox3XwLJDtIsX0nOE 0rt4uXI40IUQRTtCca2bbvzlxmNhCbHGuEVAxtnR9yoLxDDw+Cw0ektRwU5XrOuSRUK5 1c+BbzZsrBI04WMDRnzx4eg4jigEwHZJ6DUR2Wf6Kywx//qe/ZSAyUv3Cp8l+uFq2qbx T1gw== X-Gm-Message-State: APjAAAUa7+fnZkFRIIoHVwFSKh9iN8GK/KyyLnjRp578fSew9sNhhxsk wQsTmlDc+aDGNf3gjx2BIeBrvrZj X-Google-Smtp-Source: APXvYqxX9xTRDgE0/tMk0H80OY7NXUE9xb6HZKiC+iM4YBYb+5vxghZpxSOL8b2Wp29DyKzfpHZYUw== X-Received: by 2002:adf:cd0a:: with SMTP id w10mr38680022wrm.107.1577266971164; Wed, 25 Dec 2019 01:42:51 -0800 (PST) Received: from cervin ([2a01:cb18:832e:5f00:a14b:cea0:a27:c884]) by smtp.gmail.com with ESMTPSA id n1sm26571131wrw.52.2019.12.25.01.42.49 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 25 Dec 2019 01:42:49 -0800 (PST) References: <87a77ug6vv.fsf@gmail.com> <8736dl8wxq.fsf@gmail.com> <87d0cipt6z.fsf@gnu.org> <87r20t7r0j.fsf@gmail.com> User-agent: mu4e 1.2.0; emacs 26.3 From: Mathieu Othacehe In-reply-to: <87r20t7r0j.fsf@gmail.com> Date: Wed, 25 Dec 2019 10:42:48 +0100 Message-ID: <87imm468rr.fsf@gmail.com> MIME-Version: 1.0 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] 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, Turns out two more patches in the same vein are needed in (gnu services) and (gnu system). They are attached here. Thanks, Mathieu From 0ce67afc4f33074e20824751c22ba01cf6a3e184 Mon Sep 17 00:00:00 2001 From: Mathieu Othacehe Date: Wed, 25 Dec 2019 09:49:53 +0100 Subject: [PATCH 2/2] services: Fix cross-compilation. * gnu/services.scm (system-derivation): Pass current system and target at bind time to lower-object, (compute-boot-script): also pass current system and target at bind time to gexp->file. --- gnu/services.scm | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-) diff --git a/gnu/services.scm b/gnu/services.scm index e7a3a95e43..e6f8ae0fb0 100644 --- a/gnu/services.scm +++ b/gnu/services.scm @@ -1,6 +1,7 @@ ;;; GNU Guix --- Functional package management for GNU ;;; Copyright © 2015, 2016, 2017, 2018, 2019 Ludovic Courtès ;;; Copyright © 2016 Chris Marusich +;;; Copyright © 2019 Mathieu Othacehe ;;; ;;; This file is part of GNU Guix. ;;; @@ -321,11 +322,15 @@ This is a shorthand for (map (lambda (svc) ...) %base-services)." (define (system-derivation mentries mextensions) "Return as a monadic value the derivation of the 'system' directory containing the given entries." - (mlet %store-monad ((entries mentries) + (mlet %store-monad ((system (current-system)) + (target (current-target-system)) + (entries mentries) (extensions (sequence %store-monad mextensions))) (lower-object (file-union "system" - (append entries (concatenate extensions)))))) + (append entries (concatenate extensions))) + system + #:target target))) (define system-service-type ;; This is the ultimate service type, the root of the service DAG. The @@ -346,9 +351,13 @@ system profile, boot script, and so on."))) ;; order. That is, user extensions would come first, and extensions added ;; by 'essential-services' (e.g., running shepherd) are guaranteed to come ;; last. - (gexp->file "boot" - ;; Clean up and activate the system, then spawn shepherd. - #~(begin #$@(reverse gexps)))) + (mlet %store-monad ((system (current-system)) + (target (current-target-system))) + (gexp->file "boot" + ;; Clean up and activate the system, then spawn shepherd. + #~(begin #$@(reverse gexps)) + #:system system + #:target target))) (define (boot-script-entry mboot) "Return, as a monadic value, an entry for the boot script in the system -- 2.24.1