Hacktoberfest 2026:メンテナが10月に向けて印を付けた、オープンで初心者向けの issue。 Hacktoberfest の issue を見る

Build fails for aarch64-alpine-linux-musl

オープン
#341 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

メンテナーはふだん 1 日以内に返信

まだ誰も着手していません。

評価

難易度
4/5
見積もり時間
3〜5日
初心者へのやさしさ
38/100
issue の種類
バグ
明瞭さ
おおむね明確
活発さ
停滞
技術スタック
rust

調査の方向性

aarch64-alpine-linux-musl ターゲットに対して cargo build --release を実行し、src/uu/lsipc/src/semaphore.rs、message_queue.rs、shared_memory.rs で報告されたエラーから着手してください。また、src/uu/blockdev/src/blockdev.rs と src/uu/fsfreeze/src/fsfreeze.rs の ioctl 呼び出し箇所も調査してください。報告された musl 関連のコンパイルエラーが解消され、release ビルドが成功すれば完了です。

索引モデルが issue の本文から書いたものです。

説明

Running cargo build --release on the tree results in:

error[E0412]: cannot find type `semid_ds` in crate `libc`
  --> src/uu/lsipc/src/semaphore.rs:27:72
   |
27 |   fn semctl(id: c_int, index: c_int, cmd: c_int) -> Result<(c_int, libc::semid_ds), LsIpcError> {
   |                                                                          ^^^^^^^^ help: a struct with a similar name exists: `shmid_ds`
   |
  ::: /home/user/Devel/distrobox/alpine/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/libc-0.2.174/src/unix/linux_like/linux/musl/b64/mod.rs:5:1
   |
5  | / s! {
6  | |     pub struct stack_t {
7  | |         pub ss_sp: *mut c_void,
8  | |         pub ss_flags: c_int,
...  |
78 | | }
   | |_- similarly named struct `shmid_ds` defined here

error[E0412]: cannot find type `semid_ds` in crate `libc`
  --> src/uu/lsipc/src/semaphore.rs:28:25
   |
28 |       let mut stat: libc::semid_ds;
   |                           ^^^^^^^^ help: a struct with a similar name exists: `shmid_ds`
   |
  ::: /home/user/Devel/distrobox/alpine/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/libc-0.2.174/src/unix/linux_like/linux/musl/b64/mod.rs:5:1
   |
5  | / s! {
6  | |     pub struct stack_t {
7  | |         pub ss_sp: *mut c_void,
8  | |         pub ss_flags: c_int,
...  |
78 | | }
   | |_- similarly named struct `shmid_ds` defined here

error[E0412]: cannot find type `semid_ds` in crate `libc`
  --> src/uu/lsipc/src/semaphore.rs:75:58
   |
75 |           let sem_info = unsafe { &*(&stat as *const libc::semid_ds).cast::<libc::seminfo>() };
   |                                                            ^^^^^^^^ help: a struct with a similar name exists: `shmid_ds`
   |
  ::: /home/user/Devel/distrobox/alpine/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/libc-0.2.174/src/unix/linux_like/linux/musl/b64/mod.rs:5:1
   |
5  | / s! {
6  | |     pub struct stack_t {
7  | |         pub ss_sp: *mut c_void,
8  | |         pub ss_flags: c_int,
...  |
78 | | }
   | |_- similarly named struct `shmid_ds` defined here

error[E0412]: cannot find type `seminfo` in crate `libc`
   --> src/uu/lsipc/src/semaphore.rs:75:81
    |
75  |           let sem_info = unsafe { &*(&stat as *const libc::semid_ds).cast::<libc::seminfo>() };
    |                                                                                   ^^^^^^^ help: a struct with a similar name exists: `sysinfo`
    |
   ::: /home/user/Devel/distrobox/alpine/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/libc-0.2.174/src/unix/linux_like/linux/musl/mod.rs:417:1
    |
417 | / s_no_extra_traits! {
418 | |     pub struct sysinfo {
419 | |         pub uptime: c_ulong,
420 | |         pub loads: [c_ulong; 3],
...   |
468 | | }
    | |_- similarly named struct `sysinfo` defined here

error[E0412]: cannot find type `semid_ds` in crate `libc`
   --> src/uu/lsipc/src/semaphore.rs:173:22
    |
173 |           stat: &libc::semid_ds,
    |                        ^^^^^^^^ help: a struct with a similar name exists: `shmid_ds`
    |
   ::: /home/user/Devel/distrobox/alpine/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/libc-0.2.174/src/unix/linux_like/linux/musl/b64/mod.rs:5:1
    |
5   | / s! {
6   | |     pub struct stack_t {
7   | |         pub ss_sp: *mut c_void,
8   | |         pub ss_flags: c_int,
...   |
78  | | }
    | |_- similarly named struct `shmid_ds` defined here

warning: use of deprecated type alias `libc::time_t`: This type is changed to 64-bit in musl 1.2.0, we'll follow that change in the future release. See #1848 for more info.
   --> src/uu/lsipc/src/display.rs:115:17
    |
115 |     time: libc::time_t,
    |                 ^^^^^^
    |
    = note: `#[warn(deprecated)]` on by default

warning: use of deprecated type alias `libc::time_t`: This type is changed to 64-bit in musl 1.2.0, we'll follow that change in the future release. See #1848 for more info.
  --> src/uu/lsipc/src/message_queue.rs:87:18
   |
87 |     stime: libc::time_t,
   |                  ^^^^^^

warning: use of deprecated type alias `libc::time_t`: This type is changed to 64-bit in musl 1.2.0, we'll follow that change in the future release. See #1848 for more info.
  --> src/uu/lsipc/src/message_queue.rs:88:18
   |
88 |     rtime: libc::time_t,
   |                  ^^^^^^

warning: use of deprecated type alias `libc::time_t`: This type is changed to 64-bit in musl 1.2.0, we'll follow that change in the future release. See #1848 for more info.
  --> src/uu/lsipc/src/message_queue.rs:89:18
   |
89 |     ctime: libc::time_t,
   |                  ^^^^^^

warning: use of deprecated type alias `libc::time_t`: This type is changed to 64-bit in musl 1.2.0, we'll follow that change in the future release. See #1848 for more info.
   --> src/uu/lsipc/src/semaphore.rs:165:18
    |
165 |     otime: libc::time_t,
    |                  ^^^^^^

warning: use of deprecated type alias `libc::time_t`: This type is changed to 64-bit in musl 1.2.0, we'll follow that change in the future release. See #1848 for more info.
   --> src/uu/lsipc/src/semaphore.rs:166:18
    |
166 |     ctime: libc::time_t,
    |                  ^^^^^^

warning: use of deprecated type alias `libc::time_t`: This type is changed to 64-bit in musl 1.2.0, we'll follow that change in the future release. See #1848 for more info.
   --> src/uu/lsipc/src/shared_memory.rs:107:18
    |
107 |     atime: libc::time_t,
    |                  ^^^^^^

warning: use of deprecated type alias `libc::time_t`: This type is changed to 64-bit in musl 1.2.0, we'll follow that change in the future release. See #1848 for more info.
   --> src/uu/lsipc/src/shared_memory.rs:108:18
    |
108 |     dtime: libc::time_t,
    |                  ^^^^^^

warning: use of deprecated type alias `libc::time_t`: This type is changed to 64-bit in musl 1.2.0, we'll follow that change in the future release. See #1848 for more info.
   --> src/uu/lsipc/src/shared_memory.rs:109:18
    |
109 |     ctime: libc::time_t,
    |                  ^^^^^^

warning: use of deprecated type alias `libc::time_t`: This type is changed to 64-bit in musl 1.2.0, we'll follow that change in the future release. See #1848 for more info.
  --> src/uu/lsipc/src/utils.rs:40:38
   |
40 | pub(crate) fn local_time(time: libc::time_t) -> Result<libc::tm, LsIpcError> {
   |                                      ^^^^^^

   Compiling uu_uuidgen v0.0.1 (/run/host/home/user/Devel/pmOS/util-linux/src/uu/uuidgen)
   Compiling phf v0.12.1
error[E0609]: no field `__key` on type `ipc_perm`
  --> src/uu/lsipc/src/message_queue.rs:95:32
   |
95 |             key: stat.msg_perm.__key,
   |                                ^^^^^ unknown field
   |
   = note: available fields are: `__ipc_perm_key`, `uid`, `gid`, `cuid`, `cgid` ... and 2 others

   Compiling uu_blockdev v0.0.1 (/run/host/home/user/Devel/pmOS/util-linux/src/uu/blockdev)
error[E0609]: no field `__key` on type `ipc_perm`
   --> src/uu/lsipc/src/shared_memory.rs:115:32
    |
115 |             key: stat.shm_perm.__key,
    |                                ^^^^^ unknown field
    |
    = note: available fields are: `__ipc_perm_key`, `uid`, `gid`, `cuid`, `cgid` ... and 2 others

error[E0277]: the trait bound `i32: From<u32>` is not satisfied
   --> src/uu/blockdev/src/blockdev.rs:202:60
    |
202 |         if libc::ioctl(device_file.as_raw_fd(), ioctl_code.into(), input) < 0 {
    |                                                            ^^^^ the trait `From<u32>` is not implemented for `i32`
    |
    = help: the following other types implement trait `From<T>`:
              `i32` implements `From<&fluent_bundle::types::number::FluentNumber>`
              `i32` implements `From<bool>`
              `i32` implements `From<deranged::RangedI32<MIN, MAX>>`
              `i32` implements `From<dns_lookup::types::AddrFamily>`
              `i32` implements `From<dns_lookup::types::Protocol>`
              `i32` implements `From<dns_lookup::types::SockType>`
              `i32` implements `From<fluent_bundle::types::number::FluentNumber>`
              `i32` implements `From<i16>`
            and 8 others
    = note: required for `u32` to implement `Into<i32>`

   Compiling uu_fsfreeze v0.0.1 (/run/host/home/user/Devel/pmOS/util-linux/src/uu/fsfreeze)
For more information about this error, try `rustc --explain E0277`.
error: could not compile `uu_blockdev` (lib) due to 1 previous error
warning: build failed, waiting for other jobs to finish...
error[E0277]: the trait bound `i32: From<u32>` is not satisfied
  --> src/uu/fsfreeze/src/fsfreeze.rs:33:55
   |
33 |     if unsafe { libc::ioctl(file.as_raw_fd(), op_code.into(), 0) } < 0 {
   |                                                       ^^^^ the trait `From<u32>` is not implemented for `i32`
   |
   = help: the following other types implement trait `From<T>`:
             `i32` implements `From<&fluent_bundle::types::number::FluentNumber>`
             `i32` implements `From<bool>`
             `i32` implements `From<deranged::RangedI32<MIN, MAX>>`
             `i32` implements `From<dns_lookup::types::AddrFamily>`
             `i32` implements `From<dns_lookup::types::Protocol>`
             `i32` implements `From<dns_lookup::types::SockType>`
             `i32` implements `From<fluent_bundle::types::number::FluentNumber>`
             `i32` implements `From<i16>`
           and 8 others
   = note: required for `u32` to implement `Into<i32>`

error: could not compile `uu_fsfreeze` (lib) due to 1 previous error
Some errors have detailed explanations: E0412, E0609.
For more information about an error, try `rustc --explain E0412`.
warning: `uu_lsipc` (lib) generated 10 warnings
error: could not compile `uu_lsipc` (lib) due to 7 previous errors; 10 warnings emitted

It looks like most of these are differences between glibc and musl breaking the code through the libc crate.

主要言語
Rust
スター
221
フォーク
60
平均マージ
3日 1時間
マージ済み PR(30日)
9

環境構築

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

uutils/util-linux のほかの issue

uutils/util-linux の issue をすべて見る

似ている issue

Rust の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。