GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Fails to compile for Apple targets with libc 0.2.190 · Issue #2830 · nix-rust/nix

Fails to compile for Apple targets with libc 0.2.190 #2830

New issue
Copy link
New issue
Copy link
Closed
#2821
Closed
Fails to compile for Apple targets with libc 0.2.190#2830
#2821
Copy link

Description

@xtqqczze
xtqqczze
opened on Sep 30, 2026
Issue body actions

Compilation fails for non-macOS Apple targets with libc 0.2.190.

$ cargo check -q --workspace --tests --target x86_64-apple-ios
error[E0425]: cannot find value `PT_TRACE_ME` in crate `libc`
   --> src/sys/ptrace/bsd.rs:26:9
    |
 26 |         PT_TRACE_ME,
    |         ^^^^^^^^^^^ not found in `libc`
    |
   ::: src/macros.rs:255:17
    |
255 |                 $entry = libc::$entry,
    |                 ------ due to this macro variable
    |
help: consider importing this unit variant
    |
  1 + use crate::sys::ptrace::Request::PT_TRACE_ME;
    |

error[E0425]: cannot find value `PT_READ_I` in crate `libc`
   --> src/sys/ptrace/bsd.rs:27:9
    |
 27 |         PT_READ_I,
    |         ^^^^^^^^^ not found in `libc`
    |
   ::: src/macros.rs:255:17
    |
255 |                 $entry = libc::$entry,
    |                 ------ due to this macro variable
    |
help: consider importing this unit variant
    |
  1 + use crate::sys::ptrace::Request::PT_READ_I;
    |

error[E0425]: cannot find value `PT_READ_D` in crate `libc`
   --> src/sys/ptrace/bsd.rs:28:9
    |
 28 |         PT_READ_D,
    |         ^^^^^^^^^ not found in `libc`
    |
   ::: src/macros.rs:255:17
    |
255 |                 $entry = libc::$entry,
    |                 ------ due to this macro variable
    |
help: consider importing this unit variant
    |
  1 + use crate::sys::ptrace::Request::PT_READ_D;
    |

error[E0425]: cannot find value `PT_READ_U` in crate `libc`
   --> src/sys/ptrace/bsd.rs:30:9
    |
 30 |         PT_READ_U,
    |         ^^^^^^^^^ not found in `libc`
    |
   ::: src/macros.rs:255:17
    |
255 |                 $entry = libc::$entry,
    |                 ------ due to this macro variable
    |
help: consider importing this unit variant
    |
  1 + use crate::sys::ptrace::Request::PT_READ_U;
    |

error[E0425]: cannot find value `PT_WRITE_I` in crate `libc`
   --> src/sys/ptrace/bsd.rs:31:9
    |
 31 |         PT_WRITE_I,
    |         ^^^^^^^^^^ not found in `libc`
    |
   ::: src/macros.rs:255:17
    |
255 |                 $entry = libc::$entry,
    |                 ------ due to this macro variable
    |
help: consider importing this unit variant
    |
  1 + use crate::sys::ptrace::Request::PT_WRITE_I;
    |

error[E0425]: cannot find value `PT_WRITE_D` in crate `libc`
   --> src/sys/ptrace/bsd.rs:32:9
    |
 32 |         PT_WRITE_D,
    |         ^^^^^^^^^^ not found in `libc`
    |
   ::: src/macros.rs:255:17
    |
255 |                 $entry = libc::$entry,
    |                 ------ due to this macro variable
    |
help: consider importing this unit variant
    |
  1 + use crate::sys::ptrace::Request::PT_WRITE_D;
    |

error[E0425]: cannot find value `PT_WRITE_U` in crate `libc`
   --> src/sys/ptrace/bsd.rs:34:9
    |
 34 |         PT_WRITE_U,
    |         ^^^^^^^^^^ not found in `libc`
    |
   ::: src/macros.rs:255:17
    |
255 |                 $entry = libc::$entry,
    |                 ------ due to this macro variable
    |
help: consider importing this unit variant
    |
  1 + use crate::sys::ptrace::Request::PT_WRITE_U;
    |

error[E0425]: cannot find value `PT_CONTINUE` in crate `libc`
   --> src/sys/ptrace/bsd.rs:35:9
    |
 35 |         PT_CONTINUE,
    |         ^^^^^^^^^^^ not found in `libc`
    |
   ::: src/macros.rs:255:17
    |
255 |                 $entry = libc::$entry,
    |                 ------ due to this macro variable
    |
