Skip to content

Commit

Permalink
Merge pull request #476 from madsmtm/new-versions
Browse files Browse the repository at this point in the history
New versions
  • Loading branch information
madsmtm authored Jul 31, 2023
2 parents f2bd35a + 704610a commit 3d9b686
Show file tree
Hide file tree
Showing 15 changed files with 69 additions and 25 deletions.
1 change: 0 additions & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,6 @@ Copy and fill out the following checklist into the release PR:
- Local tests have been run (see `helper-scripts/test-local.fish`):
- [ ] macOS 10.14.6 32bit
- [ ] iOS 9.3.6, 1st generation iPad Mini
- [ ] Any errors that emerge have been fixed in other PRs.

Post merge:
- [ ] A tag is created on the merge commit for each new version.
Expand Down
8 changes: 4 additions & 4 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 7 additions & 0 deletions crates/block2/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,13 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
## Unreleased - YYYY-MM-DD


## 0.3.0 - 2023-07-31

### Fixed
* Bumped version number to ensure that this crate can be compiled together
with code that depends on pre-releases of `0.2.0`.


## 0.2.0 - 2023-06-20

### Changed
Expand Down
4 changes: 2 additions & 2 deletions crates/block2/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[package]
name = "block2"
# Remember to update html_root_url in lib.rs and README.md
version = "0.2.0"
version = "0.3.0"
authors = ["Steven Sheldon", "Mads Marquart <mads@marquart.dk>"]
edition = "2021"
rust-version = "1.60"
Expand Down Expand Up @@ -35,7 +35,7 @@ gnustep-2-0 = ["gnustep-1-9", "block-sys/gnustep-2-0", "objc2/gnustep-2-0"]
gnustep-2-1 = ["gnustep-2-0", "block-sys/gnustep-2-1", "objc2/gnustep-2-1"]

[dependencies]
objc2 = { path = "../objc2", version = "0.4.0", default-features = false }
objc2 = { path = "../objc2", version = "0.4.1", default-features = false }
block-sys = { path = "../block-sys", version = "0.2.0", default-features = false }

[package.metadata.docs.rs]
Expand Down
2 changes: 1 addition & 1 deletion crates/block2/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@
#![warn(clippy::cargo)]
#![warn(clippy::ptr_as_ptr)]
// Update in Cargo.toml as well.
#![doc(html_root_url = "https://docs.rs/block2/0.2.0")]
#![doc(html_root_url = "https://docs.rs/block2/0.3.0")]

extern crate alloc;
extern crate std;
Expand Down
9 changes: 9 additions & 0 deletions crates/icrate/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,15 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
## icrate Unreleased - YYYY-MM-DD


## icrate 0.0.4 - 2023-07-31

### Changed
* **BREAKING**: Updated `block2` to `v0.3.0`.

### Fixed
* Documentation on docs.rs.


## icrate 0.0.3 - 2023-06-20

### Added
Expand Down
6 changes: 3 additions & 3 deletions crates/icrate/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "icrate"
version = "0.0.3" # Remember to update html_root_url in lib.rs
version = "0.0.4" # Remember to update html_root_url in lib.rs
authors = ["Mads Marquart <mads@marquart.dk>"]
edition = "2021"
rust-version = "1.60"
Expand All @@ -20,8 +20,8 @@ documentation = "https://docs.rs/icrate/"
license = "MIT"

[dependencies]
objc2 = { path = "../objc2", version = "0.4.0", default-features = false, optional = true }
block2 = { path = "../block2", version = "0.2.0", default-features = false, optional = true }
objc2 = { path = "../objc2", version = "0.4.1", default-features = false, optional = true }
block2 = { path = "../block2", version = "0.3.0", default-features = false, optional = true }
dispatch = { version = "0.2.0", optional = true }

[dev-dependencies]
Expand Down
2 changes: 1 addition & 1 deletion crates/icrate/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
#![allow(clippy::identity_op)]
#![allow(clippy::missing_safety_doc)]
// Update in Cargo.toml as well.
#![doc(html_root_url = "https://docs.rs/icrate/0.0.3")]
#![doc(html_root_url = "https://docs.rs/icrate/0.0.4")]
#![recursion_limit = "512"]

#[cfg(feature = "alloc")]
Expand Down
7 changes: 7 additions & 0 deletions crates/objc2-encode/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,13 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
## Unreleased - YYYY-MM-DD


## 3.0.0 - 2023-07-31

### Fixed
* Bumped version number to ensure that this crate can be compiled together
with code that depends on pre-releases of `2.0.0`.


## 2.0.0 - 2023-06-20

### Added
Expand Down
4 changes: 2 additions & 2 deletions crates/objc2-encode/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[package]
name = "objc2-encode"
# Remember to update html_root_url in lib.rs and README.md
version = "2.0.0"
# Remember to update html_root_url in lib.rs
version = "3.0.0"
authors = ["Steven Sheldon", "Mads Marquart <mads@marquart.dk>"]
edition = "2021"
rust-version = "1.60"
Expand Down
2 changes: 1 addition & 1 deletion crates/objc2-encode/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@
#![warn(clippy::cargo)]
#![warn(clippy::ptr_as_ptr)]
// Update in Cargo.toml as well.
#![doc(html_root_url = "https://docs.rs/objc2-encode/2.0.0")]
#![doc(html_root_url = "https://docs.rs/objc2-encode/3.0.0")]
#![cfg_attr(feature = "unstable-c-unwind", feature(c_unwind))]

