From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp0 ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms11 with LMTPS id +BOHOt9i3165VwAA0tVLHw (envelope-from ) for ; Tue, 09 Jun 2020 10:22:23 +0000 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp0 with LMTPS id OCtNNt9i3176IAAA1q6Kng (envelope-from ) for ; Tue, 09 Jun 2020 10:22:23 +0000 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id 7B3AE9401CB for ; Tue, 9 Jun 2020 10:22:23 +0000 (UTC) Received: from localhost ([::1]:53670 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jibOg-0003nh-Az for larch@yhetil.org; Tue, 09 Jun 2020 06:22:22 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:57794) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jibOX-0003nN-KX for guix-devel@gnu.org; Tue, 09 Jun 2020 06:22:13 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]:38534) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jibOX-0001n4-AO for guix-devel@gnu.org; Tue, 09 Jun 2020 06:22:13 -0400 Received: from [2a01:e0a:fa:a50:d939:1174:2a3f:75c2] (port=50196 helo=meru) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1jibOW-0000lE-No for guix-devel@gnu.org; Tue, 09 Jun 2020 06:22:13 -0400 From: Mathieu Othacehe To: guix-devel@gnu.org Subject: Canonical-packages restoration. Date: Tue, 09 Jun 2020 12:22:09 +0200 Message-ID: <87zh9co7xq.fsf@gnu.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.3 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-BeenThere: guix-devel@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "Development of GNU Guix and the GNU System distribution." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-devel-bounces+larch=yhetil.org@gnu.org Sender: "Guix-devel" X-Scanner: scn0 Authentication-Results: aspmx1.migadu.com; dkim=none; dmarc=none; spf=pass (aspmx1.migadu.com: domain of guix-devel-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=guix-devel-bounces@gnu.org X-Spam-Score: -1.01 X-TUID: 1JaWMkAA3Oex Hello, With f30d84d32db0f4f6cb84e139868e1727a7dc0a51 and dfc8ccbf5da96a67eb1cade499f0def21e7fdb02, I did remove most of the "canonical-package" calls because they were breaking system cross-compilation. Now, I'd like to somehow restore them, using the new "let-system". My idea is to define something like: --8<---------------cut here---------------start------------->8--- (define (canonical-package* package) (let ((canonical (module-ref (resolve-interface '(gnu packages base)) 'canonical-package))) (let-system (system target) (if target package (canonical package))))) --8<---------------cut here---------------end--------------->8--- And then use for instance this way: --8<---------------cut here---------------start------------->8--- diff --git a/gnu/system/locale.scm b/gnu/system/locale.scm index 689d238d1a..fd50538e9a 100644 --- a/gnu/system/locale.scm +++ b/gnu/system/locale.scm @@ -106,7 +106,8 @@ of LIBC." ;; 'localedef' executes 'gzip' to access compressed locale sources. (setenv "PATH" - (string-append #+gzip "/bin:" #+libc "/bin")) + (string-append #+gzip "/bin:" + #+(canonical-package* libc) "/bin")) --8<---------------cut here---------------end--------------->8--- However, it seems that nesting a "let-system" inside "file-append" does not work: --8<---------------cut here---------------start------------->8--- (use-modules (guix)) (use-modules (gnu)) (run-with-store (open-connection) (mlet* %store-monad ((drv (lower-object (computed-file "computed" #~(begin (mkdir #$output) (symlink #$(file-append (let-system (s t) glibc) "/bin") (string-append #$output "/ref")))))) (output -> (derivation->output-path drv))) (mbegin %store-monad (built-derivations (list drv)) (return (format #t "~a~%" output))))) --8<---------------cut here---------------end--------------->8--- and it prevents me from going further. Does this stuff make any sense? If yes I can try to fix it, but I just want to be sure first :) Thanks, Mathieu