help: consider importing this unit variant
    |
  1 + use crate::sys::ptrace::Request::PT_CONTINUE;
    |

error[E0425]: cannot find value `PT_KILL` in crate `libc`
   --> src/sys/ptrace/bsd.rs:36:9
    |
 36 |         PT_KILL,
    |         ^^^^^^^ not found in `libc`
    |
   ::: src/macros.rs:255:17
    |
255 |                 $entry = libc::$entry,
    |                 ------ due to this macro variable
    |
help: consider importing this unit variant
    |
  1 + use crate::sys::ptrace::Request::PT_KILL;
    |

error[E0425]: cannot find value `PT_STEP` in crate `libc`
   --> src/sys/ptrace/bsd.rs:41:9
    |
 41 |         PT_STEP,
    |         ^^^^^^^ not found in `libc`
    |
   ::: src/macros.rs:255:17
    |
255 |                 $entry = libc::$entry,
    |                 ------ due to this macro variable
    |
help: consider importing this unit variant
    |
  1 + use crate::sys::ptrace::Request::PT_STEP;
    |

error[E0425]: cannot find value `PT_ATTACH` in crate `libc`
   --> src/sys/ptrace/bsd.rs:42:9
    |
 42 |         PT_ATTACH,
    |         ^^^^^^^^^ not found in `libc`
    |
   ::: src/macros.rs:255:17
    |
255 |                 $entry = libc::$entry,
    |                 ------ due to this macro variable
    |
help: consider importing this unit variant
    |
  1 + use crate::sys::ptrace::Request::PT_ATTACH;
    |

error[E0425]: cannot find value `PT_DETACH` in crate `libc`
   --> src/sys/ptrace/bsd.rs:43:9
    |
 43 |         PT_DETACH,
    |         ^^^^^^^^^ not found in `libc`
    |
   ::: src/macros.rs:255:17
    |
255 |                 $entry = libc::$entry,
    |                 ------ due to this macro variable
    |
help: consider importing this unit variant
    |
  1 + use crate::sys::ptrace::Request::PT_DETACH;
    |

error[E0425]: cannot find value `PT_SIGEXC` in crate `libc`
   --> src/sys/ptrace/bsd.rs:45:9
    |
 45 |         PT_SIGEXC,
    |         ^^^^^^^^^ not found in `libc`
    |
   ::: src/macros.rs:255:17
    |
255 |                 $entry = libc::$entry,
    |                 ------ due to this macro variable
    |
help: consider importing this unit variant
    |
  1 + use crate::sys::ptrace::Request::PT_SIGEXC;
    |

error[E0425]: cannot find value `PT_THUPDATE` in crate `libc`
   --> src/sys/ptrace/bsd.rs:47:9
    |
 47 |         PT_THUPDATE,
    |         ^^^^^^^^^^^ not found in `libc`
    |
   ::: src/macros.rs:255:17
    |
255 |                 $entry = libc::$entry,
    |                 ------ due to this macro variable
    |
help: consider importing this unit variant
    |
  1 + use crate::sys::ptrace::Request::PT_THUPDATE;
    |

error[E0425]: cannot find value `PT_ATTACHEXC` in crate `libc`
   --> src/sys/ptrace/bsd.rs:49:9
    |
 49 |         PT_ATTACHEXC
    |         ^^^^^^^^^^^^ not found in `libc`
    |
   ::: src/macros.rs:231:17
    |
231 |                 $entry = libc::$entry,
    |                 ------ due to this macro variable
    |
help: consider importing this unit variant
    |
  1 + use crate::sys::ptrace::Request::PT_ATTACHEXC;
    |

error[E0425]: cannot find function `ptrace` in crate `libc`
  --> src/sys/ptrace/bsd.rs:60:29
   |
60 |         Errno::result(libc::ptrace(
   |                             ^^^^^^ not found in `libc`

error[E0425]: cannot find type `sockaddr_ctl` in crate `libc`
    --> src/sys/socket/addr.rs:1381:34
     |
1381 |     AddressFamily::System, libc::sockaddr_ctl, sctl}
     |                                  ^^^^^^^^^^^^
     |
    ::: ~/.cargo/git/checkouts/libc-6cc2a637dbcd9088/c4129f1/src/macros.rs:195:9
     |
 195 |         $pub struct $i { $($field)* }
     |         -------------- similarly named struct `sockaddr_dl` defined here
     |
help: a struct with a similar name exists
     |
1381 -     AddressFamily::System, libc::sockaddr_ctl, sctl}
1381 +     AddressFamily::System, libc::sockaddr_dl, sctl}
     |

