Code Monkey home page Code Monkey logo

version_check's People

Contributors

cuviper avatar jhpratt avatar mibac138 avatar peterjoel avatar sergiobenitez avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

version_check's Issues

wrong version check

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...

Erros with env variable

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

Check doesn't work with rust on Arch Linux

When trying to compile ion, a script (build.rs) checks the rust version but it outputs (see code for details)

warning: Ion was unable to check rustc compatibility.
warning: Build may fail due to incompatible rustc version.
$ rustc --version
rustc 1.18.0

Ability to get major, minor, patch from `Version`

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.

found crate `version_check` compiled by an incompatible version of rustc

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

Document MSRV of this crate

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!

rustc warning: trim_right -> trim_end

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

version_check/src/lib.rs

Lines 91 to 92 in 98871bd

let date = components.filter(|c| c.ends_with(')')).next()
.map(|s| s.trim_right().trim_right_matches(")").trim_left().trim_left_matches('('));

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.