#[cfg(doctest)]
Expand Down
11 changes: 11 additions & 0 deletions crates/objc2/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).

## Unreleased - YYYY-MM-DD


## 0.4.1 - 2023-07-31

### Added
* Allow using `MainThreadMarker` in `extern_methods!`.
* Added the feature flag `"relax-void-encoding"`, which when enabled, allows
Expand All @@ -21,6 +24,14 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
To better fit with Swift's naming scheme. The types are still available
under the old names as deprecated aliases.

### Fixed
* **BREAKING**: Updated `encode` types to those from `objc2-encode v3.0.0`.

This is technically a breaking change, but it should allow this crate to be
compiled together with pre-release versions of it, meaning that in practice
strictly more code out there will compile because of this. Hence it was
deemed the better trade-off.


## 0.4.0 - 2023-06-20

Expand Down
4 changes: 2 additions & 2 deletions crates/objc2/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "objc2"
version = "0.4.0" # Remember to update html_root_url in lib.rs
version = "0.4.1" # Remember to update html_root_url in lib.rs
authors = ["Steven Sheldon", "Mads Marquart <mads@marquart.dk>"]
edition = "2021"
rust-version = "1.60"
Expand Down Expand Up @@ -99,7 +99,7 @@ unstable-compiler-rt = ["apple"]
[dependencies]
malloc_buf = { version = "1.0", optional = true }
objc-sys = { path = "../objc-sys", version = "0.3.1", default-features = false }
objc2-encode = { path = "../objc2-encode", version = "2.0.0", default-features = false }
objc2-encode = { path = "../objc2-encode", version = "3.0.0", default-features = false }
objc2-proc-macros = { path = "../objc2-proc-macros", version = "0.1.1", optional = true }

[dev-dependencies]
Expand Down
2 changes: 1 addition & 1 deletion crates/objc2/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,7 @@
#![warn(clippy::cargo)]
#![warn(clippy::ptr_as_ptr)]
// Update in Cargo.toml as well.
#![doc(html_root_url = "https://docs.rs/objc2/0.4.0")]
#![doc(html_root_url = "https://docs.rs/objc2/0.4.1")]

#[cfg(not(feature = "alloc"))]
compile_error!("The `alloc` feature currently must be enabled.");
Expand Down
25 changes: 18 additions & 7 deletions crates/objc2/src/rc/test_object.rs
Original file line number Diff line number Diff line change
Expand Up @@ -388,9 +388,6 @@ mod tests {
#[allow(clippy::if_same_then_else)]
const IF_AUTORELEASE_NOT_SKIPPED: usize = if cfg!(feature = "gnustep-1-7") {
1
} else if cfg!(all(target_arch = "arm", panic = "unwind")) {
// 32-bit ARM unwinding interferes with the optimization
2
} else if cfg!(target_arch = "x86") {
// x86 autorelease_return is not currently tail-called, so the
// optimization doesn't work on declare_class! functions.
Expand All @@ -401,6 +398,15 @@ mod tests {
1
} - 1;

// 32-bit ARM unwinding sometimes interferes with the optimization
const IF_AUTORELEASE_NOT_SKIPPED_ARM_HACK: usize = {
if cfg!(all(target_arch = "arm", panic = "unwind")) {
1
} else {
IF_AUTORELEASE_NOT_SKIPPED
}
};

macro_rules! test_error_id {
($expected:expr, $if_autorelease_not_skipped:expr, $sel:ident, $($obj:tt)*) => {
// Succeeds
Expand Down Expand Up @@ -457,7 +463,12 @@ mod tests {
let obj = __RcTestObject::new();
expected.alloc += 1;
expected.init += 1;
test_error_id!(expected, IF_AUTORELEASE_NOT_SKIPPED, idAndShouldError, &obj);
test_error_id!(
expected,
IF_AUTORELEASE_NOT_SKIPPED_ARM_HACK,
idAndShouldError,
&obj
);

expected.alloc -= 1;
expected.release -= 1;
Expand Down Expand Up @@ -525,12 +536,12 @@ mod tests {
assert!(res.is_some());
expected.alloc += 1;
expected.init += 1;
expected.autorelease += IF_AUTORELEASE_NOT_SKIPPED;
expected.retain += IF_AUTORELEASE_NOT_SKIPPED;
expected.autorelease += IF_AUTORELEASE_NOT_SKIPPED_ARM_HACK;
expected.retain += IF_AUTORELEASE_NOT_SKIPPED_ARM_HACK;
expected.assert_current();
res
});
expected.release += IF_AUTORELEASE_NOT_SKIPPED;
expected.release += IF_AUTORELEASE_NOT_SKIPPED_ARM_HACK;
expected.assert_current();
}
}

0 comments on commit 3d9b686

Please sign in to comment.