unofficial mirror of guix-patches@gnu.org 
 help / color / mirror / code / Atom feed
* [bug#67506] guix: platform: Add platform-rust-architecture.
       [not found] <cover.1700665986.git.efraim@flashner.co.il>
@ 2023-11-28 10:52 ` Efraim Flashner
  2023-12-01 14:39   ` Jean-Pierre De Jesus Diaz via Guix-patches via
  0 siblings, 1 reply; 5+ messages in thread
From: Efraim Flashner @ 2023-11-28 10:52 UTC (permalink / raw)
  To: 67506
  Cc: Efraim Flashner, Christopher Baines, Josselin Poiret,
	Ludovic Courtès, Mathieu Othacehe, Ricardo Wurmus,
	Simon Tournier, Tobias Geerinckx-Rice

* guix/platform.scm <platform>: Add rust-architecture field.
* guix/platforms/arm.scm (armv7-linux, aarch64-linux): Add the system's
rust architecture triplet.
* guix/platforms/mips.scm (mips64-linux):
* guix/platforms/powerpc.scm (powerpc-linux, powerpc64-linux,
powerpc64le-linux):
* guix/platforms/riscv.scm (riscv64-linux):
* guix/platforms/x86.scm (i686-linux, x86_64-linux, i686-mingw,
x86_64-mingw, i586-pc): Same.

Change-Id: Id9dca0fb8ec2b3bf2b3876b974e4bbaa30dbc6a6
---
 guix/platform.scm          | 3 +++
 guix/platforms/arm.scm     | 2 ++
 guix/platforms/mips.scm    | 1 +
 guix/platforms/powerpc.scm | 3 +++
 guix/platforms/riscv.scm   | 1 +
 guix/platforms/x86.scm     | 5 +++++
 6 files changed, 15 insertions(+)

diff --git a/guix/platform.scm b/guix/platform.scm
index 55917ca308..bcc2bc3e16 100644
--- a/guix/platform.scm
+++ b/guix/platform.scm
@@ -29,6 +29,7 @@ (define-module (guix platform)
             platform-target
             platform-system
             platform-linux-architecture
+            platform-rust-architecture
             platform-glibc-dynamic-linker
 
             &platform-not-found-error
@@ -74,6 +75,8 @@ (define-record-type* <platform> platform make-platform
   (system               platform-system)
   (linux-architecture   platform-linux-architecture
                         (default #false))
+  (rust-architecture    platform-rust-architecture
+                        (default #false))
   (glibc-dynamic-linker platform-glibc-dynamic-linker))
 
 \f
diff --git a/guix/platforms/arm.scm b/guix/platforms/arm.scm
index 32c0fbc032..02337ee6b3 100644
--- a/guix/platforms/arm.scm
+++ b/guix/platforms/arm.scm
@@ -27,6 +27,7 @@ (define armv7-linux
    (target "arm-linux-gnueabihf")
    (system "armhf-linux")
    (linux-architecture "arm")
+   (rust-architecture "armv7-unknown-linux-gnueabihf")
    (glibc-dynamic-linker "/lib/ld-linux-armhf.so.3")))
 
 (define aarch64-linux
@@ -34,4 +35,5 @@ (define aarch64-linux
    (target "aarch64-linux-gnu")
    (system "aarch64-linux")
    (linux-architecture "arm64")
+   (rust-architecture "aarch64-unknown-linux-gnu")
    (glibc-dynamic-linker "/lib/ld-linux-aarch64.so.1")))
diff --git a/guix/platforms/mips.scm b/guix/platforms/mips.scm
index e6fa9eb292..5c1aef5f4f 100644
--- a/guix/platforms/mips.scm
+++ b/guix/platforms/mips.scm
@@ -26,4 +26,5 @@ (define mips64-linux
    (target "mips64el-linux-gnu")
    (system "mips64el-linux")
    (linux-architecture "mips")
+   (rust-architecture "mips64el-unknown-linux-gnuabi64")
    (glibc-dynamic-linker "/lib/ld.so.1")))
diff --git a/guix/platforms/powerpc.scm b/guix/platforms/powerpc.scm
index 1c7141ab42..9730e74288 100644
--- a/guix/platforms/powerpc.scm
+++ b/guix/platforms/powerpc.scm
@@ -28,6 +28,7 @@ (define powerpc-linux
    (target "powerpc-linux-gnu")
    (system "powerpc-linux")
    (linux-architecture "powerpc")
+   (rust-architecture "powerpc-unknown-linux-gnu")
    (glibc-dynamic-linker "/lib/ld.so.1")))
 
 (define powerpc64-linux
@@ -35,6 +36,7 @@ (define powerpc64-linux
    (target "powerpc64-linux-gnu")
    (system #f)                                    ;not supported
    (linux-architecture "powerpc")
+   (rust-architecture "powerpc64-unknown-linux-gnu")
    (glibc-dynamic-linker "/lib/ld64.so.1")))
 
 (define powerpc64le-linux
@@ -42,4 +44,5 @@ (define powerpc64le-linux
    (target "powerpc64le-linux-gnu")
    (system "powerpc64le-linux")
    (linux-architecture "powerpc")
+   (rust-architecture "powerpc64le-unknown-linux-gnu")
    (glibc-dynamic-linker "/lib/ld64.so.2")))
diff --git a/guix/platforms/riscv.scm b/guix/platforms/riscv.scm
index c716c12c12..ec400a2f0c 100644
--- a/guix/platforms/riscv.scm
+++ b/guix/platforms/riscv.scm
@@ -26,4 +26,5 @@ (define riscv64-linux
    (target "riscv64-linux-gnu")
    (system "riscv64-linux")
    (linux-architecture "riscv")
+   (rust-architecture "riscv64gc-unknown-linux-gnu")
    (glibc-dynamic-linker "/lib/ld-linux-riscv64-lp64d.so.1")))
diff --git a/guix/platforms/x86.scm b/guix/platforms/x86.scm
index 6f547dd770..05c69f0d4c 100644
--- a/guix/platforms/x86.scm
+++ b/guix/platforms/x86.scm
@@ -30,6 +30,7 @@ (define i686-linux
    (target "i686-linux-gnu")
    (system "i686-linux")
    (linux-architecture "i386")
+   (rust-architecture "i686-unknown-linux-gnu")
    (glibc-dynamic-linker "/lib/ld-linux.so.2")))
 
 (define x86_64-linux
@@ -37,22 +38,26 @@ (define x86_64-linux
    (target "x86_64-linux-gnu")
    (system "x86_64-linux")
    (linux-architecture "x86_64")
+   (rust-architecture "x86_64-unknown-linux-gnu")
    (glibc-dynamic-linker "/lib/ld-linux-x86-64.so.2")))
 
 (define i686-mingw
   (platform
    (target "i686-w64-mingw32")
    (system #f)
+   (rust-architecture "i686-pc-windows-gnu")
    (glibc-dynamic-linker #f)))
 
 (define x86_64-mingw
   (platform
    (target "x86_64-w64-mingw32")
    (system #f)
+   (rust-architecture "x86_64-pc-windows-gnu")
    (glibc-dynamic-linker #f)))
 
 (define i586-gnu
   (platform
    (target "i586-pc-gnu")
    (system "i586-gnu")
+   (rust-architecture "i686-unknown-hurd-gnu")
    (glibc-dynamic-linker "/lib/ld.so.1")))
-- 
Efraim Flashner   <efraim@flashner.co.il>   רנשלפ םירפא
GPG key = A28B F40C 3E55 1372 662D  14F7 41AA E7DC CA3D 8351
Confidentiality cannot be guaranteed on emails sent or received unencrypted





^ permalink raw reply related	[flat|nested] 5+ messages in thread

* [bug#67506] guix: platform: Add platform-rust-architecture.
  2023-11-28 10:52 ` [bug#67506] guix: platform: Add platform-rust-architecture Efraim Flashner
@ 2023-12-01 14:39   ` Jean-Pierre De Jesus Diaz via Guix-patches via
  2023-12-11 11:58     ` bug#67506: " Efraim Flashner
  0 siblings, 1 reply; 5+ messages in thread
From: Jean-Pierre De Jesus Diaz via Guix-patches via @ 2023-12-01 14:39 UTC (permalink / raw)
  To: 67506; +Cc: efraim.flashner

Hello,

The patch series looks good to me.  I was thinking of something
similar to this in order
to add a procedure to cross compile the `std` target so that the rust
package can use it.

I was thinking that maybe the RUST-ARCHITECTURE could be called RUST-TARGET and
that it could be a list (RUST-TARGETS) as some GCC multilib targets
don't have a single
RUST-TARGET, namely arm-none-eabi and avr, but the latter only has one
rust target
but the intention from the existing target is to add more as needed I
think, as the
avr-unknown-gnu-atmega328 target is MCU specific.

But given that there are zero multilib targets present in GNU Guix as
of now I think
it can stay as a string.

Cheers,

-- 
Jean-Pierre De Jesus DIAZ
Foundation Devices, Inc.




^ permalink raw reply	[flat|nested] 5+ messages in thread

* bug#67506: guix: platform: Add platform-rust-architecture.
  2023-12-01 14:39   ` Jean-Pierre De Jesus Diaz via Guix-patches via
@ 2023-12-11 11:58     ` Efraim Flashner
  2023-12-11 17:32       ` [bug#67506] " Jean-Pierre De Jesus Diaz via Guix-patches via
  0 siblings, 1 reply; 5+ messages in thread
From: Efraim Flashner @ 2023-12-11 11:58 UTC (permalink / raw)
  To: Jean-Pierre De Jesus Diaz; +Cc: 67506-done

[-- Attachment #1: Type: text/plain, Size: 1300 bytes --]

On Fri, Dec 01, 2023 at 02:39:44PM +0000, Jean-Pierre De Jesus Diaz via Guix-patches via wrote:
> Hello,
> 
> The patch series looks good to me.  I was thinking of something
> similar to this in order
> to add a procedure to cross compile the `std` target so that the rust
> package can use it.
> 
> I was thinking that maybe the RUST-ARCHITECTURE could be called RUST-TARGET and
> that it could be a list (RUST-TARGETS) as some GCC multilib targets
> don't have a single
> RUST-TARGET, namely arm-none-eabi and avr, but the latter only has one
> rust target
> but the intention from the existing target is to add more as needed I
> think, as the
> avr-unknown-gnu-atmega328 target is MCU specific.
> 
> But given that there are zero multilib targets present in GNU Guix as
> of now I think
> it can stay as a string.

I like rust-target better than rust-architecture.  I suppose we can look
at changing it to rust-targets later if necessary but currently rust
cross-builds aren't setup to accept a list of targets.

We can always change it later if necessary.

-- 
Efraim Flashner   <efraim@flashner.co.il>   רנשלפ םירפא
GPG key = A28B F40C 3E55 1372 662D  14F7 41AA E7DC CA3D 8351
Confidentiality cannot be guaranteed on emails sent or received unencrypted

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

^ permalink raw reply	[flat|nested] 5+ messages in thread

* [bug#67506] guix: platform: Add platform-rust-architecture.
  2023-12-11 11:58     ` bug#67506: " Efraim Flashner
@ 2023-12-11 17:32       ` Jean-Pierre De Jesus Diaz via Guix-patches via
  2023-12-11 20:53         ` Greg Hogan
  0 siblings, 1 reply; 5+ messages in thread
From: Jean-Pierre De Jesus Diaz via Guix-patches via @ 2023-12-11 17:32 UTC (permalink / raw)
  To: Efraim Flashner, Jean-Pierre De Jesus Diaz, 67506-done

>I like rust-target better than rust-architecture.  I suppose we can look
>at changing it to rust-targets later if necessary but currently rust
>cross-builds aren't setup to accept a list of targets.
>
>We can always change it later if necessary.

Agreed, should be changed later.

--
Jean-Pierre De Jesus DIAZ
Foundation Devices, Inc.




^ permalink raw reply	[flat|nested] 5+ messages in thread

* [bug#67506] guix: platform: Add platform-rust-architecture.
  2023-12-11 17:32       ` [bug#67506] " Jean-Pierre De Jesus Diaz via Guix-patches via
@ 2023-12-11 20:53         ` Greg Hogan
  0 siblings, 0 replies; 5+ messages in thread
From: Greg Hogan @ 2023-12-11 20:53 UTC (permalink / raw)
  To: Jean-Pierre De Jesus Diaz; +Cc: Efraim Flashner, 67506-done

On Mon, Dec 11, 2023 at 12:33 PM Jean-Pierre De Jesus Diaz via
Guix-patches via <guix-patches@gnu.org> wrote:
>
> >I like rust-target better than rust-architecture.  I suppose we can look
> >at changing it to rust-targets later if necessary but currently rust
> >cross-builds aren't setup to accept a list of targets.
> >
> >We can always change it later if necessary.
>
> Agreed, should be changed later.

This commit is causing a world rebuild for me back to
gcc-mesboot-4.9.4; however, CI only includes 182 packages in the
evaluation at https://ci.guix.gnu.org/eval/972727. Might it matter
that I do not have substitute servers enabled?

Greg




^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2023-12-11 20:55 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <cover.1700665986.git.efraim@flashner.co.il>
2023-11-28 10:52 ` [bug#67506] guix: platform: Add platform-rust-architecture Efraim Flashner
2023-12-01 14:39   ` Jean-Pierre De Jesus Diaz via Guix-patches via
2023-12-11 11:58     ` bug#67506: " Efraim Flashner
2023-12-11 17:32       ` [bug#67506] " Jean-Pierre De Jesus Diaz via Guix-patches via
2023-12-11 20:53         ` Greg Hogan

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/guix.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).