Fix up build

Remove regex build dependency; otherwise dependent crates get

  error: crate `regex_syntax` required to be available in rlib format,
        but was not found in this form

And don't default to system clang on OSX
This commit is contained in:
Ryan Dahl 2019-12-27 10:54:26 -05:00 committed by Ry Dahl
parent e24c3aee7d
commit eee7f98108
3 changed files with 5 additions and 78 deletions

43
Cargo.lock generated
View File

@ -1,13 +1,5 @@
# This file is automatically @generated by Cargo.
# It is not intended for manual editing.
[[package]]
name = "aho-corasick"
version = "0.7.6"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"memchr 2.2.1 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
name = "backtrace"
version = "0.3.40"
@ -76,11 +68,6 @@ name = "libc"
version = "0.2.66"
source = "registry+https://github.com/rust-lang/crates.io-index"
[[package]]
name = "memchr"
version = "2.2.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
[[package]]
name = "proc-macro2"
version = "1.0.6"
@ -97,22 +84,6 @@ dependencies = [
"proc-macro2 1.0.6 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
name = "regex"
version = "1.3.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"aho-corasick 0.7.6 (registry+https://github.com/rust-lang/crates.io-index)",
"memchr 2.2.1 (registry+https://github.com/rust-lang/crates.io-index)",
"regex-syntax 0.6.12 (registry+https://github.com/rust-lang/crates.io-index)",
"thread_local 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
name = "regex-syntax"
version = "0.6.12"
source = "registry+https://github.com/rust-lang/crates.io-index"
[[package]]
name = "rustc-demangle"
version = "0.1.16"
@ -126,7 +97,6 @@ dependencies = [
"cargo_gn 0.0.13 (registry+https://github.com/rust-lang/crates.io-index)",
"lazy_static 1.4.0 (registry+https://github.com/rust-lang/crates.io-index)",
"libc 0.2.66 (registry+https://github.com/rust-lang/crates.io-index)",
"regex 1.3.1 (registry+https://github.com/rust-lang/crates.io-index)",
"trybuild 1.0.18 (registry+https://github.com/rust-lang/crates.io-index)",
"which 3.1.0 (registry+https://github.com/rust-lang/crates.io-index)",
]
@ -182,14 +152,6 @@ dependencies = [
"wincolor 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
name = "thread_local"
version = "0.3.6"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"lazy_static 1.4.0 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
name = "toml"
version = "0.5.5"
@ -262,7 +224,6 @@ dependencies = [
]
[metadata]
"checksum aho-corasick 0.7.6 (registry+https://github.com/rust-lang/crates.io-index)" = "58fb5e95d83b38284460a5fda7d6470aa0b8844d283a0b614b8535e880800d2d"
"checksum backtrace 0.3.40 (registry+https://github.com/rust-lang/crates.io-index)" = "924c76597f0d9ca25d762c25a4d369d51267536465dc5064bdf0eb073ed477ea"
"checksum backtrace-sys 0.1.32 (registry+https://github.com/rust-lang/crates.io-index)" = "5d6575f128516de27e3ce99689419835fce9643a9b215a14d2b5b685be018491"
"checksum bitflags 1.2.1 (registry+https://github.com/rust-lang/crates.io-index)" = "cf1de2fe8c75bc145a2f577add951f8134889b4795d47466a54a5c846d691693"
@ -274,11 +235,8 @@ dependencies = [
"checksum itoa 0.4.4 (registry+https://github.com/rust-lang/crates.io-index)" = "501266b7edd0174f8530248f87f99c88fbe60ca4ef3dd486835b8d8d53136f7f"
"checksum lazy_static 1.4.0 (registry+https://github.com/rust-lang/crates.io-index)" = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646"
"checksum libc 0.2.66 (registry+https://github.com/rust-lang/crates.io-index)" = "d515b1f41455adea1313a4a2ac8a8a477634fbae63cc6100e3aebb207ce61558"
"checksum memchr 2.2.1 (registry+https://github.com/rust-lang/crates.io-index)" = "88579771288728879b57485cc7d6b07d648c9f0141eb955f8ab7f9d45394468e"
"checksum proc-macro2 1.0.6 (registry+https://github.com/rust-lang/crates.io-index)" = "9c9e470a8dc4aeae2dee2f335e8f533e2d4b347e1434e5671afc49b054592f27"
"checksum quote 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)" = "053a8c8bcc71fcce321828dc897a98ab9760bef03a4fc36693c231e5b3216cfe"
"checksum regex 1.3.1 (registry+https://github.com/rust-lang/crates.io-index)" = "dc220bd33bdce8f093101afe22a037b8eb0e5af33592e6a9caafff0d4cb81cbd"
"checksum regex-syntax 0.6.12 (registry+https://github.com/rust-lang/crates.io-index)" = "11a7e20d1cce64ef2fed88b66d347f88bd9babb82845b2b858f3edbf59a4f716"
"checksum rustc-demangle 0.1.16 (registry+https://github.com/rust-lang/crates.io-index)" = "4c691c0e608126e00913e33f0ccf3727d5fc84573623b8d65b2df340b5201783"
"checksum ryu 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)" = "bfa8506c1de11c9c4e4c38863ccbe02a305c8188e85a05a784c9e11e1c3910c8"
"checksum serde 1.0.104 (registry+https://github.com/rust-lang/crates.io-index)" = "414115f25f818d7dfccec8ee535d76949ae78584fc4f79a6f45a904bf8ab4449"
@ -286,7 +244,6 @@ dependencies = [
"checksum serde_json 1.0.44 (registry+https://github.com/rust-lang/crates.io-index)" = "48c575e0cc52bdd09b47f330f646cf59afc586e9c4e3ccd6fc1f625b8ea1dad7"
"checksum syn 1.0.11 (registry+https://github.com/rust-lang/crates.io-index)" = "dff0acdb207ae2fe6d5976617f887eb1e35a2ba52c13c7234c790960cdad9238"
"checksum termcolor 1.0.5 (registry+https://github.com/rust-lang/crates.io-index)" = "96d6098003bde162e4277c70665bd87c326f5a0c3f3fbfb285787fa482d54e6e"
"checksum thread_local 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)" = "c6b53e329000edc2b34dbe8545fd20e55a333362d0a321909685a19bd28c3f1b"
"checksum toml 0.5.5 (registry+https://github.com/rust-lang/crates.io-index)" = "01d1404644c8b12b16bfcffa4322403a91a451584daaaa7c28d3152e6cbc98cf"
"checksum trybuild 1.0.18 (registry+https://github.com/rust-lang/crates.io-index)" = "b75e31d624df08744532e935f1d4bfedd319a277d5a162c5b15f6ced59307575"
"checksum unicode-xid 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "826e7639553986605ec5979c7dd957c7895e93eabed50ab2ffa7f6128a75097c"

View File

@ -55,7 +55,6 @@ bitflags = "1.2.1"
[build-dependencies]
cargo_gn = "0.0.13"
which = "3.1.0"
regex = "1.3.1"
[dev-dependencies]
trybuild = "1.0.18"

View File

@ -1,6 +1,5 @@
// Copyright 2018-2019 the Deno authors. All rights reserved. MIT license.
use cargo_gn;
use regex::Regex;
use std::env;
use std::path::Path;
use std::path::PathBuf;
@ -8,10 +7,6 @@ use std::process::exit;
use std::process::Command;
use which::which;
// Update these whenever a V8 upgrade depends on newer clang features
const MIN_APPLE_CLANG_VER: f32 = 11.0;
const MIN_LLVM_CLANG_VER: f32 = 8.0;
fn main() {
// Detect if trybuild tests are being compiled.
let is_trybuild = env::var_os("DENO_TRYBUILD").is_some();
@ -149,28 +144,12 @@ fn need_gn_ninja_download() -> bool {
// but unfortunately it doesn't work with version-suffixed packages commonly
// found in Linux packet managers
fn is_compatible_clang_version(clang_path: &Path) -> bool {
let apple_clang_re =
Regex::new(r"(^Apple (?:clang|LLVM) version) ([0-9]+\.[0-9]+)").unwrap();
let llvm_clang_re =
Regex::new(r"(^(?:FreeBSD )?clang version|based on LLVM) ([0-9]+\.[0-9]+)")
.unwrap();
if let Ok(o) = Command::new(clang_path).arg("--version").output() {
let output = String::from_utf8(o.stdout).unwrap();
if let Some(clang_ver) = apple_clang_re.captures(&output) {
let ver: f32 = clang_ver.get(2).unwrap().as_str().parse().unwrap();
if ver >= MIN_APPLE_CLANG_VER {
println!("using Apple clang v{}", ver);
return true;
}
}
if let Some(clang_ver) = llvm_clang_re.captures(&output) {
let ver: f32 = clang_ver.get(2).unwrap().as_str().parse().unwrap();
if ver >= MIN_LLVM_CLANG_VER {
println!("using LLVM clang v{}", ver);
return true;
}
}
let _output = String::from_utf8(o.stdout).unwrap();
// TODO check version output to make sure it's supported.
const _MIN_APPLE_CLANG_VER: f32 = 11.0;
const _MIN_LLVM_CLANG_VER: f32 = 8.0;
return true;
}
false
}
@ -184,14 +163,6 @@ fn find_compatible_system_clang() -> Option<PathBuf> {
}
}
if let Ok(clang_path) = which("clang") {
if is_compatible_clang_version(&clang_path) {
return Some(
clang_path.parent().unwrap().parent().unwrap().to_path_buf(),
);
}
}
println!("using Chromiums clang");
None
}