Source: rust-uucore
Version: 0.0.23-3
Severity: normal
Tags: patch
User: debian-loonga...@lists.debian.org
Usertags: loong64

Hi maintainers,

The rust-uucore package was built on loong64.
But I found that there is a lack of loong64 support in src/lib/features/fs.rs file.

If the support for loong64 is missing in rust-uucore source package, packages that depend on librust-uucore-dev:loong64 will fail to build, for example, Compiling the rust-findutils 0.7.0-3 failed for loong64 in the Debian Package Auto-Building environment.
Build failed 5 times.
The build error log is as follows,
```
error[E0308]: mismatched types
   --> /usr/share/cargo/registry/uucore-0.0.23/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();
    |                               +++++++
...
```
The full build log can be found at https://buildd.debian.org/status/fetch.php?pkg=rust-findutils&arch=loong64&ver=0.7.0-3&stamp=1740507372&raw=0.

Please consider the patch I attached for rust-uucore source package.
I have built rust-uucore 0.0.23-3+loong64 package successfully on my local ENV.
```
   dh_builddeb -O--buildsystem=cargo
dpkg-deb: building package 'librust-uucore-dev' in '../librust-uucore-dev_0.0.23-3+loong64_loong64.deb'.
 dpkg-genbuildinfo -O../rust-uucore_0.0.23-3+loong64_loong64.buildinfo
 dpkg-genchanges -O../rust-uucore_0.0.23-3+loong64_loong64.changes
```
And based on librust-uucore-dev_0.0.23-3+loong64, I have built rust-findutils successfully on my local ENV.
Could you add loong64 support in the next upload?

Best regrads,
Dandan Zhang
Description: Add loongarch64 support 
 .
 rust-uucore (0.0.23-3+loong64) unstable; urgency=medium
 .
   * Add loongarch64 support.
Author: Dandan Zhang <zhangdan...@loongson.cn>

---
Last-Update: 2025-02-26

--- rust-uucore-0.0.23.orig/src/lib/features/fs.rs
+++ rust-uucore-0.0.23/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