Buildroot Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [Buildroot] [PATCH 1/1] package/nushell: fix sparc64 build
@ 2024-01-06 13:39 Fabrice Fontaine
  2024-01-10 21:08 ` Thomas Petazzoni via buildroot
  2024-01-13 20:11 ` Peter Korsgaard
  0 siblings, 2 replies; 3+ messages in thread
From: Fabrice Fontaine @ 2024-01-06 13:39 UTC (permalink / raw)
  To: buildroot; +Cc: Sebastian Weyer, Fabrice Fontaine

Fix the following build failure on sparc64 raised since bump to version
0.85 in commit 470f0fb1ec0bd2ba03340f2aea34891ca8d7739d:

error[E0308]: mismatched types
   --> /home/autobuild/autobuild/instance-7/output-1/build/nushell-0.85.0/VENDOR/uucore/src/lib/features/fs.rs:121:16
    |
111 |     pub fn number_of_links(&self) -> u64 {
    |                                      --- expected `u64` because of return type
...
121 |         return self.0.st_nlink;
    |                ^^^^^^^^^^^^^^^ expected `u64`, found `u32`
    |
help: you can convert a `u32` to a `u64`
    |
121 |         return self.0.st_nlink.into();
    |                               +++++++

For more information about this error, try `rustc --explain E0308`.
error: could not compile `uucore` (lib) due to previous error

Fixes:
 - http://autobuild.buildroot.org/results/f9f0287a8e39c65895014ca513ed25071f020add

Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
---
 .../0001-uucore-add-support-for-sparc64.patch | 57 +++++++++++++++++++
 package/nushell/nushell.mk                    |  7 +++
 2 files changed, 64 insertions(+)
 create mode 100644 package/nushell/0001-uucore-add-support-for-sparc64.patch

diff --git a/package/nushell/0001-uucore-add-support-for-sparc64.patch b/package/nushell/0001-uucore-add-support-for-sparc64.patch
new file mode 100644
index 0000000000..2cc05c172e
--- /dev/null
+++ b/package/nushell/0001-uucore-add-support-for-sparc64.patch
@@ -0,0 +1,57 @@
+From 9f4330f94cc471d880df7d9089ee1105b27fd321 Mon Sep 17 00:00:00 2001
+From: Fabrice Fontaine <fontaine.fabrice@gmail.com>
+Date: Sat, 6 Jan 2024 10:26:54 +0100
+Subject: [PATCH] uucore: add support for sparc64
+
+Add support for sparc64 in uucore to avoid the following build failure
+with nushell:
+
+error[E0308]: mismatched types
+   --> /home/autobuild/autobuild/instance-7/output-1/build/nushell-0.85.0/VENDOR/uucore/src/lib/features/fs.rs:121:16
+    |
+111 |     pub fn number_of_links(&self) -> u64 {
+    |                                      --- expected `u64` because of return type
+...
+121 |         return self.0.st_nlink;
+    |                ^^^^^^^^^^^^^^^ expected `u64`, found `u32`
+    |
+help: you can convert a `u32` to a `u64`
+    |
+121 |         return self.0.st_nlink.into();
+    |                               +++++++
+
+For more information about this error, try `rustc --explain E0308`.
+error: could not compile `uucore` (lib) due to previous error
+
+Fixes:
+ - http://autobuild.buildroot.org/results/f9f0287a8e39c65895014ca513ed25071f020add
+
+Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
+Upstream: https://github.com/uutils/coreutils/commit/d158f1a396d19cc2aed68131b80ec3b7325d108e
+---
+ src/uucore/src/lib/features/fs.rs | 2 ++
+ 1 file changed, 2 insertions(+)
+
+diff --git a/VENDOR/uucore/src/lib/features/fs.rs b/VENDOR/uucore/src/lib/features/fs.rs
+index 20cc9e13d..3b9170bc3 100644
+--- a/VENDOR/uucore/src/lib/features/fs.rs
++++ b/VENDOR/uucore/src/lib/features/fs.rs
+@@ -121,6 +121,7 @@ impl FileInformation {
+             not(target_os = "solaris"),
+             not(target_arch = "aarch64"),
+             not(target_arch = "riscv64"),
++            not(target_arch = "sparc64"),
+             target_pointer_width = "64"
+         ))]
+         return self.0.st_nlink;
+@@ -137,6 +138,7 @@ impl FileInformation {
+                 target_os = "solaris",
+                 target_arch = "aarch64",
+                 target_arch = "riscv64",
++                target_arch = "sparc64",
+                 not(target_pointer_width = "64")
+             )
+         ))]
+-- 
+2.43.0
+
diff --git a/package/nushell/nushell.mk b/package/nushell/nushell.mk
index 779a3c4393..7b538da4e2 100644
--- a/package/nushell/nushell.mk
+++ b/package/nushell/nushell.mk
@@ -10,6 +10,13 @@ NUSHELL_LICENSE = MIT
 NUSHELL_LICENSE_FILES = LICENSE
 NUSHELL_DEPENDENCIES = host-pkgconf openssl ncurses
 
+# 0001-uucore-add-support-for-sparc64.patch
+define NUSHELL_PATCH_CHECKSUM_FILE
+	$(SED) 's/b0390ae7bca8b31f0db289a5d064bba36d45e4d137674e9df2c6ab6256f926f4/f8ce2ad571e1482f6833cb147eafeb724776e7887ebabf339a5f3e79860583cb/' \
+		$(@D)/VENDOR/uucore/.cargo-checksum.json
+endef
+NUSHELL_POST_PATCH_HOOKS += NUSHELL_PATCH_CHECKSUM_FILE
+
 # Add /usr/bin/nu to /etc/shells as in package/bash/bash.mk
 define NUSHELL_ADD_NU_TO_SHELLS
 	grep -qsE '^/usr/bin/nu$$' $(TARGET_DIR)/etc/shells \
-- 
2.43.0

_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

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

end of thread, other threads:[~2024-01-13 20:11 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-01-06 13:39 [Buildroot] [PATCH 1/1] package/nushell: fix sparc64 build Fabrice Fontaine
2024-01-10 21:08 ` Thomas Petazzoni via buildroot
2024-01-13 20:11 ` Peter Korsgaard

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox