Skip to content
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_abi = "sim" instead of ios_simulator feature #17702

Merged
merged 1 commit into from
Feb 11, 2025

Conversation

madsmtm
Copy link
Contributor

@madsmtm madsmtm commented Feb 6, 2025

Objective

Get rid of a redundant Cargo feature flag.

Solution

Use the built-in target_abi = "sim" instead of a custom Cargo feature flag, which is set for the iOS (and visionOS and tvOS) simulator. This has been stable since Rust 1.78.

In the future, some of this may become redundant if Wgpu implements proper supper for the iOS Simulator:
gfx-rs/wgpu#7057

CC @mockersf who implemented the original fix.

Testing

  • Open mobile example in Xcode.
  • Launch the simulator.
  • See that no errors are emitted.
  • Remove the code cfg-guarded behind target_abi = "sim".
  • See that an error now happens.

(I haven't actually performed these steps on the latest main, because I'm hitting an unrelated error (EDIT: It was #17637). But tested it on 0.15.0).


Migration Guide

If you're using a project that builds upon the mobile example, remove the ios_simulator feature from your Cargo.toml (Bevy now handles this internally).

@madsmtm madsmtm changed the title chore: Use target_abi = "sim" instead of ios_simulator feature Use target_abi = "sim" instead of ios_simulator feature Feb 7, 2025
@mockersf mockersf added the O-iOS Specific to the iOS mobile operating system label Feb 7, 2025
@mockersf mockersf added this to the 0.16 milestone Feb 7, 2025
@alice-i-cecile alice-i-cecile added C-Testing A change that impacts how we test Bevy or how users test their apps C-Usability A targeted quality-of-life change that makes Bevy easier to use M-Needs-Migration-Guide A breaking change to Bevy's public API that needs to be noted in a migration guide labels Feb 11, 2025
@alice-i-cecile alice-i-cecile added this pull request to the merge queue Feb 11, 2025
@alice-i-cecile alice-i-cecile added the S-Ready-For-Final-Review This PR has been approved by the community. It's ready for a maintainer to consider merging it label Feb 11, 2025
Merged via the queue into bevyengine:main with commit 94deca8 Feb 11, 2025
38 checks passed
@madsmtm madsmtm deleted the use-target_abi-sim branch February 12, 2025 00:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-Testing A change that impacts how we test Bevy or how users test their apps C-Usability A targeted quality-of-life change that makes Bevy easier to use M-Needs-Migration-Guide A breaking change to Bevy's public API that needs to be noted in a migration guide O-iOS Specific to the iOS mobile operating system S-Ready-For-Final-Review This PR has been approved by the community. It's ready for a maintainer to consider merging it
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants