-
Notifications
You must be signed in to change notification settings - Fork 790
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
Fails to compile with minimal dependency versions (due to old lexical-core) #1298
Comments
I'm not sure #1156 is related, but older |
Here is a thread that explained to me what's wrong with lexical-core 0.7.4 |
hello, I just tried with a separate crate like you said, and rust 1.51.0, and I do not see the issue, is it still appearing for you? |
Yes, it still happens (with rust 1.53.0 (53cb7b09b 2021-06-17)). terminal log
Don't forget to generate Cargo.lock# This file is automatically @generated by Cargo.
# It is not intended for manual editing.
version = 3
[[package]]
name = "arrayvec"
version = "0.4.8"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "f405cc4c21cd8b784f6c8fc2adf9bc00f59558f0049b5ec21517f875963040cc"
dependencies = [
"nodrop",
]
[[package]]
name = "cfg-if"
version = "0.1.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "de1e760d7b6535af4241fca8bd8adf68e2e7edacc6b29f5d399050c5e48cf88c"
[[package]]
name = "lexical-core"
version = "0.6.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "8d85a493100782284591421ff88bdc866237dc61627017a9fe13cc340b8014e2"
dependencies = [
"arrayvec",
"cfg-if",
"rustc_version",
"ryu",
"static_assertions",
]
[[package]]
name = "memchr"
version = "2.0.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "e01e64d9017d18e7fc09d8e4fe0e28ff6931019e979fb8019319db7ca827f8a6"
[[package]]
name = "nodrop"
version = "0.1.12"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "9a2228dca57108069a5262f2ed8bd2e82496d2e074a06d1ccc7ce1687b6ae0a2"
[[package]]
name = "nom"
version = "6.1.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "e7413f999671bd4745a7b624bd370a569fb6bc574b23c83a3c5ed2e453f3d5e2"
dependencies = [
"lexical-core",
"memchr",
"version_check",
]
[[package]]
name = "rustc_version"
version = "0.2.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "1e114e275f7c9b5d50bb52b28f9aac1921209f02aa6077c8b255e21eefaf8ffa"
dependencies = [
"semver",
]
[[package]]
name = "ryu"
version = "1.0.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "c92464b447c0ee8c4fb3824ecc8383b81717b9f1e74ba2e72540aef7b9f82997"
[[package]]
name = "semver"
version = "0.6.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "7a3186ec9e65071a2095434b1f5bb24838d4e8e130f584c790f6033c79943537"
dependencies = [
"semver-parser",
]
[[package]]
name = "semver-parser"
version = "0.7.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "388a1df253eca08550bef6c72392cfe7c30914bf41df5269b68cbd6ff8f570a3"
[[package]]
name = "static_assertions"
version = "0.3.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "b4f8de36da215253eb5f24020bfaa0646613b48bf7ebe36cdfa37c3b3b33b241"
[[package]]
name = "temp"
version = "0.1.0"
dependencies = [
"nom",
]
[[package]]
name = "version_check"
version = "0.9.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "45d3d553fd9413fffe7147a20171d640eda0ad4c070acd7d0c885a21bcd2e8b7" |
About |
TL;DR
lexical-core
dependency should be bumped to^0.7.5
.(Strictly, it is enough if
^0.7.5 OR ^0.6.4
can be specified, but it doesn't seem to be possible with the current Cargo.toml format.)Prerequisites
rustc 1.51.0 (2fd73fabe 2021-03-23)
6.1.2
(released on 2021-02-15)lexical
enabled (e.g.default-features = false, features = ["lexical"]
)Test case
While I'm not sure why, this problem cannot be reproduced by tests inside the nom repository.
In order to reproduce, you have to set up another tiny crate, which depends on nom.
(Actually,
lexical-core = "=0.6.2"
orlexical-core = "=0.7.4"
seem to cause the same problem.)// lib.rs, empty.
Then, run
cargo +nightly update -Z minimal-versions ; cargo check
.Note that
cargo +nightly update -Z minimal-versions
only regeneratesCargo.lock
with old dependency verisons as possible, in contrast tocargo update
(which regeneratesCargo.lock
with new dependency verisons as possible).Once the lock file is regenerated,
cargo check
or normal build can be done by stable rustc.Compile error message (long)
Cause
Currently, nom depends on lexical-core crate
>= 0.6, < 0.8
, but this is problematic.https://github.com/Geal/nom/blob/d1aff18e3c6b03bf3a1b6ca2826417c48995f4c1/Cargo.toml#L62
This problem is fixed by lexical-core
^0.6.4
OR^0.7.5
, so nom should pull only these newer versions.However, it seems that cargo does not allow such "OR" condition.
In order to avoid this problem (i.e. to stop allowing invalid (non-compilable) dependency to be accepted), nom should depend on lexical-core
^0.7.5
.The text was updated successfully, but these errors were encountered: