Skip to content

Commit 9a7c664

Browse files
committed
Bump minimum deployment target in icrate
1 parent 8525bfc commit 9a7c664

File tree

9 files changed

+39
-84
lines changed

9 files changed

+39
-84
lines changed

.github/workflows/ci.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -365,7 +365,7 @@ jobs:
365365
- name: Test macOS old SDK
366366
# Oldest macOS version we support
367367
sdk: "10.12"
368-
frameworks: macos-10-7
368+
frameworks: macos-10-12
369369
- name: Test macOS nightly
370370
nightly: true
371371
frameworks: macos-11
@@ -475,7 +475,7 @@ jobs:
475475
# TODO: Re-enable this on all of Foundation once we do some form of
476476
# availability checking.
477477
- name: Test static class and selectors
478-
if: ${{ !contains(matrix.frameworks, 'ios') && !contains(matrix.frameworks, 'macos-10-7') }}
478+
if: ${{ !contains(matrix.frameworks, 'ios') && !contains(matrix.frameworks, 'macos-10-12') }}
479479
run: >-
480480
cargo test $ARGS $PUBLIC_CRATES -ptests
481481
--features=unstable-static-sel,unstable-static-class,unstable-static-nsstring

crates/header-translator/src/main.rs

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -86,20 +86,20 @@ fn main() -> Result<(), BoxError> {
8686
// These are found using the `get_llvm_targets.fish` helper script
8787
let llvm_targets: &[_] = match &sdk.platform {
8888
Platform::MacOsX => &[
89-
"x86_64-apple-macosx10.7.0",
89+
"x86_64-apple-macosx10.12.0",
9090
// "arm64-apple-macosx11.0.0",
91-
// "i686-apple-macosx10.7.0",
91+
// "i686-apple-macosx10.12.0",
9292
],
9393
Platform::IPhoneOs => &[
94-
// "arm64-apple-ios7.0.0",
95-
// "armv7s-apple-ios",
94+
// "arm64-apple-ios10.0.0",
95+
// "armv7s-apple-ios10.0.0",
9696
// "arm64-apple-ios14.0-macabi",
9797
// "x86_64-apple-ios13.0-macabi",
9898
],
9999
// Platform::IPhoneSimulator => &[
100-
// "arm64-apple-ios7.0.0-simulator",
101-
// "x86_64-apple-ios7.0.0-simulator",
102-
// "i386-apple-ios7.0.0-simulator",
100+
// "arm64-apple-ios10.0.0-simulator",
101+
// "x86_64-apple-ios10.0.0-simulator",
102+
// "i386-apple-ios10.0.0-simulator",
103103
// ],
104104
// Platform::AppleTvOs => &["arm64-apple-tvos", "x86_64-apple-tvos"],
105105
// Platform::WatchOs => &["arm64_32-apple-watchos", "armv7k-apple-watchos"],

crates/header-translator/src/output.rs

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -49,11 +49,12 @@ impl Output {
4949
pub fn cargo_features(&self, config: &Config) -> BTreeMap<String, Vec<String>> {
5050
let mut features = BTreeMap::new();
5151

52-
let mut macos_10_7_features: BTreeSet<String> = vec!["unstable-example-basic_usage".into()]
53-
.into_iter()
54-
.collect();
52+
let mut macos_10_12_features: BTreeSet<String> =
53+
vec!["unstable-example-basic_usage".into()]
54+
.into_iter()
55+
.collect();
5556
let mut macos_10_13_features: BTreeSet<String> = vec![
56-
"unstable-frameworks-macos-10-7".into(),
57+
"unstable-frameworks-macos-10-12".into(),
5758
"unstable-example-delegate".into(),
5859
"unstable-example-metal".into(),
5960
"unstable-example-nspasteboard".into(),
@@ -88,8 +89,8 @@ impl Output {
8889
let _ = features.insert(library_name.to_string(), library_features.collect());
8990

9091
if let Some(version) = &library.macos {
91-
if version.matches(&semver::Version::from_str("10.7.0").unwrap()) {
92-
macos_10_7_features.insert(format!("{library_name}_all"));
92+
if version.matches(&semver::Version::from_str("10.12.0").unwrap()) {
93+
macos_10_12_features.insert(format!("{library_name}_all"));
9394
} else if version.matches(&semver::Version::from_str("10.13.0").unwrap()) {
9495
macos_10_13_features.insert(format!("{library_name}_all"));
9596
} else if version.matches(&semver::Version::from_str("11.0.0").unwrap()) {
@@ -107,8 +108,8 @@ impl Output {
107108
}
108109

109110
let _ = features.insert(
110-
"unstable-frameworks-macos-10-7".into(),
111-
macos_10_7_features.into_iter().collect(),
111+
"unstable-frameworks-macos-10-12".into(),
112+
macos_10_12_features.into_iter().collect(),
112113
);
113114
let _ = features.insert(
114115
"unstable-frameworks-macos-10-13".into(),

crates/header-translator/translation-config.toml

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1321,16 +1321,6 @@ skipped = true
13211321
[enum.NSTextAlignment]
13221322
skipped = true
13231323

1324-
# Different definitions depending on deployment target
1325-
[class.NSLayoutAnchor]
1326-
definition-skipped = true
1327-
[class.NSPopover]
1328-
definition-skipped = true
1329-
[class.NSPopover.methods]
1330-
appearance = { skipped = true }
1331-
setAppearance = { skipped = true }
1332-
effectiveAppearance = { skipped = true }
1333-
13341324
# I'm unsure of the ABI of the array this takes
13351325
[fn.NSDrawBitmap]
13361326
skipped = true

crates/icrate/CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,8 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
7474
* **BREAKING**: Removed a workaround that made the `NSCopying` and
7575
`NSMutableCopying` protocols not act as regular protocols (many methods used
7676
`AnyObject` instead of the correct `ProtocolObject<dyn NSCopying>`).
77+
* Update the minimum deployment target, which adds a few missing protocol
78+
implementations and methods for `NSPopover` and `NSLayoutAnchor`.
7779

7880

7981
## icrate 0.0.4 - 2023-07-31

crates/icrate/Cargo.toml

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -5329,39 +5329,39 @@ unstable-frameworks-gnustep = [
53295329
"AppKit_all",
53305330
"Foundation_all",
53315331
]
5332-
unstable-frameworks-macos-10-13 = [
5332+
unstable-frameworks-macos-10-12 = [
5333+
"AppKit_all",
5334+
"Automator_all",
53335335
"CloudKit_all",
53345336
"Contacts_all",
5337+
"CoreAnimation_all",
5338+
"CoreData_all",
53355339
"CoreLocation_all",
5340+
"CoreWLAN_all",
53365341
"EventKit_all",
5337-
"ExternalAccessory_all",
5342+
"ExceptionHandling_all",
5343+
"Foundation_all",
53385344
"GameController_all",
53395345
"GameKit_all",
5346+
"InputMethodKit_all",
53405347
"LocalAuthentication_all",
53415348
"MapKit_all",
5342-
"MediaPlayer_all",
53435349
"MetalKit_all",
53445350
"Metal_all",
5351+
"OSAKit_all",
53455352
"PhotoKit_all",
5353+
"StoreKit_all",
5354+
"WebKit_all",
5355+
"unstable-example-basic_usage",
5356+
]
5357+
unstable-frameworks-macos-10-13 = [
5358+
"ExternalAccessory_all",
5359+
"MediaPlayer_all",
53465360
"unstable-example-delegate",
53475361
"unstable-example-metal",
53485362
"unstable-example-nspasteboard",
53495363
"unstable-example-speech_synthesis",
5350-
"unstable-frameworks-macos-10-7",
5351-
]
5352-
unstable-frameworks-macos-10-7 = [
5353-
"AppKit_all",
5354-
"Automator_all",
5355-
"CoreAnimation_all",
5356-
"CoreData_all",
5357-
"CoreWLAN_all",
5358-
"ExceptionHandling_all",
5359-
"Foundation_all",
5360-
"InputMethodKit_all",
5361-
"OSAKit_all",
5362-
"StoreKit_all",
5363-
"WebKit_all",
5364-
"unstable-example-basic_usage",
5364+
"unstable-frameworks-macos-10-12",
53655365
]
53665366
unstable-frameworks-macos-11 = [
53675367
"Accessibility_all",

crates/icrate/src/fixes/AppKit/mod.rs

Lines changed: 0 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -27,42 +27,5 @@ ns_enum!(
2727
}
2828
);
2929

30-
extern_class!(
31-
#[cfg(feature = "AppKit_NSPopover")]
32-
#[derive(Debug, PartialEq, Eq, Hash)]
33-
pub struct NSPopover;
34-
35-
#[cfg(feature = "AppKit_NSPopover")]
36-
unsafe impl ClassType for NSPopover {
37-
#[inherits(NSObject)]
38-
type Super = crate::AppKit::NSResponder;
39-
type Mutability = MainThreadOnly;
40-
}
41-
);
42-
43-
__inner_extern_class!(
44-
#[cfg(feature = "AppKit_NSLayoutAnchor")]
45-
#[derive(Debug, PartialEq, Eq, Hash)]
46-
pub struct NSLayoutAnchor<AnchorType: ?Sized = AnyObject> {
47-
__superclass: NSObject,
48-
_inner0: PhantomData<*mut AnchorType>,
49-
notunwindsafe: PhantomData<&'static mut ()>,
50-
}
51-
52-
#[cfg(feature = "AppKit_NSLayoutAnchor")]
53-
unsafe impl<AnchorType: ?Sized + Message> ClassType for NSLayoutAnchor<AnchorType> {
54-
type Super = NSObject;
55-
type Mutability = InteriorMutable;
56-
57-
fn as_super(&self) -> &Self::Super {
58-
&self.__superclass
59-
}
60-
61-
fn as_super_mut(&mut self) -> &mut Self::Super {
62-
&mut self.__superclass
63-
}
64-
}
65-
);
66-
6730
#[cfg(feature = "AppKit_NSImage")]
6831
unsafe impl crate::Foundation::NSCoding for crate::AppKit::NSImage {}

crates/icrate/src/generated

crates/icrate/tests/auto_traits.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,6 @@ fn send_sync_unwindsafe() {
154154
assert_auto_traits::<NSString>();
155155
assert_unwindsafe::<MainThreadMarker>(); // Intentional
156156
assert_auto_traits::<NSThread>();
157-
#[cfg(not(macos_10_7))]
158157
assert_auto_traits::<NSUUID>();
159158
// assert_auto_traits::<NSValue>(); // Intentional
160159
assert_unwindsafe::<NSZone>(); // Intentional

0 commit comments

Comments
 (0)