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