From 4f42f1c2fcefbd40502a970b9594dd222c383dd3 Mon Sep 17 00:00:00 2001 From: Mads Marquart Date: Wed, 23 Nov 2022 08:42:04 +0100 Subject: [PATCH 1/6] Appease clippy --- crates/objc2-encode/src/encode.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/crates/objc2-encode/src/encode.rs b/crates/objc2-encode/src/encode.rs index 8a7c206f6..971562629 100644 --- a/crates/objc2-encode/src/encode.rs +++ b/crates/objc2-encode/src/encode.rs @@ -784,7 +784,7 @@ mod tests { extern "C" fn my_fn3(x: &u8) -> &u8 { x } - extern "C" fn my_fn4<'a, 'b>(x: &'a u8, _y: &'b i32) -> &'a u8 { + extern "C" fn my_fn4<'a>(x: &'a u8, _y: &i32) -> &'a u8 { x } From dbb1278bbe043c8ec5bae460a73172675954d7ad Mon Sep 17 00:00:00 2001 From: Mads Marquart Date: Wed, 23 Nov 2022 08:46:08 +0100 Subject: [PATCH 2/6] Revert OS versions for compiling GNUStep `ubuntu-latest` was recently bumped from `ubuntu-20.04` to `ubuntu-22.04` --- .github/workflows/ci.yml | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 76d88b3ee..5cea00f2c 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -79,7 +79,8 @@ jobs: runtime: gnustep-1-9 libobjc2: "1.9" - name: Test GNUStep with libobjc2 v2.0 - os: ubuntu-latest + # Fails for some reason on Ubuntu 22 + os: ubuntu-20.04 target: x86_64-unknown-linux-gnu runtime: gnustep-2-0 libobjc2: "2.0" @@ -92,7 +93,9 @@ jobs: libobjc2: "2.1" fuzz: true - name: Test GNUStep 32bit - os: ubuntu-latest + # Ubuntu 22 image doesn't have the required C++ libraries + # installed for 32-bit + os: ubuntu-20.04 target: i686-unknown-linux-gnu cflags: -m32 configureflags: --target=x86-pc-linux-gnu From 22f7b118a6892e417017897ca9df381e6fe5ea53 Mon Sep 17 00:00:00 2001 From: Mads Marquart Date: Wed, 23 Nov 2022 08:50:12 +0100 Subject: [PATCH 3/6] Bump actions/checkout@v2 -> actions/checkout@v3 --- .github/workflows/ci.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 5cea00f2c..c9ff9489b 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -25,7 +25,7 @@ jobs: name: Check formatting runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 - name: Check formatting run: cargo fmt -- --check @@ -165,7 +165,7 @@ jobs: runs-on: ${{ matrix.os }} steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 - name: Cache external dependencies id: extern-cache From 965f1bbd5f18c0beba132a1362f0d3d0716ae2d4 Mon Sep 17 00:00:00 2001 From: Mads Marquart Date: Wed, 23 Nov 2022 08:52:36 +0100 Subject: [PATCH 4/6] Bump actions/cache@v2 -> actions/cache@v3 --- .github/workflows/ci.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index c9ff9489b..5f5ff6403 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -169,7 +169,7 @@ jobs: - name: Cache external dependencies id: extern-cache - uses: actions/cache@v2 + uses: actions/cache@v3 with: # We could have just cached build-files, and then rerun the build tool # every time, letting it figure out what's changed. However, this has @@ -300,7 +300,7 @@ jobs: ls -al $HOME/extern/* - name: Cache Cargo - uses: actions/cache@v2 + uses: actions/cache@v3 with: path: | ~/.cargo/bin/ @@ -310,7 +310,7 @@ jobs: key: cargo-${{ matrix.name }}-${{ hashFiles('**/Cargo.toml') }} - name: Cache Rust Target - uses: actions/cache@v2 + uses: actions/cache@v3 with: path: | target/ From d3befd5a4ef042b2d269a682fcc9eb186ae83961 Mon Sep 17 00:00:00 2001 From: Mads Marquart Date: Wed, 23 Nov 2022 09:00:19 +0100 Subject: [PATCH 5/6] Fix nightly UI tests --- crates/test-ui/ui/invalid_msg_send.stderr | 39 +++++++++++++++++ .../test-ui/ui/invalid_ns_string_input.stderr | 18 ++++---- crates/test-ui/ui/invalid_sel.stderr | 18 ++++++++ crates/test-ui/ui/ns_string_not_const.stderr | 42 +++++++++++++++---- 4 files changed, 99 insertions(+), 18 deletions(-) diff --git a/crates/test-ui/ui/invalid_msg_send.stderr b/crates/test-ui/ui/invalid_msg_send.stderr index d038741f9..32718e7d1 100644 --- a/crates/test-ui/ui/invalid_msg_send.stderr +++ b/crates/test-ui/ui/invalid_msg_send.stderr @@ -3,12 +3,24 @@ error: unexpected end of macro invocation | | let _: () = unsafe { msg_send![obj] }; | ^ missing tokens in macro arguments + | +note: while trying to match `,` + --> $WORKSPACE/crates/objc2/src/macros.rs + | + | [$obj:expr, $($selector_and_arguments:tt)+] => { + | ^ error: unexpected end of macro invocation --> ui/invalid_msg_send.rs | | let _: () = unsafe { msg_send![obj,] }; | ^ missing tokens in macro arguments + | +note: while trying to match meta-variable `$selector_and_arguments:tt` + --> $WORKSPACE/crates/objc2/src/macros.rs + | + | [$obj:expr, $($selector_and_arguments:tt)+] => { + | ^^^^^^^^^^^^^^^^^^^^^^^^^^ error: no rules expected the token `)` --> ui/invalid_msg_send.rs @@ -16,6 +28,11 @@ error: no rules expected the token `)` | let _: () = unsafe { msg_send![obj, a:] }; | ^^^^^^^^^^^^^^^^^^ no rules expected this token in macro call | +note: while trying to match `_` + --> $WORKSPACE/crates/objc2/src/macros/__msg_send_parse.rs + | + | @($selector:ident: _ $(,)?) + | ^ = note: this error originates in the macro `msg_send` (in Nightly builds, run with -Z macro-backtrace for more info) error: no rules expected the token `)` @@ -24,6 +41,11 @@ error: no rules expected the token `)` | let _: () = unsafe { msg_send![obj, a: b c] }; | ^^^^^^^^^^^^^^^^^^^^^^ no rules expected this token in macro call | +note: while trying to match `:` + --> $WORKSPACE/crates/objc2/src/macros/__msg_send_parse.rs + | + | @($($selector:ident : $argument:expr)*) + | ^ = note: this error originates in the macro `msg_send` (in Nightly builds, run with -Z macro-backtrace for more info) error: no rules expected the token `a` @@ -32,6 +54,11 @@ error: no rules expected the token `a` | let _: () = unsafe { msg_send![obj, a: b, c d] }; | ^^^^^^^^^^^^^^^^^^^^^^^^^ no rules expected this token in macro call | +note: while trying to match `)` + --> $WORKSPACE/crates/objc2/src/macros/__msg_send_parse.rs + | + | @() + | ^ = note: this error originates in the macro `$crate::__msg_send_parse` which comes from the expansion of the macro `msg_send` (in Nightly builds, run with -Z macro-backtrace for more info) error: no rules expected the token `,` @@ -39,12 +66,24 @@ error: no rules expected the token `,` | | let _: () = unsafe { msg_send![obj, a: b c: d,] }; | ^ no rules expected this token in macro call + | +note: while trying to match `)` + --> $WORKSPACE/crates/objc2/src/macros/__msg_send_parse.rs + | + | @($($selector:ident : $argument:expr)*) + | ^ error: no rules expected the token `b` --> ui/invalid_msg_send.rs | | let _: Result<(), Id> = unsafe { msg_send![obj, a: _, b: _] }; | ^ no rules expected this token in macro call + | +note: while trying to match `)` + --> $WORKSPACE/crates/objc2/src/macros/__msg_send_parse.rs + | + | @($selector:ident: _ $(,)?) + | ^ error[E0412]: cannot find type `c` in this scope --> ui/invalid_msg_send.rs diff --git a/crates/test-ui/ui/invalid_ns_string_input.stderr b/crates/test-ui/ui/invalid_ns_string_input.stderr index 21286133c..b999953e0 100644 --- a/crates/test-ui/ui/invalid_ns_string_input.stderr +++ b/crates/test-ui/ui/invalid_ns_string_input.stderr @@ -4,26 +4,26 @@ error[E0308]: mismatched types | let _ = ns_string!(1u8); | ^^^ expected `&str`, found `u8` -error[E0080]: evaluation of constant value failed +note: erroneous constant used --> ui/invalid_ns_string_input.rs | | let _ = ns_string!(1u8); - | ^^^^^^^^^^^^^^^ referenced constant has errors + | ^^^^^^^^^^^^^^^ | - = note: this error originates in the macro `$crate::__ns_string_inner` which comes from the expansion of the macro `ns_string` (in Nightly builds, run with -Z macro-backtrace for more info) + = note: this note originates in the macro `$crate::__ns_string_inner` which comes from the expansion of the macro `ns_string` (in Nightly builds, run with -Z macro-backtrace for more info) -error[E0080]: evaluation of constant value failed +note: erroneous constant used --> ui/invalid_ns_string_input.rs | | let _ = ns_string!(1u8); - | ^^^^^^^^^^^^^^^ referenced constant has errors + | ^^^^^^^^^^^^^^^ | - = note: this error originates in the macro `$crate::__ns_string_inner` which comes from the expansion of the macro `ns_string` (in Nightly builds, run with -Z macro-backtrace for more info) + = note: this note originates in the macro `$crate::__ns_string_inner` which comes from the expansion of the macro `ns_string` (in Nightly builds, run with -Z macro-backtrace for more info) -error[E0080]: evaluation of constant value failed +note: erroneous constant used --> ui/invalid_ns_string_input.rs | | let _ = ns_string!(1u8); - | ^^^^^^^^^^^^^^^ referenced constant has errors + | ^^^^^^^^^^^^^^^ | - = note: this error originates in the macro `$crate::__ns_string_inner` which comes from the expansion of the macro `ns_string` (in Nightly builds, run with -Z macro-backtrace for more info) + = note: this note originates in the macro `$crate::__ns_string_inner` which comes from the expansion of the macro `ns_string` (in Nightly builds, run with -Z macro-backtrace for more info) diff --git a/crates/test-ui/ui/invalid_sel.stderr b/crates/test-ui/ui/invalid_sel.stderr index 396202dfb..18868b874 100644 --- a/crates/test-ui/ui/invalid_sel.stderr +++ b/crates/test-ui/ui/invalid_sel.stderr @@ -3,15 +3,33 @@ error: unexpected end of macro invocation | | sel!(); | ^^^^^^ missing tokens in macro arguments + | +note: while trying to match `alloc` + --> $WORKSPACE/crates/objc2/src/macros.rs + | + | (alloc) => ({ + | ^^^^^ error: unexpected end of macro invocation --> ui/invalid_sel.rs | | sel!(a: b); | ^ missing tokens in macro arguments + | +note: while trying to match `:` + --> $WORKSPACE/crates/objc2/src/macros.rs + | + | ($first:ident $(: $($rest:ident :)*)?) => ({ + | ^ error: unexpected end of macro invocation --> ui/invalid_sel.rs | | sel!(a: b: c); | ^ missing tokens in macro arguments + | +note: while trying to match `:` + --> $WORKSPACE/crates/objc2/src/macros.rs + | + | ($first:ident $(: $($rest:ident :)*)?) => ({ + | ^ diff --git a/crates/test-ui/ui/ns_string_not_const.stderr b/crates/test-ui/ui/ns_string_not_const.stderr index f5f495fda..ec97b1872 100644 --- a/crates/test-ui/ui/ns_string_not_const.stderr +++ b/crates/test-ui/ui/ns_string_not_const.stderr @@ -7,26 +7,50 @@ error[E0435]: attempt to use a non-constant value in a constant | | non-constant value | help: consider using `let` instead of `const`: `let INPUT` -error[E0080]: evaluation of constant value failed +note: erroneous constant used --> ui/ns_string_not_const.rs | | let _ = ns_string!(s); - | ^^^^^^^^^^^^^ referenced constant has errors + | ^^^^^^^^^^^^^ | - = note: this error originates in the macro `$crate::__ns_string_inner` which comes from the expansion of the macro `ns_string` (in Nightly builds, run with -Z macro-backtrace for more info) + = note: this note originates in the macro `$crate::__ns_string_inner` which comes from the expansion of the macro `ns_string` (in Nightly builds, run with -Z macro-backtrace for more info) -error[E0080]: evaluation of constant value failed +note: erroneous constant used --> ui/ns_string_not_const.rs | | let _ = ns_string!(s); - | ^^^^^^^^^^^^^ referenced constant has errors + | ^^^^^^^^^^^^^ | - = note: this error originates in the macro `$crate::__ns_string_inner` which comes from the expansion of the macro `ns_string` (in Nightly builds, run with -Z macro-backtrace for more info) + = note: this note originates in the macro `$crate::__ns_string_inner` which comes from the expansion of the macro `ns_string` (in Nightly builds, run with -Z macro-backtrace for more info) -error[E0080]: evaluation of constant value failed +note: erroneous constant used --> ui/ns_string_not_const.rs | | let _ = ns_string!(s); - | ^^^^^^^^^^^^^ referenced constant has errors + | ^^^^^^^^^^^^^ | - = note: this error originates in the macro `$crate::__ns_string_inner` which comes from the expansion of the macro `ns_string` (in Nightly builds, run with -Z macro-backtrace for more info) + = note: this note originates in the macro `$crate::__ns_string_inner` which comes from the expansion of the macro `ns_string` (in Nightly builds, run with -Z macro-backtrace for more info) + +note: erroneous constant used + --> ui/ns_string_not_const.rs + | + | let _ = ns_string!(s); + | ^^^^^^^^^^^^^ + | + = note: this note originates in the macro `$crate::__ns_string_inner` which comes from the expansion of the macro `ns_string` (in Nightly builds, run with -Z macro-backtrace for more info) + +note: erroneous constant used + --> ui/ns_string_not_const.rs + | + | let _ = ns_string!(s); + | ^^^^^^^^^^^^^ + | + = note: this note originates in the macro `$crate::__ns_string_inner` which comes from the expansion of the macro `ns_string` (in Nightly builds, run with -Z macro-backtrace for more info) + +note: erroneous constant used + --> ui/ns_string_not_const.rs + | + | let _ = ns_string!(s); + | ^^^^^^^^^^^^^ + | + = note: this note originates in the macro `$crate::__ns_string_inner` which comes from the expansion of the macro `ns_string` (in Nightly builds, run with -Z macro-backtrace for more info) From 00026366219da38f7dfa38c95143f879f3f4901e Mon Sep 17 00:00:00 2001 From: Mads Marquart Date: Wed, 23 Nov 2022 09:06:35 +0100 Subject: [PATCH 6/6] CI: Don't cache target folder when using nightly Rust --- .github/workflows/ci.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 5f5ff6403..c8dc1dad0 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -310,6 +310,7 @@ jobs: key: cargo-${{ matrix.name }}-${{ hashFiles('**/Cargo.toml') }} - name: Cache Rust Target + if: ${{ !contains(matrix.rust.toolchain, 'nightly') }} uses: actions/cache@v3 with: path: |