-
Notifications
You must be signed in to change notification settings - Fork 12.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Use target_vendor = "apple"
instead of target_os = "..."
#124491
Conversation
Both `sysconf` and `_SC_NPROCESSORS_ONLN` is available on all Apple platforms.
Some changes occurred in src/tools/compiletest cc @jieyouxu |
`man posix_spawn` documents it to be able to return `ENOENT`, and there should be nothing preventing this. Tested in the iOS simulator and on Mac Catalyst.
Is |
It isn't yet, I linked the tracking issue in the PR description, it's here, we expect an alternative like |
...honestly I had a suspicion that this might uncover some bugs but this is impressive. |
@madsmtm So, I can r+ this without knowing the answer to this question, but for full transparency: Do the Rust stdlib tests pass on the simulators? Are there any current gaps? It would be good to know what the "current situation" seems to be. |
It is quite difficult to run a test suite on the simulators, and I'm not experienced enough in Rust's bootstrapping setup to tell you exactly how to do it for this repo (though @simlay probably has some more or less cursed solution using Dinghy), so I'll admit I don't know the answer to your question. But I'll try to run the test suite under Mac Catalyst, that might reveal some issues. |
Ah, I had mostly asked because you had mentioned running some tests in the last commit! I'm happy with that answer, at the moment, and any fixes can be addressed as followups. @bors r+ |
Yeah, it seems both are basically just stack pointers, and the rest of the implementation is calls into compiler intrinsics so it is unlikely there is anything that libstd changes can do to make this more or less incorrect. |
I see. Does our va_list type match the declaration in C too? I guess I could check this... |
The advantage of merging the libstd changes is that it makes it much easier to test if these implementations are incorrect. :^) |
💔 Test failed - checks-actions |
Modifying ./x test --target=aarch64-apple-ios-macabi library/std
./x test --target=aarch64-apple-ios-macabi --no-fail-fast --skip=tests/rustdoc-js --skip=tests/rustdoc-js-std --skip=tests/debuginfo tests Produces errors in the following tests:
Both before and after this PR. I suspect the stack probing, environment and argv0 to be real issues, and the rest to be under-specified tests that were only tweaked for macOS and not Apple in general. Will likely fix this in another PR at some point. |
Seems to me like the Also, I think CI failed because it was cancelled, or something? Can't really tell from the logs :/ |
It looks like we do in fact use the right one for the appleOS platforms: rust/library/core/src/ffi/mod.rs Lines 207 to 235 in f705de5
Yeah I think it was just a timeout. @bors retry |
☀️ Test successful - checks-actions |
Finished benchmarking commit (2e88e9e): comparison URL. Overall result: ✅ improvements - no action needed@rustbot label: -perf-regression Instruction countThis is a highly reliable metric that was used to determine the overall result at the top of this comment.
Max RSS (memory usage)This benchmark run did not return any relevant results for this metric. CyclesThis benchmark run did not return any relevant results for this metric. Binary sizeThis benchmark run did not return any relevant results for this metric. Bootstrap: 672.879s -> 672.43s (-0.07%) |
…Mark-Simulacrum Fix unwinding on 32-bit watchOS ARM Found while doing rust-lang#124491, I wanted to unify the code under `target_vendor = "apple"`, and found that [Clang actually specifies that watchOS ARM 32-bit does not use SjLj](https://github.com/llvm/llvm-project/blob/llvmorg-18.1.4/clang/lib/Driver/ToolChains/Darwin.cpp#L3107-L3119). I don't have an Apple Watch from that generation at hand to test this myself (series 1 to 3), and I don't think it will be sufficient to test it in the simulator (as it's architecture-specific), so maybe someone else could do so? N.B. The code is written in a way to support 32-bit iOS and tvOS ARM devices (which do use SjLj) for future compatibility even though we currently only have a target for 32-bit iOS ARM (if you think that's excessive, then I'll change it). CC target maintainers `@deg4uss3r,` `@vladimir-ea,` `@leohowell.` CC `@simlay,` `@thomcc` whom might have more insight into this than I. `@rustbot` label O-watchos
…r=Mark-Simulacrum Fix unwinding on 32-bit watchOS ARM (v2) This PR is identical to rust-lang#124494, which was approved and merged but then removed from master by a force-push due to a [CI bug](https://rust-lang.zulipchat.com/#narrow/stream/242791-t-infra/topic/ci.20broken.3F). r? Mark-Simulacrum Original PR description: --- Found while doing rust-lang#124491, I wanted to unify the code under `target_vendor = "apple"`, and found that [Clang actually specifies that watchOS ARM 32-bit does not use SjLj](https://github.com/llvm/llvm-project/blob/llvmorg-18.1.4/clang/lib/Driver/ToolChains/Darwin.cpp#L3107-L3119). I don't have an Apple Watch from that generation at hand to test this myself (series 1 to 3), and I don't think it will be sufficient to test it in the simulator (as it's architecture-specific), so maybe someone else could do so? N.B. The code is written in a way to support 32-bit iOS and tvOS ARM devices (which do use SjLj) for future compatibility even though we currently only have a target for 32-bit iOS ARM (if you think that's excessive, then I'll change it). `@rustbot` label O-watchos
Rollup merge of rust-lang#124748 - madsmtm:fix-32bit-watchos-unwind, r=Mark-Simulacrum Fix unwinding on 32-bit watchOS ARM (v2) This PR is identical to rust-lang#124494, which was approved and merged but then removed from master by a force-push due to a [CI bug](https://rust-lang.zulipchat.com/#narrow/stream/242791-t-infra/topic/ci.20broken.3F). r? Mark-Simulacrum Original PR description: --- Found while doing rust-lang#124491, I wanted to unify the code under `target_vendor = "apple"`, and found that [Clang actually specifies that watchOS ARM 32-bit does not use SjLj](https://github.com/llvm/llvm-project/blob/llvmorg-18.1.4/clang/lib/Driver/ToolChains/Darwin.cpp#L3107-L3119). I don't have an Apple Watch from that generation at hand to test this myself (series 1 to 3), and I don't think it will be sufficient to test it in the simulator (as it's architecture-specific), so maybe someone else could do so? N.B. The code is written in a way to support 32-bit iOS and tvOS ARM devices (which do use SjLj) for future compatibility even though we currently only have a target for 32-bit iOS ARM (if you think that's excessive, then I'll change it). `@rustbot` label O-watchos
…workingjubilee Convert instances of `target_os = "macos"` to `target_vendor = "apple"` rust-lang#124491 migrated towards using `target_vendor = "apple"` more, as there's very little difference between iOS, tvOS, watchOS and visionOS. In that PR, I only did the changes where the standard library already had fixes for iOS, that I could confidently apply to the other targets. However, there's actually also not that big of a gap between macOS and the aforementioned platforms - so in this PR, I've gone through a few of the instances of `target_os = "macos"` and replaced it with `target_vendor = "apple"` to improve support on those platforms, see the commits for details. r? workingjubilee CC `@thomcc` `@simlay` (do tell me if I should stop pinging you on these Apple PRs) `@rustbot` label O-apple
Rollup merge of rust-lang#124788 - madsmtm:reduce-target_os-macos, r=workingjubilee Convert instances of `target_os = "macos"` to `target_vendor = "apple"` rust-lang#124491 migrated towards using `target_vendor = "apple"` more, as there's very little difference between iOS, tvOS, watchOS and visionOS. In that PR, I only did the changes where the standard library already had fixes for iOS, that I could confidently apply to the other targets. However, there's actually also not that big of a gap between macOS and the aforementioned platforms - so in this PR, I've gone through a few of the instances of `target_os = "macos"` and replaced it with `target_vendor = "apple"` to improve support on those platforms, see the commits for details. r? workingjubilee CC `@thomcc` `@simlay` (do tell me if I should stop pinging you on these Apple PRs) `@rustbot` label O-apple
Use
target_vendor = "apple"
instead ofall(target_os = "macos", target_os = "ios", target_os = "tvos", target_os = "watchos", target_os = "visionos")
.The apple targets are quite close to being identical, with iOS, tvOS, watchOS and visionOS being even closer, so using
target_vendor
when possible makes it clearer when something is actually OS-specific, or just Apple-specific.Note that
target_vendor
will be deprecated in the future, but not before an alternative (liketarget_family = "apple"
) is available.While doing this, I found various inconsistencies and small mistakes in the standard library, see the commits for details. Will follow-up with an extra PR for a similar issue that need a bit more discussion. EDIT: #124494
Since you've talked about using
target_vendor = "apple"
in the past:r? workingjubilee
CC @simlay, @thomcc
@rustbot label O-macos O-ios O-tvos O-watchos O-visionos