Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix various CI issues #292

Merged
merged 6 commits into from
Nov 23, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 11 additions & 7 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -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"
Expand All @@ -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
Expand Down Expand Up @@ -162,11 +165,11 @@ jobs:
runs-on: ${{ matrix.os }}

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3

- 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
Expand Down Expand Up @@ -297,7 +300,7 @@ jobs:
ls -al $HOME/extern/*

- name: Cache Cargo
uses: actions/cache@v2
uses: actions/cache@v3
with:
path: |
~/.cargo/bin/
Expand All @@ -307,7 +310,8 @@ jobs:
key: cargo-${{ matrix.name }}-${{ hashFiles('**/Cargo.toml') }}

- name: Cache Rust Target
uses: actions/cache@v2
if: ${{ !contains(matrix.rust.toolchain, 'nightly') }}
uses: actions/cache@v3
with:
path: |
target/
Expand Down
2 changes: 1 addition & 1 deletion crates/objc2-encode/src/encode.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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
}

Expand Down
39 changes: 39 additions & 0 deletions crates/test-ui/ui/invalid_msg_send.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -3,19 +3,36 @@ 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
|
| 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 `)`
Expand All @@ -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`
Expand All @@ -32,19 +54,36 @@ 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 `,`
--> ui/invalid_msg_send.rs
|
| 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<Object, Shared>> = 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
Expand Down
18 changes: 9 additions & 9 deletions crates/test-ui/ui/invalid_ns_string_input.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -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)
18 changes: 18 additions & 0 deletions crates/test-ui/ui/invalid_sel.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -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 :)*)?) => ({
| ^
42 changes: 33 additions & 9 deletions crates/test-ui/ui/ns_string_not_const.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -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)