Skip to content

Commit 710386d

Browse files
committed
Update to Xcode 26 Beta 1
1 parent 484fa9b commit 710386d

File tree

86 files changed

+1437
-51
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

86 files changed

+1437
-51
lines changed

.github/workflows/ci.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -297,7 +297,7 @@ jobs:
297297
- lint
298298

299299
env:
300-
DEVELOPER_DIR: /Applications/Xcode_16.4.app/Contents/Developer
300+
DEVELOPER_DIR: /Applications/Xcode_26.0_beta_1.app/Contents/Developer
301301

302302
steps:
303303
- uses: actions/checkout@v4

Cargo.lock

Lines changed: 13 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,8 @@ default.extend-identifiers.IMAGEIO_PNG_FILTER_PAETH = "IMAGEIO_PNG_FILTER_PAETH"
7373
# In framework-crates/objc2-io-bluetooth/translation-config.toml
7474
default.extend-identifiers.kBluetoothHCIEvnetMaskLinkSupervisionTimeoutChangedEvent = "kBluetoothHCIEvnetMaskLinkSupervisionTimeoutChangedEvent"
7575
default.extend-identifiers.kBluetoothHCIEvnetMaskEnhancedFlushCompleteEvent = "kBluetoothHCIEvnetMaskEnhancedFlushCompleteEvent"
76+
# In BackgroundAssets, BA is short of that framework.
77+
default.extend-words.BA = "BA"
7678
# Used in Metal, LOD = level of detail
7779
default.extend-words.lod = "lod"
7880

crates/header-translator/configs/libc.toml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,3 +16,7 @@ gnustep = true
1616

1717
# HACK: Define `task_port_t` in the using crate (it's a simple alias to `task_t`).
1818
external.task_port_t.module = "__builtin__"
19+
20+
# Redefined by CoreFoundation with a name that makes it hard to see
21+
# that this is `libc::malloc_zone_t`.
22+
struct._malloc_zone_t.renamed = "malloc_zone_t"

crates/header-translator/configs/skipped.toml

Lines changed: 23 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,14 +23,15 @@ vmnet = "Very C-centric and old"
2323

2424
DriverKit = "Uses C++ classes"
2525

26-
AGL = "OpenGL-specific, use Metal instead"
26+
# AGL = "OpenGL-specific, use Metal instead" # Removed in newer SDKs
2727
GLKit = "OpenGL-specific, use Metal instead"
2828
GLUT = "OpenGL-specific, use Metal instead"
2929
OpenGL = "OpenGL-specific, use Metal instead"
3030
OpenGLES = "OpenGL-specific, use Metal instead"
3131

3232
ActivityKit = "Swift-only"
3333
AdAttributionKit = "Swift-only"
34+
AlarmKit = "Mostly Swift-only"
3435
AppIntents = "Swift-only"
3536
Assignables = "Swift-only"
3637
AutomatedDeviceEnrollment = "Swift-only"
@@ -43,15 +44,22 @@ CoreTransferable = "Swift-only"
4344
CreateML = "Swift-only"
4445
CreateMLComponents = "Swift-only"
4546
CryptoKit = "Swift-only"
47+
DeclaredAgeRange = "Swift-only"
4648
DeveloperToolsSupport = "Swift-only"
4749
DeviceActivity = "Swift-only"
4850
DockKit = "Swift-only"
51+
EnergyKit = "Swift-only"
4952
ExtensionFoundation = "Swift-only"
5053
FamilyControls = "Swift-only"
5154
FinanceKit = "Swift-only"
5255
FinanceKitUI = "Swift-only"
56+
FoundationModels = "Swift-only"
57+
GeoToolbox = "Swift-only"
5358
GroupActivities = "Swift-only"
59+
IdentityDocumentServices = "Swift-only"
60+
IdentityDocumentServicesUI = "Swift-only"
5461
ImagePlayground = "Swift-only"
62+
ImmersiveMediaSupport = "Swift-only"
5563
JournalingSuggestions = "Swift-only"
5664
LightweightCodeRequirements = "Swift-only"
5765
LiveCommunicationKit = "Swift-only"
@@ -63,23 +71,31 @@ ManagedSettingsUI = "Swift-only"
6371
MarketplaceKit = "Swift-only"
6472
MatterSupport = "Swift-only"
6573
MusicKit = "Swift-only"
74+
PaperKit = "Swift-only"
75+
PermissionKit = "Swift-only"
6676
ProximityReader = "Swift-only"
6777
RealityFoundation = "Swift-only"
6878
RealityKit = "Swift-only"
79+
RelevanceKit = "Swift-only"
6980
RoomPlan = "Swift-only"
7081
SecureElementCredential = "Swift-only"
7182
SwiftData = "Swift-only"
7283
SwiftUI = "Swift-only"
7384
SwiftUICore = "Swift-only"
7485
TabletopKit = "Swift-only"
7586
TabularData = "Swift-only"
87+
TelephonyMessagingKit = "Swift-only"
7688
TipKit = "Swift-only"
7789
Translation = "Swift-only"
7890
TranslationUIProvider = "Swift-only"
91+
VisionEntitlementServices = "Mostly Swift-only"
7992
VisionKit = "Swift-only"
93+
VisualIntelligence = "Swift-only"
8094
WeatherKit = "Swift-only"
81-
WorkoutKit = "Swift-only"
8295
WidgetKit = "Mostly Swift-only"
96+
WiFiAware = "Swift-only"
97+
WirelessInsights = "Swift-only"
98+
WorkoutKit = "Swift-only"
8399

