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

ci: minimal version check #3131

Merged
merged 4 commits into from Nov 11, 2020
Merged

ci: minimal version check #3131

merged 4 commits into from Nov 11, 2020

Conversation

Darksonn
Copy link
Contributor

This checks that crates compile with the minimum allowed version of each dependency.

@Darksonn Darksonn added the A-ci Area: The continuous integration setup label Nov 11, 2020
@taiki-e taiki-e self-assigned this Nov 11, 2020
toolchain: ${{ env.nightly }}
override: true
- name: "check --all-features -Z minimal-versions"
run: cargo check --all-features -Z minimal-versions
Copy link
Member

@taiki-e taiki-e Nov 11, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If I remember correctly, cargo check -Z minimal-versions doesn't really do anything. It needs to be separated into cargo update -Z minimal-versions and cargo check.
Also, dev-dependencies may raise version requirements. Ideally, remove them before run cargo update -Z minimal-versions. (Also, note that Cargo.lock is actually shared within the workspace. However as far as I know, there is no workaround for this yet.)

So, I prefer to use commands like:

# Remove dev-dependencies from Cargo.toml to prevent the next `cargo update`
# from determining minimal versions based on dev-dependencies.
cargo hack --remove-dev-deps --workspace
# Update Cargo.lock to minimal version dependencies.
cargo update -Z minimal-versions
cargo check --all-features

(See also pin-project's check-minimal-version script)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'll try that.

@taiki-e
Copy link
Member

taiki-e commented Nov 11, 2020

error: no such subcommand: hack

Did you mean check?

Sorry, I forgot to mention the install of cargo-hack...

@taiki-e
Copy link
Member

taiki-e commented Nov 11, 2020

error: use of deprecated constant std::sync::ONCE_INIT: the new function is now preferred
--> tokio/src/process/unix/mod.rs:65:1
|
65 | / lazy_static::lazy_static! {
66 | | static ref ORPHAN_QUEUE: OrphanQueueImpl = OrphanQueueImpl::new();
67 | | }
| |_^
|
= note: -D deprecated implied by -D warnings
= note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info)

It seems lazy_static's requirement needs to be raised to 1.4.
rust-lang-nursery/lazy-static.rs@1dbd5ae

@Darksonn Darksonn merged commit 6a0e23c into master Nov 11, 2020
@Darksonn Darksonn deleted the min-ver branch November 11, 2020 22:08
bors bot added a commit to crossbeam-rs/crossbeam that referenced this pull request May 31, 2021
710: Correct minimal versions check r=taiki-e a=taiki-e

dev-dependencies may raise version requirements. Ideally, remove them before run `cargo update -Z mimimal-version`.

See also tokio-rs/tokio#3131 (comment).

Co-authored-by: Taiki Endo <te316e89@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-ci Area: The continuous integration setup
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants