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 CI #62

Closed
wants to merge 4 commits into from
Closed

Conversation

schneems
Copy link
Contributor

There is a bug in the current CI suite with autocfg that was fixed in cuviper/autocfg#70 (autocfg 1.4+).

Rust 1.80 introduced a new lint that was causing the build to fail on CI. I deleted the lockfile and reinstalled and that fixed the issue.

Previously the failure on CI looked like this:

Run actions-rs/cargo@v1
/home/runner/.cargo/bin/cargo test
 Downloading crates ...
  Downloaded itoa v1.0.[9](https://github.com/andrewhickman/fs-err/actions/runs/11391081315/job/31694081963?pr=61#step:6:10)
  Downloaded serde v1.0.192
  Downloaded ryu v1.0.15
  Downloaded serde_json v1.0.[10](https://github.com/andrewhickman/fs-err/actions/runs/11391081315/job/31694081963?pr=61#step:6:11)0
   Compiling serde v1.0.192
   Compiling serde_json v1.0.100
   Compiling ryu v1.0.15
   Compiling itoa v1.0.9
warning: unexpected `cfg` condition name: `rustc_1_63`
  --> src/path.rs:16:[11](https://github.com/andrewhickman/fs-err/actions/runs/11391081315/job/31694081963?pr=61#step:6:12)
   |
16 |     #[cfg(rustc_1_63)]
   |           ^^^^^^^^^^
   |
   = help: expected names are: `clippy`, `debug_assertions`, `doc`, `docsrs`, `doctest`, `feature`, `fmt_debug`, `miri`, `overflow_checks`, `panic`, `proc_macro`, `relocation_model`, `rustfmt`, `sanitize`, `sanitizer_cfi_generalize_pointers`, `sanitizer_cfi_normalize_integers`, `target_abi`, `target_arch`, `target_endian`, `target_env`, `target_family`, `target_feature`, `target_has_atomic`, `target_has_atomic_equal_alignment`, `target_has_atomic_load_store`, `target_os`, `target_pointer_width`, `target_thread_local`, `target_vendor`, `test`, `ub_checks`, `unix`, and `windows`
   = help: consider using a Cargo feature instead
   = help: or consider adding in `Cargo.toml` the `check-cfg` lint config for the lint:
            [lints.rust]
            unexpected_cfgs = { level = "warn", check-cfg = ['cfg(rustc_1_63)'] }
   = help: or consider adding `println!("cargo::rustc-check-cfg=cfg(rustc_1_63)");` to the top of the `build.rs`
   = note: see <https://doc.rust-lang.org/nightly/rustc/check-cfg/cargo-specifics.html> for more information about checking conditional configuration
   = note: `#[warn(unexpected_cfgs)]` on by default

There is a bug in the current CI suite with autocfg that was fixed in cuviper/autocfg#70 (autocfg 1.4+).  

Rust 1.80 introduced a new lint that was causing the build to fail on CI. I deleted the lockfile and reinstalled and that fixed the issue.

Previously the failure on CI looked like this:

```
Run actions-rs/cargo@v1
/home/runner/.cargo/bin/cargo test
 Downloading crates ...
  Downloaded itoa v1.0.[9](https://github.com/andrewhickman/fs-err/actions/runs/11391081315/job/31694081963?pr=61#step:6:10)
  Downloaded serde v1.0.192
  Downloaded ryu v1.0.15
  Downloaded serde_json v1.0.[10](https://github.com/andrewhickman/fs-err/actions/runs/11391081315/job/31694081963?pr=61#step:6:11)0
   Compiling serde v1.0.192
   Compiling serde_json v1.0.100
   Compiling ryu v1.0.15
   Compiling itoa v1.0.9
warning: unexpected `cfg` condition name: `rustc_1_63`
  --> src/path.rs:16:[11](https://github.com/andrewhickman/fs-err/actions/runs/11391081315/job/31694081963?pr=61#step:6:12)
   |
16 |     #[cfg(rustc_1_63)]
   |           ^^^^^^^^^^
   |
   = help: expected names are: `clippy`, `debug_assertions`, `doc`, `docsrs`, `doctest`, `feature`, `fmt_debug`, `miri`, `overflow_checks`, `panic`, `proc_macro`, `relocation_model`, `rustfmt`, `sanitize`, `sanitizer_cfi_generalize_pointers`, `sanitizer_cfi_normalize_integers`, `target_abi`, `target_arch`, `target_endian`, `target_env`, `target_family`, `target_feature`, `target_has_atomic`, `target_has_atomic_equal_alignment`, `target_has_atomic_load_store`, `target_os`, `target_pointer_width`, `target_thread_local`, `target_vendor`, `test`, `ub_checks`, `unix`, and `windows`
   = help: consider using a Cargo feature instead
   = help: or consider adding in `Cargo.toml` the `check-cfg` lint config for the lint:
            [lints.rust]
            unexpected_cfgs = { level = "warn", check-cfg = ['cfg(rustc_1_63)'] }
   = help: or consider adding `println!("cargo::rustc-check-cfg=cfg(rustc_1_63)");` to the top of the `build.rs`
   = note: see <https://doc.rust-lang.org/nightly/rustc/check-cfg/cargo-specifics.html> for more information about checking conditional configuration
   = note: `#[warn(unexpected_cfgs)]` on by default
```
Rust 1.40.0 fails to install due to 

```
error: failed to select a version for the requirement `addr2line = "= 0.24.2"`
  candidate versions found which didn't match: 0.22.0, 0.21.0, 0.20.0, ...
  location searched: crates.io index
required by package `backtrace v0.3.74`
    ... which is depended on by `tokio v1.40.0`
    ... which is depended on by `fs-err v2.11.0 (/home/runner/work/fs-err/fs-err)`
```

The addr2line 0.24.2 library targets 1.65 as the minimum version https://crates.io/crates/addr2line/0.24.2 which is below 1.40.

Calling `cargo update` unconditionally will re-resolve the dependencies, allowing cargo to find a version of addr2line that satisfies version dependencies.
@schneems schneems changed the title Update lockfile Fix CI Oct 17, 2024
```
Run actions-rs/cargo@v1
  with:
    command: test
    use-cross: false
  env:
    CARGO_INCREMENTAL: 0
    CARGO_TERM_COLOR: always
/home/runner/.cargo/bin/cargo test
 Downloading crates ...
  Downloaded serde_json v1.0.129
error: failed to parse manifest at `/home/runner/.cargo/registry/src/github.com-1ecc6299db9ec823/serde_json-1.0.129/Cargo.toml`
Caused by:
  failed to parse the `edition` key
Caused by:
  supported edition values are `2015` or `2018`, but `2021` is unknown
```

From https://www.reddit.com/r/rust/comments/sjoht3/receiving_error_supported_edition_values_are_2015/ `2021` was added in 1.56.0
@schneems schneems marked this pull request as ready for review October 17, 2024 20:00
@schneems schneems mentioned this pull request Oct 17, 2024
@schneems
Copy link
Contributor Author

I'm assuming that "build (ubuntu-latest, 1.40.0) Expected—Waiting for status to be reported" is a required test in the repo settings. It will need to be updated to 1.56.0 (I don't have access to the settings).

@andrewhickman
Copy link
Owner

I realized the "cargo update" step in CI has been broken since I added it, which is why the autocfg fix wasn't being picked up. With that fixed in #64 we can avoid increasing the minimum tested rust version (for now)

@schneems
Copy link
Contributor Author

it looks like the strategy is to have a Cargo.lock that works with Rust 1.40 and then use “cargo update” on other rust versions. If I’m reading your patch correctly.

Nice work. I didn’t love my solution (specifically the rev-ing the min tested version), but didn’t fully understand the system setup.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants