From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp2 ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms0.migadu.com with LMTPS id KI06JIYAp2FQYAEAgWs5BA (envelope-from ) for ; Wed, 01 Dec 2021 05:56:38 +0100 Received: from aspmx1.migadu.com ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp2 with LMTPS id WPDYH4YAp2ErJgAAB5/wlQ (envelope-from ) for ; Wed, 01 Dec 2021 04:56:38 +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 275E61A21D for ; Wed, 1 Dec 2021 05:56:38 +0100 (CET) Received: from localhost ([::1]:32870 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1msHfZ-0007cV-4R for larch@yhetil.org; Tue, 30 Nov 2021 23:56:37 -0500 Received: from eggs.gnu.org ([209.51.188.92]:38530) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1msHfO-0007c3-6a for guix-devel@gnu.org; Tue, 30 Nov 2021 23:56:26 -0500 Received: from [2607:f8b0:4864:20::82f] (port=46067 helo=mail-qt1-x82f.google.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1msHfM-0000At-47; Tue, 30 Nov 2021 23:56:25 -0500 Received: by mail-qt1-x82f.google.com with SMTP id p19so22706857qtw.12; Tue, 30 Nov 2021 20:56:23 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:references:date:in-reply-to:message-id :user-agent:mime-version; bh=lF/W4gc+ZeEBLrrkOwut77j6LHVzEiYImUgKUYVIC5w=; b=QYdglCHIqf1dAzSNsj0fzIb+vbQWeKX9tx3koAkyj0mlFWzmszctCov4kkfHbIucMF 270LPN6Vc4e+rN5KJ4kD/2CVpOCiZqZy6OjFIWFznbbtUkVxjheQjxG7W8tRP2wndL5Z vxV4Lryfi66hNzcBIhS+jHQLm9DgEFQT7jHfIvW60jZP6buSb1ueaB4ivBiqdalIP1tR 1UcVjbsAQmEgbTlRHPOk4laqRkHtKtHKQswhHB1C84kUvl6Iqaiz2351g0eQ0AzeveUS zZUcOsH8fn8baOKOfMIUP3ML+PFsjgVquJlL2FV1Lt/u6m045OtEVxn/j4K7N2omVWVw C0wA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:references:date:in-reply-to :message-id:user-agent:mime-version; bh=lF/W4gc+ZeEBLrrkOwut77j6LHVzEiYImUgKUYVIC5w=; b=w4IvGMzUNU9yW3vG/Fh+bZGDMI/h0mncrsl/5xXNfnxmGdxKx7TP5xPP7Am4E0Y6+P H90uKniTPsJ3NVWJQ89CF0SohSNbjzfpz3E+zpq3QV94U784X7hWmNaeIMtAQx80kXVE 3IzOwFdKIFv3rPNN1MlflNzP2+F5uepo20h7f/orGClAy7DXRIVZApeBL0RMI7WCbHap wgIxr02kplzeOUPx82MP0TXlVEsdheyim5ycfflyLuSuTkTLOqIeqvqtyYN3ZxNC2teb MaDPC0hfh2WYipBVp2ms8lTonaE3b6OZYL5rvpJc+9o03q8df58J2gLtt1rwJknblWGt S/fg== X-Gm-Message-State: AOAM531BLJGfB/ANL5yEaMgm9LTd9rhEfkdbE1m0d8mO24SoLlDGgLlL /kmEn/oW6KrbLcP1oqU2srj2OGcP6bt2LA== X-Google-Smtp-Source: ABdhPJysEICThJMPGqJvAyj/saTDSRPkkFx6OeVHnrRikvAintoka8e4qLDTab8i/ROmIDVjG4uXfg== X-Received: by 2002:a05:622a:1386:: with SMTP id o6mr4332611qtk.64.1638334582611; Tue, 30 Nov 2021 20:56:22 -0800 (PST) Received: from hurd (dsl-10-146-213.b2b2c.ca. [72.10.146.213]) by smtp.gmail.com with ESMTPSA id h22sm12168251qtb.86.2021.11.30.20.56.21 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 30 Nov 2021 20:56:22 -0800 (PST) From: Maxim Cournoyer To: Ludovic =?utf-8?Q?Court=C3=A8s?= Subject: Re: Desktops on non-x86_64 systems References: <8735nh8bvw.fsf@inria.fr> <87sfvhnrm2.fsf@elephly.net> <87pmql6kug.fsf@gmail.com> <87lf196jrg.fsf@gmail.com> <874k7w9nm9.fsf@gnu.org> Date: Tue, 30 Nov 2021 23:56:21 -0500 In-Reply-To: <874k7w9nm9.fsf@gnu.org> ("Ludovic =?utf-8?Q?Court=C3=A8s=22'?= =?utf-8?Q?s?= message of "Sun, 28 Nov 2021 18:49:34 +0100") Message-ID: <87pmqghqiy.fsf@gmail.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.2 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Host-Lookup-Failed: Reverse DNS lookup failed for 2607:f8b0:4864:20::82f (failed) Received-SPF: pass client-ip=2607:f8b0:4864:20::82f; envelope-from=maxim.cournoyer@gmail.com; helo=mail-qt1-x82f.google.com X-Spam_score_int: -12 X-Spam_score: -1.3 X-Spam_bar: - X-Spam_report: (-1.3 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, PDS_HP_HELO_NORDNS=0.001, RCVD_IN_DNSWL_NONE=-0.0001, RDNS_NONE=0.793, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: guix-devel@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "Development of GNU Guix and the GNU System distribution." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: guix-devel@gnu.org Errors-To: guix-devel-bounces+larch=yhetil.org@gnu.org Sender: "Guix-devel" X-Migadu-Flow: FLOW_IN X-Migadu-Country: US ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1638334598; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type:in-reply-to:in-reply-to: references:references:list-id:list-help:list-unsubscribe: list-subscribe:list-post:dkim-signature; bh=lF/W4gc+ZeEBLrrkOwut77j6LHVzEiYImUgKUYVIC5w=; b=FbJ9Ctm/7MI2NiujevhRoFod3IA9vbdxyW6l6MdLmofG364+tvonTYCwp6v+ABqpsLhxWd IYiAAk0N1Ls+lGK6l/xb3cWkQ+QmwHH3w/CNqLpwovsw4sycVKzUEG/sXxP6ZIxUM1M6Hz YO/ikKGLtKOCl+KS/ApzM4Fxq1SuX+JhdyugmvAwVMGBsqybs1TbDBj8V7CdOfdSHZZrMp oXWnIwDfQBncbCXgdbC2p7eLBELesPzbu4DYKwL1qH/+apDSSjdkimjZ9EZinLyhj7b/nt cqLhn1ytEGrjAgKRgvkDRxkJUNFTrwSBkoTdERpWdqhsRQFScV6qAP7K6i59NA== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1638334598; a=rsa-sha256; cv=none; b=t+7qbY03f0cdbPRnzsO3Puelj187M3Nl4FUW3ReYrcF3rib+Kk/xkyzBCR+aSDSBzD8V6J kIrzZqnKhvzApt5wAujgMv4qcMYr6GnXICEycf8Ch6I0plzb7v+8HhK14auTmd7Mkr9mnQ bTT1xjntxy9L5eMEPnELW3AS+Td/BQe/MECby7+agDfyt8oXwEV/uzbMahuAhvjgvo8wNw Kn7mZzg1efRspFoJwJ/gDm6jvPhVbq8VA462PpJcNW7Mke2Wt7YnxnDHvz7DVMzNH47lzW WWNH2GuPqVH0sXJPWKgpmvwFu4Cd79MiLCC7uAmMInmwHY+3Ypi2Xu+zsuLDJQ== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=gmail.com header.s=20210112 header.b=QYdglCHI; dmarc=fail reason="SPF not aligned (relaxed)" header.from=gmail.com (policy=none); spf=pass (aspmx1.migadu.com: domain of "guix-devel-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="guix-devel-bounces+larch=yhetil.org@gnu.org" X-Migadu-Spam-Score: -1.81 Authentication-Results: aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=gmail.com header.s=20210112 header.b=QYdglCHI; dmarc=fail reason="SPF not aligned (relaxed)" header.from=gmail.com (policy=none); spf=pass (aspmx1.migadu.com: domain of "guix-devel-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="guix-devel-bounces+larch=yhetil.org@gnu.org" X-Migadu-Queue-Id: 275E61A21D X-Spam-Score: -1.81 X-Migadu-Scanner: scn0.migadu.com X-TUID: sC7qzFZ8UQcX Hello! I've updated the branch wip-cross-built-rust; it seems to build and run OK (although running the binary produced by compiling hello.rs with the cross-built i686-linux rustc in a 32 bit VM took 47 sec (!?)), apparently hanging on something before outputting correctly the message and exiting with 0. I'd now like to figure out the top-level plumbing required to get this rust-i686-linux x86-64 package accepted in the real of i686-linux packages (cross the architecture boundary). Is this even possible in Guix? In other words, I'd like the i686 architecture to be able to use this rust-i686-linux cross built from x86_64 as if it was a *native* package. Following what was done for polkit-mozjs/polkit-duktape, I've laid the basic blocks: --8<---------------cut here---------------start------------->8--- 2 files changed, 25 insertions(+), 8 deletions(-) gnu/packages/rust.scm | 26 ++++++++++++++++++++------ guix/build-system/cargo.scm | 7 +++++-- modified gnu/packages/rust.scm @@ -54,11 +54,13 @@ (define-module (gnu packages rust) #:use-module (guix download) #:use-module (guix git-download) #:use-module ((guix licenses) #:prefix license:) + #:use-module (guix memoization) #:use-module (guix packages) #:use-module ((guix build utils) #:select (alist-replace)) #:use-module (guix utils) #:use-module (ice-9 match) - #:use-module (srfi srfi-26)) + #:use-module (srfi srfi-26) + #:export (rust)) ;; This is the hash for the empty file, and the reason it's relevant is not ;; the most obvious. @@ -780,10 +782,22 @@ (define rust-1.54 (package-native-inputs base-rust)))))) ;;; Note: Only the latest versions of Rust are supported and tested. The -;;; intermediate rusts are built for bootstrapping purposes and should not -;;; be relied upon. This is to ease maintenance and reduce the time -;;; required to build the full Rust bootstrap chain. -(define-public rust rust-1.54) +;;; intermediate rusts are built for bootstrapping purposes and should not be +;;; relied upon. This is to ease maintenance and reduce the time required to +;;; build the full Rust bootstrap chain. +(define-public rust-x86-64-linux rust-1.54) + +(define rust-for-system + (mlambda (system) + "Return a rust package that can be built for SYSTEM." + (if (string-prefix? "i686" system) + rust-i686-linux + rust-x86-64-linux))) + +(define-syntax rust + (identifier-syntax (rust-for-system + (or (%current-target-system) + (%current-system))))) (define (force-system p system) (package/inherit p @@ -796,7 +810,7 @@ (define force-i686 (cut force-system <> "i686-linux")) ;;; Rust cross-built for i686-linux. ;;; TODO: Make a procedure of it that returns a cross-built rust package. (define-public rust-i686-linux - (let* ((base-rust (rust-bootstrapped-package rust)) + (let* ((base-rust (rust-bootstrapped-package rust-x86-64-linux)) (base-source (package-source base-rust))) (package/inherit base-rust (source (origin modified guix/build-system/cargo.scm @@ -58,8 +58,11 @@ (define (crate-uri name version) (define (default-rust) "Return the default Rust package." ;; Lazily resolve the binding to avoid a circular dependency. - (let ((rust (resolve-interface '(gnu packages rust)))) - (module-ref rust 'rust))) + (let-system (system target) + (let ((rust (resolve-interface '(gnu packages rust)))) + (if (string-prefix? "i686" (or target system)) + (module-ref rust 'rust-i686-linux) + (module-ref rust 'rust-x86-64-linux))))) (define %cargo-utils-modules ;; Build-side modules imported by default. --8<---------------cut here---------------end--------------->8--- But this doesn't take care of switching the x86_64-associated rust-i686-linux package to become known as a i686 one. How to proceed? I need a wizard :-). Thanks! Maxim