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

cargo msrv verify fails #639

Open
wt opened this issue Aug 27, 2023 · 1 comment
Open

cargo msrv verify fails #639

wt opened this issue Aug 27, 2023 · 1 comment

Comments

@wt
Copy link
Contributor

wt commented Aug 27, 2023

The cargo msrv verification fails since some dependency requires once_cell. The github action does not find this as it doesn't actually use cargo-msrv to find the msrv. The action only seems to verify that cargo check works on the currently defined toolchain that is installed (1.52 right now). I am not sure why that works on 1.52 when cargo msrv verify reports that 1.52 doesn't work when the cargo check in the action environment seems to work. I think this may have something to do with some deps requiring wasm support, but I'm not totally sure if that's the key.

I recommend that we change the action to use the cargo msrv verify to verify the version. If that verification fails, we can run cargo msrv search process to find the actual MSRV.

If this sounds reasonable, I can help implement such a thing.

FWIW, the current true MSRV is 1.60 when running cargo msrv.

Here's an example of the output from cargo msrv --output-format json verify:

{"reason":"fetching-index"}
{"reason":"mode","mode":"verify-msrv","toolchain":"x86_64-unknown-linux-gnu","check_cmd":"cargo check"}
{"reason":"installing","version":"1.52.1","step":0,"total":1,"toolchain":"x86_64-unknown-linux-gnu","check_cmd":"cargo check"}
{"reason":"checking","version":"1.52.1","step":0,"total":1,"toolchain":"x86_64-unknown-linux-gnu","check_cmd":"cargo check"}
{"reason":"check-complete","version":"1.52.1","step":0,"total_steps":1,"success":false,"toolchain":"x86_64-unknown-linux-gnu","check_cmd":"cargo check"}
{"reason":"verify-complete","success":false,"toolchain":"x86_64-unknown-linux-gnu","check_cmd":"cargo check"}

Here's part of the output of cargo msrv --output-format json verify | jq -r 'select(.version == "1.57.0")':

{
  "reason": "checking",
  "version": "1.57.0",
  "step": 2,
  "total": 11,
  "toolchain": "x86_64-unknown-linux-gnu",
  "check_cmd": "cargo check"
}
{
  "reason": "installing",
  "version": "1.57.0",
  "step": 2,
  "total": 11,
  "toolchain": "x86_64-unknown-linux-gnu",
  "check_cmd": "cargo check"
}
{
  "reason": "checking",
  "version": "1.57.0",
  "step": 2,
  "total": 11,
  "toolchain": "x86_64-unknown-linux-gnu",
  "check_cmd": "cargo check"
}
{
  "reason": "check-complete",
  "version": "1.57.0",
  "step": 2,
  "total_steps": 11,
  "success": false,
  "toolchain": "x86_64-unknown-linux-gnu",
  "check_cmd": "cargo check"
}
{
  "reason": "last-check-failure-message",
  "version": "1.57.0",
  "experimental": true,
  "toolchain": "1.57.0-x86_64-unknown-linux-gnu",
  "error_message": "    Updating crates.io index\nerror: failed to select a version for the requirement `once_cell = \"^1.12\"`\ncandidate versions found which didn't match: 1.17.2, 1.17.1, 1.17.0, ...\nlocation searched: crates.io index\nrequired by package `wasm-bindgen-backend v0.2.83`\n    ... which satisfies dependency `wasm-bindgen-backend = \"=0.2.83\"` (locked to 0.2.83) of package `wasm-bindgen-macro-support v0.2.83`\n    ... which satisfies dependency `wasm-bindgen-macro-support = \"=0.2.83\"` (locked to 0.2.83) of package `wasm-bindgen-macro v0.2.83`\n    ... which satisfies dependency `wasm-bindgen-macro = \"=0.2.83\"` (locked to 0.2.83) of package `wasm-bindgen v0.2.83`\n    ... which satisfies dependency `wasm-bindgen = \"^0.2.83\"` (locked to 0.2.83) of package `js-sys v0.3.60`\n    ... which satisfies dependency `js-sys = \"^0.3.60\"` (locked to 0.3.60) of package `web-sys v0.3.60`\n    ... which satisfies dependency `web-sys = \"^0.3.51\"` (locked to 0.3.60) of package `plotters v0.3.4`\n    ... which satisfies dependency `plotters = \"^0.3.1\"` (locked to 0.3.4) of package `criterion v0.4.0`\n    ... which satisfies dependency `criterion = \"^0.4\"` (locked to 0.4.0) of package `quick-xml v0.30.0 (/home/wt/projects/xsdpg/quick-xml)`\n"
}
@Mingun
Copy link
Collaborator

Mingun commented Aug 27, 2023

The only required dependency is memchr and our MSRV restricted only by it. Actually, we use some features (I don't mean cargo features here) that requires 1.52. But enabling some cargo features, async-tokio for example, indeed increases MSRV.

cargo tree does not show once_cell in our dependency tree (which includes dependencies when all features is enabled), so I think this is an error of cargo msrv command. Probably this is dependency of one of examples, which, of course, not is a dependency of a crate itself.

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

No branches or pull requests

2 participants