fails to build on armhf, i386 and ppc64el
The [debian package of nix](https://tracker.debian.org/pkg/nix) uses nix-du as a test object. However nix-du fails to build on some architectures. See for example the build log of the nix package for the i386 architecture: [log.gz](https://github.com/symphorien/nix-du/files/7984932/log.gz).
The relevant part of the build log is:
```
thread 'bindings::bindgen_test_layout_path_t' panicked at 'assertion failed: `(left == right)`
left: `16`,
right: `24`: Size of: path_t', src/bindings.rs:17:5
```
There are also warnings that might be worth looking at:
```
warning: dereferencing a null pointer
--> src/bindings.rs:28:19
|
28 | unsafe { &(*(::std::ptr::null::<path_t>())).path as *const _ as usize },
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ this code causes undefined behavior when executed
|
= note: `#[warn(deref_nullptr)]` on by default
warning: dereferencing a null pointer
--> src/bindings.rs:38:19
|
38 | unsafe { &(*(::std::ptr::null::<path_t>())).size as *const _ as usize },
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ this code causes undefined behavior when executed
warning: dereferencing a null pointer
--> src/bindings.rs:48:19
|
48 | unsafe { &(*(::std::ptr::null::<path_t>())).is_root as *const _ as usize },
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ this code causes undefined behavior when executed
```
I've no idea about rust, but since the src/bindings.rs file is autogenerated, maybe the build of your package should regenerate this file for each build instead of having it committed to Git?
Feel free to ignore this issue if you're not interested in the above architectures. I'll just disable this test in the nix package for the above architectures for the moment.
关闭于 2023-10-20 5 条评论