Check minimal rustc version on the build process
Before adoption: this commit came in with the history the project adopted, so no landing records it.
authored by Adit Cahya Ramadhan · committed by David Peter · parent 26f71dd · Browse files · 3 files·+21 added−0 removed
This commit
State
Before adoption: this commit came in with the history the project adopted, so no landing records it.
Diff stats
3 files+21 added−0 removed
- other:+21 added−0 removed
Provenance
- Commit
6733920- Tree
727b6bd- Author
Adit Cahya Ramadhan <matematika.adit@gmail.com>- Committer
David Peter <sharkdp@users.noreply.github.com>- Parent
26f71dd
3 files changed+21 added−0 removed
modified:build.rs+13 added
6 unmodified lines7 // according to those terms.8 9 #[macro_use]10 extern crate clap;11+extern crate version_check;12 13 use clap::Shell;14+use std::io::{self, Write};15+use std::process::exit;16 17 include!("src/app.rs");18 19 fn main() {20+ match version_check::is_min_version("1.19") {21+ // rustc >= 1.1922+ Some((true, _)) => {}23+ // rustc < 1.19 or can't figure it out24+ _ => {25+ writeln!(&mut io::stderr(), "This crate requires rustc >= 1.19").unwrap();26+ exit(1);27+ }28+ }29+30 let var = std::env::var_os("SHELL_COMPLETIONS_DIR").or(std::env::var_os("OUT_DIR"));31 let outdir = match var {32 None => return,33 Some(outdir) => outdir,8 unmodified linesmodified:Cargo.lock+7 added
13 unmodified lines14 "regex 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)",15 "regex-syntax 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)",16 "shell-escape 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)",17 "tempdir 0.3.5 (registry+https://github.com/rust-lang/crates.io-index)",18+ "version_check 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)",19 "winapi 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)",20 ]21 22 [[package]]284 unmodified lines307 version = "0.8.0"308 source = "registry+https://github.com/rust-lang/crates.io-index"309 310 [[package]]311+name = "version_check"312+version = "0.1.3"313+source = "registry+https://github.com/rust-lang/crates.io-index"314+315+[[package]]316 name = "void"317 version = "1.0.2"318 source = "registry+https://github.com/rust-lang/crates.io-index"319 55 unmodified lines375 "checksum unicode-width 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)" = "bf3a113775714a22dcb774d8ea3655c53a32debae63a063acc00a91cc586245f"376 "checksum unreachable 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)" = "382810877fe448991dfc7f0dd6e3ae5d58088fd0ea5e35189655f84e6814fa56"377 "checksum utf8-ranges 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)" = "662fab6525a98beff2921d7f61a39e7d59e0b425ebc7d0d9e66d316e55124122"378 "checksum vec_map 0.8.0 (registry+https://github.com/rust-lang/crates.io-index)" = "887b5b631c2ad01628bbbaa7dd4c869f80d3186688f8d0b6f58774fbe324988c"379+"checksum version_check 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)" = "6b772017e347561807c1aa192438c5fd74242a670a6cffacc40f2defd1dc069d"380 "checksum void 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)" = "6a02e4885ed3bc0f2de90ea6dd45ebcbb66dacffe03547fadbb0eeae2770887d"381 "checksum walkdir 1.0.7 (registry+https://github.com/rust-lang/crates.io-index)" = "bb08f9e670fab86099470b97cd2b252d6527f0b3cc1401acdb595ffc9dd288ff"382 "checksum winapi 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)" = "167dc9d6949a9b857f3451275e911c3f44255842c1f7a76f33c55103a909087a"383 "checksum winapi-build 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "2d315eee3b34aca4797b2da6b13ed88266e6d612562a0c46390af8299fc699bc"modified:Cargo.toml+1 added
27 unmodified lines28293031323334353618 unmodified lines27 unmodified linesrepository = "sharkdp/fd"
[build-dependencies]clap = "2.26.0"version_check = "0.1.3"
[dependencies]ansi_term = "0.9"atty = "0.2"18 unmodified lines