Bug#1068081: rust-dns-lookup: "lookup::test_rev_localhost' panicked at 'assertion failed" on loong64

2024-04-03 Thread John Paul Adrian Glaubitz
Hi Dandan,

please report this bug upstream as it's not Debian-specific.

The upstream bug tracker can be found in [1].

Adrian

> [1] https://github.com/keeperofdakeys/dns-lookup/issues

-- 
 .''`.  John Paul Adrian Glaubitz
: :' :  Debian Developer
`. `'   Physicist
  `-GPG: 62FF 8A75 84E0 2956 9546  0006 7426 3B37 F5B5 F913



Bug#1068081: rust-dns-lookup: "lookup::test_rev_localhost' panicked at 'assertion failed" on loong64

2024-03-30 Thread zhangdandan

Source: rust-dns-lookup
Version: 1.0.8-4
Severity: wishlist
Tags: ftbfs
User: debian-loonga...@lists.debian.org
Usertags: loong64

Dear maintainers,

Compiling the rust-dns-lookup package failed for loong64 in the Debian 
Package Auto-Building environment, the error log is as follows:

```
test lookup::test_rev_localhost ... FAILED
failures:

 lookup::test_rev_localhost stdout 
thread 'lookup::test_rev_localhost' panicked at 'assertion failed: 
`(left == right)`

  left: `"loong64-loongson-03.local"`,
 right: `"localhost"`', src/lookup.rs:77:3
```

The full build log can be found at 
https://buildd.debian.org/status/logs.php?pkg=rust-dns-lookup=1.0.8-4=loong64.


After analysis, I think the maintainer may need to improve the 
test_rev_localhost() test case in the 
rust-dns-lookup-1.0.8/src/lookup.rs file.

The reasons are as follows:
1. If the first line of the /etc/hosts file is "127.0.0.1 localhost", 
the test case is successful.

```
# cat /etc/hosts
127.0.0.1   localhost
127.0.0.1   loong64-loongson-03.local loong64-loongson-03
```
Based on the above configure in /etc/hosts, the rust-dns-lookup package 
was compiled successfully on my local loong64 rootfs environment.


2. On the contrary, if the first line's content of the /etc/hosts file 
is not "127.0.0.1 localhost", the test case fails.
Even if the /etc/hosts file contains "127.0.0.1 localhost" in other 
lines except the first line, the test case fails.

```
# cat /etc/hosts
127.0.0.1   loong64-loongson-03.local loong64-loongson-03
127.0.0.1   localhost
```

Alternatively, we could set the first line of the '/etc/hosts' file to 
'127.0.0.1 localhost' on the loong64 buildd machines.

Your opinions are welcome.
If you have any questions, you can contact me at any time.

Thanks,
Dandan Zhang