Skip to content

Explicitly run +nightly for -Zcheck-cfg pass in ci. #12230

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

Merged
merged 3 commits into from
Mar 1, 2024

Conversation

targrub
Copy link
Contributor

@targrub targrub commented Mar 1, 2024

Objective

Getting this error running ci locally.

$ cargo check -Zcheck-cfg --workspace
error: the `-Z` flag is only accepted on the nightly channel of Cargo, but this is the `stable` channel
See https://doc.rust-lang.org/book/appendix-07-nightly-rust.html for more information about Rust release channels.
thread 'main' panicked at tools\ci\src\main.rs:166:14:
Please fix failing cfg checks in output above.: command exited with non-zero code `cargo check -Zcheck-cfg --workspace`: 101

Solution

  • Add +nightly flag to the check-cfg pass.

Obviously we shouldn't be running nightly Cargo, but at least now local running of cargo run -p ci will pass.

@rparrett
Copy link
Contributor

rparrett commented Mar 1, 2024

I am seeing this output locally:

 cargo run -p ci cfg-check
    Blocking waiting for file lock on build directory
   Compiling ci v0.1.0 (/Users/me/src/bevy/tools/ci)
    Finished dev [unoptimized + debuginfo] target(s) in 13.70s
     Running `target/debug/ci cfg-check`
$ cargo check +nightly -Zcheck-cfg --workspace
error: unexpected argument '+nightly' found

@targrub
Copy link
Contributor Author

targrub commented Mar 1, 2024

Note: The PR for cfg-check was #12103.

@mockersf mockersf added A-Build-System Related to build systems or continuous integration S-Ready-For-Final-Review This PR has been approved by the community. It's ready for a maintainer to consider merging it labels Mar 1, 2024
@mockersf mockersf added this pull request to the merge queue Mar 1, 2024
@BD103
Copy link
Member

BD103 commented Mar 1, 2024

Perhaps in the future it would be nice to check whether CI is being compiled from a nightly toolchain or not (I'm thinking build.rs or env!?), to dynamically skip check-cfg.

Merged via the queue into bevyengine:main with commit fc0aa4f Mar 1, 2024
@targrub
Copy link
Contributor Author

targrub commented Mar 1, 2024

... previous cargo run -p ci output
...
$ cargo +nightly check -Zcheck-cfg --workspace
error: no such command: `+nightly`

        Cargo does not handle `+toolchain` directives.
        Did you mean to invoke `cargo` through `rustup` instead?
thread 'main' panicked at tools\ci\src\main.rs:166:14:
Please fix failing cfg checks in output above.: command exited with non-zero code `cargo +nightly check -Zcheck-cfg --workspace`: 101

That's what I get from cargo run -p ci. But if I run cargo +nightly check -Zcheck-cfg --workspace separately, it works.

spectria-limina pushed a commit to spectria-limina/bevy that referenced this pull request Mar 9, 2024
…2230)

# Objective

Getting this error running ci locally.

```
$ cargo check -Zcheck-cfg --workspace
error: the `-Z` flag is only accepted on the nightly channel of Cargo, but this is the `stable` channel
See https://doc.rust-lang.org/book/appendix-07-nightly-rust.html for more information about Rust release channels.
thread 'main' panicked at tools\ci\src\main.rs:166:14:
Please fix failing cfg checks in output above.: command exited with non-zero code `cargo check -Zcheck-cfg --workspace`: 101
```

## Solution

- Add `+nightly` flag to the `check-cfg` pass.

---

Obviously we shouldn't be running `nightly` Cargo, but at least now
local running of `cargo run -p ci` will pass.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-Build-System Related to build systems or continuous integration S-Ready-For-Final-Review This PR has been approved by the community. It's ready for a maintainer to consider merging it
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants