Source: rust-coreutils
Version: 0.0.23-2
Severity: wishlist
Tags: patch ftbfs
User: debian-loonga...@lists.debian.org
Usertags: loong64

Dear maintainers,

Compiling the rust-coreutils failed for loong64 in the my local loong64 environment.
The error messages are as follows,
```
......
Compiling uu_stdbuf v0.0.23 (/home/build/rust-coreutils-0.0.23/src/uu/stdbuf)
error[E0308]: mismatched types
   --> src/uucore/src/lib/features/fs.rs:124:16
    |
111 |     pub fn number_of_links(&self) -> u64 {
    |                                      --- expected `u64` because of return type
...
124 |         return self.0.st_nlink;
    |                ^^^^^^^^^^^^^^^ expected `u64`, found `u32`
    |
help: you can convert a `u32` to a `u64`
    |
124 |         return self.0.st_nlink.into();
    |                               +++++++

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

I have added loongarch64 support for rust-coreutils.
The rust-coreutils source package was compiled successfully on my local loong64 rootfs environment.
Please consider the patch I have attached.
Your opinions are welcome.

thanks,
Dandan Zhang

Description: Add loongarch64 support 
Last-Update: 2023-12-22

--- rust-coreutils-0.0.23.orig/docs/compiles_table.py
+++ rust-coreutils-0.0.23/docs/compiles_table.py
@@ -18,6 +18,7 @@ TARGETS = [
     # Linux - GNU
     "aarch64-unknown-linux-gnu",
     "i686-unknown-linux-gnu",
+    "loongarch64-unknown-linux-gnu",
     "powerpc64-unknown-linux-gnu",
     "riscv64gc-unknown-linux-gnu",
     "x86_64-unknown-linux-gnu",
--- rust-coreutils-0.0.23.orig/src/uucore/src/lib/features/fs.rs
+++ rust-coreutils-0.0.23/src/uucore/src/lib/features/fs.rs
@@ -119,6 +119,7 @@ impl FileInformation {
             not(target_os = "solaris"),
             not(target_arch = "aarch64"),
             not(target_arch = "riscv64"),
+            not(target_arch = "loongarch64"),
             target_pointer_width = "64"
         ))]
         return self.0.st_nlink;
@@ -133,6 +134,7 @@ impl FileInformation {
                 target_os = "solaris",
                 target_arch = "aarch64",
                 target_arch = "riscv64",
+                target_arch = "loongarch64",
                 not(target_pointer_width = "64")
             )
         ))]

Reply via email to