error[E0425]: cannot find type `sockaddr_ctl` in crate `libc`
    --> src/sys/socket/addr.rs:1761:58
     |
1761 |     pub struct SysControlAddr(pub(in super::super) libc::sockaddr_ctl);
     |                                                          ^^^^^^^^^^^^
     |
    ::: ~/.cargo/git/checkouts/libc-6cc2a637dbcd9088/c4129f1/src/macros.rs:195:9
     |
 195 |         $pub struct $i { $($field)* }
     |         -------------- similarly named struct `sockaddr_dl` defined here
     |
help: a struct with a similar name exists
     |
1761 -     pub struct SysControlAddr(pub(in super::super) libc::sockaddr_ctl);
1761 +     pub struct SysControlAddr(pub(in super::super) libc::sockaddr_dl);
     |

error[E0425]: cannot find type `sockaddr_ctl` in crate `libc`
    --> src/sys/socket/addr.rs:1769:46
     |
1769 |                 if l != mem::size_of::<libc::sockaddr_ctl>() as libc::socklen_t {
     |                                              ^^^^^^^^^^^^
     |
    ::: ~/.cargo/git/checkouts/libc-6cc2a637dbcd9088/c4129f1/src/macros.rs:195:9
     |
 195 |         $pub struct $i { $($field)* }
     |         -------------- similarly named struct `sockaddr_dl` defined here
     |
help: a struct with a similar name exists
     |
1769 -                 if l != mem::size_of::<libc::sockaddr_ctl>() as libc::socklen_t {
1769 +                 if l != mem::size_of::<libc::sockaddr_dl>() as libc::socklen_t {
     |

error[E0425]: cannot find type `sockaddr_ctl` in crate `libc`
    --> src/sys/socket/addr.rs:1780:22
     |
1780 |     impl AsRef<libc::sockaddr_ctl> for SysControlAddr {
     |                      ^^^^^^^^^^^^
     |
    ::: ~/.cargo/git/checkouts/libc-6cc2a637dbcd9088/c4129f1/src/macros.rs:195:9
     |
 195 |         $pub struct $i { $($field)* }
     |         -------------- similarly named struct `sockaddr_dl` defined here
     |
help: a struct with a similar name exists
     |
1780 -     impl AsRef<libc::sockaddr_ctl> for SysControlAddr {
1780 +     impl AsRef<libc::sockaddr_dl> for SysControlAddr {
     |

error[E0425]: cannot find type `sockaddr_ctl` in crate `libc`
    --> src/sys/socket/addr.rs:1781:36
     |
1781 |         fn as_ref(&self) -> &libc::sockaddr_ctl {
     |                                    ^^^^^^^^^^^^
     |
    ::: ~/.cargo/git/checkouts/libc-6cc2a637dbcd9088/c4129f1/src/macros.rs:195:9
     |
 195 |         $pub struct $i { $($field)* }
     |         -------------- similarly named struct `sockaddr_dl` defined here
     |
help: a struct with a similar name exists
     |
1781 -         fn as_ref(&self) -> &libc::sockaddr_ctl {
1781 +         fn as_ref(&self) -> &libc::sockaddr_dl {
     |

error[E0422]: cannot find struct, variant or union type `sockaddr_ctl` in crate `libc`
    --> src/sys/socket/addr.rs:1790:30
     |
1790 |             let addr = libc::sockaddr_ctl {
     |                              ^^^^^^^^^^^^
     |
    ::: ~/.cargo/git/checkouts/libc-6cc2a637dbcd9088/c4129f1/src/macros.rs:195:9
     |
 195 |         $pub struct $i { $($field)* }
     |         -------------- similarly named struct `sockaddr_dl` defined here
     |
help: a struct with a similar name exists
     |
1790 -             let addr = libc::sockaddr_ctl {
1790 +             let addr = libc::sockaddr_dl {
     |

error[E0425]: cannot find type `sockaddr_ctl` in crate `libc`
    --> src/sys/socket/addr.rs:1791:46
     |
1791 |                 sc_len: mem::size_of::<libc::sockaddr_ctl>() as c_uchar,
     |                                              ^^^^^^^^^^^^
     |
    ::: ~/.cargo/git/checkouts/libc-6cc2a637dbcd9088/c4129f1/src/macros.rs:195:9
     |
 195 |         $pub struct $i { $($field)* }
     |         -------------- similarly named struct `sockaddr_dl` defined here
     |
help: a struct with a similar name exists
     |
1791 -                 sc_len: mem::size_of::<libc::sockaddr_ctl>() as c_uchar,
1791 +                 sc_len: mem::size_of::<libc::sockaddr_dl>() as c_uchar,
     |

error[E0425]: cannot find value `AF_SYS_CONTROL` in crate `libc`
    --> src/sys/socket/addr.rs:1793:35
     |
1793 |                 ss_sysaddr: libc::AF_SYS_CONTROL as u16,
     |                                   ^^^^^^^^^^^^^^ not found in `libc`

error[E0425]: cannot find value `SYSPROTO_CONTROL` in crate `libc`
    --> src/sys/socket/sockopt.rs:1306:11
     |
1306 |     libc::SYSPROTO_CONTROL,
     |           ^^^^^^^^^^^^^^^^ not found in `libc`

error[E0425]: cannot find value `UTUN_OPT_IFNAME` in crate `libc`
    --> src/sys/socket/sockopt.rs:1307:11
     |
1307 |     libc::UTUN_OPT_IFNAME,
     |           ^^^^^^^^^^^^^^^ not found in `libc`

error[E0425]: cannot find value `SYSPROTO_CONTROL` in crate `libc`
   --> src/sys/socket/mod.rs:141:25
    |
141 |     KextControl = libc::SYSPROTO_CONTROL,
    |                         ^^^^^^^^^^^^^^^^ not found in `libc`

Some errors have detailed explanations: E0422, E0425.
For more information about an error, try `rustc --explain E0422`.
error: could not compile `nix` (lib) due to 27 previous errors

Activity

  1. xtqqczze
    changed the title [-]Tests fail to compile with libc 0.2.190[/-] [+]Tests fail to compile with libc 0.2.190 on Apple targets[/+] on Sep 30, 2026
  2. xtqqczze
    changed the title [-]Tests fail to compile with libc 0.2.190 on Apple targets[/-] [+]Tests fail to compile for Apple targets with libc 0.2.190[/+] on Sep 30, 2026
  3. ethernomad commented on Oct 9, 2026

    @ethernomad
    ethernomad
    on Oct 9, 2026
    More actions

    Confirming this is not tests-only: the same mismatch also breaks the nix library build (no --tests) for aarch64-apple-ios / aarch64-apple-ios-sim in an ordinary dependency graph.

    With nix 0.31.3 + libc 0.2.190, a crate that depends on nix with its default socket / net features fails to compile for the iOS target at exactly the two library sites:

    • src/sys/socket/mod.rs:141 — KextControl = libc::SYSPROTO_CONTROL, gated only by #[cfg(apple_targets)] (no feature gate; so feature = "socket" alone reaches it)
    • src/sys/socket/sockopt.rs:1290 — UtunIfname, gated #[cfg(apple_targets)] #[cfg(feature = "net")], referencing libc::UTUN_OPT_IFNAME

    Root cause is the same one described above: libc 0.2.190 moved SYSPROTO_CONTROL, SYSPROTO_EVENT, AF_SYS_CONTROL, UTUN_OPT_FLAGS/UTUN_OPT_IFNAME, and sockaddr_ctl behind #[cfg(target_os = "macos")] (they were previously defined for every Apple target), while nix's apple_targets cfg — any(ios, macos, watchos, tvos, visionos) per build.rs — still names them for all Apple targets.

    Impact: any downstream that pulls nix's socket/net features can no longer build for iOS, independent of the test suite. Our workaround is pinning libc to 0.2.189; the fix is to gate KextControl / UtunIfname (and the other apple_targets users of these constants) on target_os = "macos", or to reinstate the constants in libc for iOS, whichever matches the actual platform headers.

  4. ethernomad
    added a commit that references this issue on Oct 9, 2026

    ci: hold libc at 0.2.189 to unbreak the iOS build job

    6be5747
  5. xtqqczze
    changed the title [-]Tests fail to compile for Apple targets with libc 0.2.190[/-] [+]Fails to compile for Apple targets with libc 0.2.190[/+] on Oct 9, 2026
  6. asomers
    closed this as completedin #2821on Oct 14, 2026
  7. IlleNilsson
    added 2 commits that reference this issue on Oct 14, 2026

    The phone build links no nix: the runtime remote build only connects …

    a61a0e1

    The phone build links no nix: the runtime remote build only connects …

    f34e52f
  8. tuco86
    added a commit that references this issue on Nov 4, 2026

    Bind weida for Swift and iOS through an XCFramework of static libweida

    62b5893
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions

      You are visitor 01402520 — GeezerVison does not store the pages you look up.
      Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.