84100
AppleScriptKit = "Basically empty nowadays" # requires !swift
85101
AppleScriptObjC = "Basically empty nowadays"
@@ -94,6 +110,7 @@ QTKit = "No headers present in Xcode's SDK"
94110
StickerFoundation = "Basically empty"
95111
StickerKit = "Basically empty"
96112
System = "Deprecated wrapper over libSystem.dylib"
113+
MetalPerformancePrimitives = "Header-only framework (no symbols)"
97114

98115
# Deprecated before macOS 10.12 (Rust's minimum supported macOS version)
99116
AudioVideoBridging = "Deprecated, use AVKit/AVFoundation instead (maybe?)"
@@ -125,3 +142,7 @@ DeviceDiscoveryUI = "Needs Network first"
125142

126143
BrowserKit = "TODO"
127144
SecurityUI = "TODO"
145+
GameSave = "TODO"
146+
TouchControls = "TODO"
147+
148+
MeshNetFramework = "Weirdly incomplete"

crates/header-translator/src/id.rs

Lines changed: 30 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,22 @@ pub struct Location {
6969
impl Location {
7070
fn new(module_path: impl Into<Box<str>>) -> Self {
7171
let module_path = module_path.into();
72+
73+
// We don't care about the difference between the different
74+
// DarwinFoundation modules (for now at least).
75+
if let Some(rest) = module_path.strip_prefix("DarwinFoundation.") {
76+
return Self::new(rest);
77+
}
78+
if let Some(rest) = module_path.strip_prefix("_DarwinFoundation1.") {
79+
return Self::new(rest);
80+
}
81+
if let Some(rest) = module_path.strip_prefix("_DarwinFoundation2.") {
82+
return Self::new(rest);
83+
}
84+
if let Some(rest) = module_path.strip_prefix("_DarwinFoundation3.") {
85+
return Self::new(rest);
86+
}
87+
7288
let module_path = match &*module_path {
7389
// Remove submodules for Objective-C.
7490
name if name.starts_with("ObjectiveC") => "ObjectiveC".into(),
@@ -83,7 +99,9 @@ impl Location {
8399

84100
// Various macros
85101
name if name.starts_with("os_availability") => "__builtin__".into(),
86-
"DarwinFoundation.cdefs" => "__builtin__".into(),
102+
name if name.starts_with("_AvailabilityInternal") => "__builtin__".into(),
103+
name if name.starts_with("availability") => "__builtin__".into(),
104+
"cdefs" => "__builtin__".into(),
87105
"Darwin.libkern.OSByteOrder" => "__builtin__".into(),
88106
"TargetConditionals" => "__builtin__".into(),
89107
"Darwin.AssertMacros" => "__builtin__".into(),
@@ -108,7 +126,7 @@ impl Location {
108126
"_Builtin_stdint" | "_stdint" => "__builtin__".into(),
109127
name if name.starts_with("_Builtin_stddef") => "__builtin__".into(),
110128
// Implementation of the above
111-
"DarwinFoundation.types.machine_types" => "__builtin__".into(),
129+
name if name.starts_with("types.machine_types") => "__builtin__".into(),
112130
// UINT_MAX, FLT_MIN, DBL_MAX, etc.
113131
// Handled manually in `expr.rs`.
114132
"_Builtin_limits" => "__builtin__".into(),
@@ -132,8 +150,8 @@ impl Location {
132150
name if name.starts_with("sys_types") => "__libc__".into(),
133151
name if name.starts_with("Darwin.POSIX") => "__libc__".into(),
134152
name if name.starts_with("_signal") => "__libc__".into(),
135-
"DarwinFoundation.types.sys_types" => "__libc__".into(),
136-
"DarwinFoundation.qos" => "__libc__".into(),
153+
"types.sys_types" => "__libc__".into(),
154+
"qos" => "__libc__".into(),
137155
"_stdio" => "__libc__".into(),
138156
"_time.timespec" => "__libc__".into(),
139157
"_fenv" => "__libc__".into(),
@@ -149,9 +167,12 @@ impl Location {
149167
"ptrauth" => "__libc__".into(),
150168
"Darwin.uuid" => "__libc__".into(),
151169
"unistd" => "__libc__".into(),
170+
"Darwin.malloc" => "__libc__".into(),
171+
"_stdlib.malloc.malloc_type" => "__libc__".into(),
152172

153173
// Will be moved to the `mach2` crate in `libc` v1.0
154174
name if name.starts_with("Darwin.Mach") => "__libc__".into(),
175+
"mach.port.mach_port_t" => "__libc__".into(),
155176
"mach.mach_port_t" => "__libc__".into(),
156177
"_mach_port_t" => "__libc__".into(),
157178

@@ -164,6 +185,11 @@ impl Location {
164185
.replace("IOBluetoothUI.objc", "IOBluetoothUI.objc2")
165186
.into(),
166187

188+
// TODO: Will hopefully be fixed in future Xcode betas
189+
"_LocationEssentials.CLLocationEssentials" => "CoreLocation.CLLocation".into(),
190+
"UIUtilities.UIGeometry" => "UIKit.UIGeometry".into(),
191+
"UIUtilities.UICoordinateSpace" => "UIKit.UIView".into(),
192+
167193
_ => module_path,
168194
};
169195

crates/header-translator/src/rust_type.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -876,6 +876,8 @@ impl Ty {
876876
| "MIDISysexSendRequestUMP"
877877
| "MIDIDriverInterface"
878878
| "cssm_list_element"
879+
| "malloc_zone_t"
880+
| "_malloc_zone_t"
879881
)
880882
) {
881883
// Fake fields, we'll have to define it ourselves

crates/header-translator/src/stmt.rs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -324,7 +324,10 @@ fn verify_objc_decl(entity: &Entity<'_>, _context: &Context<'_>) {
324324
(EntityKind::UnexposedAttr, _) => {
325325
// Parsed in parse_attributes
326326
}
327-
(_, parent_kind) => error!(?parent_kind, "unknown in parent"),
327+
(EntityKind::AnnotateAttr, _) if entity.get_name().unwrap() == "main-thread-only" => {
328+
// Already parsed via. UnexposedAttr.
329+
}
330+
(_, parent_kind) => error!(?entity, ?parent_kind, "unknown in parent"),
328331
}
329332
});
330333
}

crates/header-translator/src/unexposed_attr.rs

Lines changed: 30 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,9 @@ impl UnexposedAttr {
6565
| "CF_TYPED_EXTENSIBLE_ENUM"
6666
| "NS_EXTENSIBLE_STRING_ENUM"
6767
| "CF_EXTENSIBLE_STRING_ENUM" => Some(Self::TypedExtensibleEnum),
68+
// FIXME: Attribute used directly in CoreGraphics, we really need
69+
// to parse and check the contents of it here.
70+
"swift_wrapper" => None,
6871
"NS_SWIFT_BRIDGED_TYPEDEF" | "CF_SWIFT_BRIDGED_TYPEDEF" => Some(Self::BridgedTypedef),
6972
"CF_IMPLICIT_BRIDGING_ENABLED" => Some(Self::BridgedImplicit),
7073
"CF_BRIDGED_TYPE"
@@ -93,12 +96,25 @@ impl UnexposedAttr {
9396
// Nullability attributes
9497
s if s.starts_with("DISPATCH_NONNULL") => None,
9598
s if s.starts_with("XPC_NONNULL") => None,
96-
"NS_SWIFT_SENDABLE" | "AS_SWIFT_SENDABLE" | "CM_SWIFT_SENDABLE"
97-
| "CT_SWIFT_SENDABLE" | "CV_SWIFT_SENDABLE" => Some(Self::Sendable),
98-
"NS_SWIFT_NONSENDABLE" | "CM_SWIFT_NONSENDABLE" | "CV_SWIFT_NONSENDABLE" => {
99-
Some(Self::NonSendable)
99+
"NS_SWIFT_SENDABLE"
100+
| "AS_SWIFT_SENDABLE"
101+
| "CM_SWIFT_SENDABLE"
102+
| "CT_SWIFT_SENDABLE"
103+
| "CV_SWIFT_SENDABLE"
104+
| "SEC_SWIFT_SENDABLE"
105+
| "IOSFC_SWIFT_SENDABLE" => Some(Self::Sendable),
106+
"NS_SWIFT_NONSENDABLE"
107+
| "CM_SWIFT_NONSENDABLE"
108+
| "CV_SWIFT_NONSENDABLE"
109+
| "IOSFC_SWIFT_NONSENDABLE" => Some(Self::NonSendable),
110+
// TODO
111+
"NS_SWIFT_SENDING" | "CM_SWIFT_SENDING" => None,
112+
"CM_SWIFT_SENDING_RETAINED_RESULT" | "CM_SWIFT_SENDING_RETAINED_PARAMETER" => {
113+
Some(Self::ReturnsRetained)
114+
}
115+
"NS_SWIFT_UI_ACTOR" | "WK_SWIFT_UI_ACTOR" | "CARPLAY_TEMPLATE_UI_ACTOR" => {
116+
Some(Self::UIActor)
100117
}
101-
"NS_SWIFT_UI_ACTOR" | "WK_SWIFT_UI_ACTOR" => Some(Self::UIActor),
102118
"NS_SWIFT_NONISOLATED" | "UIKIT_SWIFT_ACTOR_INDEPENDENT" => Some(Self::NonIsolated),
103119
// TODO
104120
"CF_FORMAT_ARGUMENT" | "CF_FORMAT_FUNCTION" | "NS_FORMAT_FUNCTION"
@@ -161,6 +177,8 @@ impl UnexposedAttr {
161177
| "CF_SWIFT_UNAVAILABLE"
162178
| "CG_AVAILABLE_BUT_DEPRECATED"
163179
| "CG_AVAILABLE_STARTING"
180+
| "CG_SOFT_DEPRECATED_WITH_REPLACEMENT"
181+
| "CG_ENUM_SOFT_DEPRECATED_WITH_REPLACEMENT"
164182
| "CI_GL_DEPRECATED"
165183
| "CI_GL_DEPRECATED_IOS"
166184
| "CI_GL_DEPRECATED_MAC"
@@ -298,8 +316,12 @@ impl UnexposedAttr {
298316
| "CB_CM_API_AVAILABLE"
299317
| "CF_AUTOMATED_REFCOUNT_UNAVAILABLE"
300318
| "CG_OBSOLETE"
301-
| "CS_UNAVAILABLE_EMBEDDED"
319+
| "CK_SHARE_ACCESS_REQUESTER_AVAILABILITY"
320+
| "CK_SHARE_BLOCKED_IDENTITY_AVAILABILITY"
321+
| "CKSHARE_REQUEST_ACCESS_INTERFACES_AVAILABILITY"
322+
| "CM_VISION_OS_AVAILABLE"
302323
| "CS_TVOS_UNAVAILABLE"
324+
| "CS_UNAVAILABLE_EMBEDDED"
303325
| "CSSM_DEPRECATED"
304326
| "deprecated"
305327
| "DEPRECATED_ATTRIBUTE"
@@ -369,7 +391,8 @@ impl UnexposedAttr {
369391
| "DISPATCH_REFINED_FOR_SWIFT"
370392
| "NS_REFINED_FOR_SWIFT"
371393
| "AR_REFINED_FOR_SWIFT"
372-
| "NS_SWIFT_DISABLE_ASYNC" => None,
394+
| "NS_SWIFT_DISABLE_ASYNC"
395+
| "CP_STRUCT_REF" => None,
373396
// Possibly interesting?
374397
"DISPATCH_COLD" => None,
375398
"DISPATCH_MALLOC" => None,

crates/objc2/src/lib.rs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -65,17 +65,17 @@
6565
//!
6666
//! ## Supported operating systems
6767
//!
68-
//! - macOS: `10.12-15.5`
69-
//! - iOS: `10.0-18.5` (including iPadOS and Mac Catalyst)
70-
//! - tvOS: `10.0-18.5`
71-
//! - watchOS: `5.0-11.5`
72-
//! - visionOS: `1.0-2.5`
68+
//! - macOS: `10.12-26.0`
69+
//! - iOS: `10.0-26.0` (including iPadOS and Mac Catalyst)
70+
//! - tvOS: `10.0-26.0`
71+
//! - watchOS: `5.0-26.0`
72+
//! - visionOS: `1.0-26.0`
7373
//!
7474
//! The minimum versions are the same as those supported by `rustc`. Higher
7575
//! versions will also work, but the framework crates will not have bindings
7676
//! available for newer APIs.
7777
//!
78-
//! The framework bindings are generated from the SDKs in Xcode 16.4. The
78+
//! The framework bindings are generated from the SDKs in Xcode 26.0. The
7979
//! Xcode version are updated usually within a week of [GitHub Actions]
8080
//! supporting the new Xcode version, and we try to schedule crate releases
8181
//! such that align fairly closely with Xcode updates. We only support stable

0 commit comments

Comments
 (0)