Skip to content

aarch64-apple-ios-sim target doesn't set cfg(target_env = "sim") #116206

Closed as not planned
@jrose-signal

Description

@jrose-signal

I tried to identify iOS devices (not simulators) with the following cfg attribute:

#[cfg(all(target_os = "ios", target_arch = "aarch64", not(target_env = "sim")))

This is to distinguish the aarch64-apple-ios and aarch64-apple-ios-sim targets (the latter promoted to Tier 2 in #87760). Unfortunately, target_env = "sim" isn't set for aarch64-apple-ios-sim, making them identical as far as the built-in cfg options go.

This isn't the end of the world because I can test the full target in build.rs, but it is a little frustrating.

Bonus: it would be nice™ to set target_env = "sim" for x86_64-apple-ios as well, which is also a simulator target. It historically didn't have -sim in its canonical form because Apple never made Intel iPhones, but it would be great to drop the target_arch condition altogether (especially if #115526 ends up changing the target_arch).

Metadata

Metadata

Assignees

No one assigned

    Labels

    C-bugCategory: This is a bug.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions