sergiobenitez / version_check Goto Github PK
View Code? Open in Web Editor NEWRust library for checking the installed/running rustc's version.
Home Page: https://docs.rs/version_check
License: Apache License 2.0
Rust library for checking the installed/running rustc's version.
Home Page: https://docs.rs/version_check
License: Apache License 2.0
I'm trying to build my project with rocket, I got:
Error: Pear requires a nightly or dev version of Rust.
Installed version is: 1.28.0 (2018-07-30). Minimum required: 1.28.0-nightly (2018-06-23).
thread 'main' panicked at 'Aborting compilation due to incompatible compiler.', /home/divinespear/.cargo/registry/src/github.com-1ecc6299db9ec823/pear_codegen-0.0.19/build.rs:31:13
1.28.0 should be greater then 1.28.0-nightly, but...
Dear Dev,
there is a bug in this crate in combination with env. variables.
I found out because lazy_static crate failed to compile, they depent on your crate.
However the error is not related to lazy_static, only to env. variables on the system.
Usually i compile with some logging enabled. for that i set the RUST_LOG env. variable.
However i have a invalid configuration of this env, variable.
it is set to show warning, and this seems to changed and now produces a warning.
However, the env. variable does not only affect my compilation of RUST_BACKTRACE=1 RUST_LOG=cargo=warning,server=debug,server-cli=debug,common=debug,region::vol_per=debug,world=debug cargo build
. but it seems also to be applied to all underlying processes (AFAIK!) .
So i noticed your crate has a problem parsing the version when the env variable is set. And as far as i understand the code it is calling rustc --version
and parsing the output.
However, when these env variables are set. then the output of rustc --version
is changed.
And i suspect that this is the point where the is_min_version does no longer works and returns None.
btw, this is an example:
$( cd voxygen && time RUST_BACKTRACE=1 RUST_LOG=cargo=warning,server=debug,server-cli=debug,common=debug,region::vol_per=debug,world=debug rustc --version)
warning: invalid logging spec 'warning', ignoring it
rustc 1.30.0-nightly (63c75d375 2018-09-21)
RUST_BACKTRACE=1 RUST_LOG= rustc --version 0.01s user 0.01s system 98% cpu 0.019 total
See, the warning is outputted first before the version is returned.
Is there a way to fix this problem ? i would suggest either to set RUST_LOG="" while executing the rustc command or maybe parse each line on it's own.
Thank you very much for your time
Could methods be added to get the major, minor, and patch numbers from the Version
struct? This would allow me to treat the minor version of a nightly as two versions prior, which is needed for my use case.
Not sure what is happening, I'm using:
rustc 1.46.0-nightly (346aec9b0 2020-07-11)
❯ cargo check
Compiling libc v0.2.72
Compiling syn v1.0.34
Compiling unicase v2.6.0
Compiling nom v5.1.2
error[E0514]: found crate `version_check` compiled by an incompatible version of rustc
--> /home/bbigras/.cargo/registry/src/github.com-1ecc6299db9ec823/unicase-2.6.0/build.rs:1:1
|
1 | extern crate version_check as rustc;
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= help: please recompile that crate using this compiler (rustc 1.46.0-nightly (346aec9b0 2020-07-11))
= note: the following crate versions were found:
crate `version_check` compiled by rustc 1.46.0-nightly (2753fab7c 2020-07-05): /home/bbigras/dev/accounts/target/debug/deps/libversion_check-2cd6fef79a179064.rlib
error: aborting due to previous error
error: could not compile `unicase`.
To learn more, run the command again with --verbose.
warning: build failed, waiting for other jobs to finish...
error[E0514]: found crate `version_check` compiled by an incompatible version of rustc
--> /home/bbigras/.cargo/registry/src/github.com-1ecc6299db9ec823/nom-5.1.2/build.rs:1:1
|
1 | extern crate version_check;
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= help: please recompile that crate using this compiler (rustc 1.46.0-nightly (346aec9b0 2020-07-11))
= note: the following crate versions were found:
crate `version_check` compiled by rustc 1.46.0-nightly (2753fab7c 2020-07-05): /home/bbigras/dev/accounts/target/debug/deps/libversion_check-2cd6fef79a179064.rlib
error: aborting due to previous error
error: build failed
The current version of version_check on crates.io is 0.9.3, but the latest commit on branch master, dba2352, still has version 0.9.2.
Can the repository please be updated to include the latest code as of version 0.9.3? Thanks. :)
This project doesn't appear to have CI config (.travis.yml
, etc.) as de facto standard minimum supported rust version (MSRV) expression. Do you know what the MSRV actually is for this crate? Could we document that?
The reason is that if someone (like me) wants to use version_check
to enforce MSRV, and return a better error message, then we need to know what the MSRV of the version_check dependency is.
I can confirm it works as far back as rust 1.16.0. If you don't already know, then I guess I can binary search for the magic MSRV.
Also, would you be willing to consider CI to maintain that MSRV?
Thanks for releasing this!
The following error is shown while using version_check
as a dependency:
warning: use of deprecated item 'core::str::<impl str>::trim_right': superseded by `trim_end`
--> /home/trivikr/.cargo/registry/src/github.com-1ecc6299db9ec823/version_check-0.1.5/src/lib.rs:92:44
|
92 | let date = components.nth(1).map(|s| s.trim_right().trim_right_matches(")"));
| ^^^^^^^^^^ help: replace the use of the deprecated item: `trim_end`
|
= note: #[warn(deprecated)] on by default
warning: use of deprecated item 'core::str::<impl str>::trim_right_matches': superseded by `trim_end_matches`
--> /home/trivikr/.cargo/registry/src/github.com-1ecc6299db9ec823/version_check-0.1.5/src/lib.rs:92:57
|
92 | let date = components.nth(1).map(|s| s.trim_right().trim_right_matches(")"));
| ^^^^^^^^^^^^^^^^^^ help: replace the use of the deprecated item: `trim_end_matches`
It needs to be updated at
Lines 91 to 92 in 98871bd
It would be nice :)
The code below unexpectedly prints 1.2
. I'd expect parse
to return None
in this case.
println!("{}", version_check::Version::parse("1.65536.2").unwrap());
I tried setting RUSTFLAGS="-Zallow-features=rustc_private"
, but compilation of ahash fails version_check thinks it can use min_specialization
and stdsimd
.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.