apple: restore sockaddr_ctl and some others on iOS #5698
@rustbot label stable-nominated
Failed on aarch64-apple-ios: https://github.com/rust-lang/libc/actions/runs/42093787137/job/127481055761?pr=5698
Maybe CI uses old toolchian.
@dtolnay .. Have you confirmed whether these APIs are not available on watchOS, tvOS, visionOS etc ?
Because almost certainly they are and this PR should be allowing all Apple platforms.
Failed on aarch64-apple-ios: https://github.com/rust-lang/libc/actions/runs/42093787137/job/127481055761?pr=5698 Maybe CI uses old toolchian.
The APIs need to be skipped / special-cased in libc-test/build/main.rs IIRC.
Let's instead do:
#[cfg_attr(not(target_os = "macos"), deprecated = "unavailable on iOS/tvOS/watchOS/visionOS")]
I agree that we should do this, it's bad that we broke nix, though only for v0.2 (can you point your PR at that branch maybe?)
Without this, all versions of nix from the past 6 years are incompatible with libc 0.2.190+ on iOS.
I fixed this in nix a few months ago (https://github.com/nix-rust/nix/pull/2821), we just need a new nix release.
cc: @SteveLauC @asomers
> Without this, all versions of nix from the past 6 years are incompatible with libc 0.2.190+ on iOS.
> I fixed this innixa few months ago (nix-rust/nix#2821), we just need a newnixrelease.
> cc: @SteveLauC @asomers
Just released 0.32.0 . I'm going to do a 0.31.4 later today, too.
I agree that we should do this, it's bad that we broke nix, though only for v0.2 (can you point your PR at that branch maybe?)
Do these actually exist? Based on the CI failures it seem like they may not, at least on sim.
Do these actually exist? Based on the CI failures it seem like they may not, at least on sim.
They don't exist in the headers (which is why I removed them originally), but they are understood by the kernel (which is why I think it's fine to re-add them as deprecated in v0.2).
As per the discussion this should just be closed.
All of Apple's products share the same core kernel. I know because I worked at Apple and have seen the code.
So either (a) make all APIs deprecated/hidden on non macOS platforms or (b) just follow what the public API says. But don't re-enable individual APIs piece by piece.
None of these decisions have a clear "should", my answer at https://github.com/rust-lang/libc/issues/5726 was moreso regarding future changes than what to do about the unintentional breakage. Since this specific case showed up in the wild I still think it is fine to land if Mads (target maintainer) is on board, which he is. I wouldn't feel the same about adding back any API that we haven't gotten an issue for in the ~2 months since that release.
Honestly I think Apple could probably improve the status quo, i.e. make the API public but label it as possible app store rejection. But that's something for upstream to deal with, C users hit the same annoyances.
As Mads mentioned, this needs a test skip update and should probably be deprecated
though only for v0.2 (can you point your PR at that branch maybe?)
I don't mind having this (and pretty much any deprecation) on main, that means future patches are more likely to apply cleanly to both branches. It will be easy to clean up everything marked #[deprecated] if we get to a cutoff point for 1.0.
Apple could probably improve the status quo
Nothing has changed in 26 years.
You guys randomly woke up one morning, decided to ignore your own policies and throw semvar out the window, remove a ton of APIs and just break everything. And now instead of making it clear for developers you're just going to add them back in one by one. What ?
Anyway good luck with all of this. I'll just stick with my fork.
madsmtm
dtolnay
Fixes rust-lang/libc#5693 and https://github.com/nix-rust/nix/pull/2821#issuecomment-6611689211.
Without this, all versions of
nixfrom the past 6 years are incompatible with libc 0.2.190+ on iOS.