diff --git a/Cargo.lock b/Cargo.lock index 8cbf6cf6869..db3eb81123f 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -143,15 +143,6 @@ dependencies = [ "rustc-std-workspace-core", ] -[[package]] -name = "base64" -version = "0.10.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0b25d992356d2eb0ed82172f5248873db5560c4721f564b13cb5193bda5e668e" -dependencies = [ - "byteorder", -] - [[package]] name = "bitflags" version = "1.2.1" @@ -270,7 +261,6 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "40ade3d27603c2cb345eb0912aec461a6dec7e06a4ae48589904e808335c7afa" dependencies = [ "byteorder", - "either", "iovec", ] @@ -291,7 +281,7 @@ dependencies = [ "cargo-test-macro", "cargo-test-support", "clap", - "core-foundation 0.7.0", + "core-foundation", "crates-io", "crossbeam-utils 0.7.2", "crypto-hash", @@ -570,26 +560,6 @@ dependencies = [ "cc", ] -[[package]] -name = "codespan" -version = "0.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "de67bdcd653002a6dba3eb53850ce3a485547225d81cb6c2bbdbc5a0cba5d15d" -dependencies = [ - "unicode-segmentation", -] - -[[package]] -name = "codespan-reporting" -version = "0.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "efd1d915d9e2b2ad696b2cd73215a84823ef3f0e3084d90304204415921b62c6" -dependencies = [ - "codespan", - "termcolor", - "unicode-width", -] - [[package]] name = "colored" version = "1.9.3" @@ -676,34 +646,6 @@ version = "0.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8ff012e225ce166d4422e0e78419d901719760f62ae2b7969ca6b564d1b54a9e" -[[package]] -name = "cookie" -version = "0.12.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "888604f00b3db336d2af898ec3c1d5d0ddf5e6d462220f2ededc33a87ac4bbd5" -dependencies = [ - "time", - "url 1.7.2", -] - -[[package]] -name = "cookie_store" -version = "0.7.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "46750b3f362965f197996c4448e4a0935e791bf7d6631bfce9ee0af3d24c919c" -dependencies = [ - "cookie", - "failure", - "idna 0.1.5", - "log", - "publicsuffix", - "serde", - "serde_json", - "time", - "try_from", - "url 1.7.2", -] - [[package]] name = "core" version = "0.0.0" @@ -711,32 +653,16 @@ dependencies = [ "rand 0.7.3", ] -[[package]] -name = "core-foundation" -version = "0.6.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4e2640d6d0bf22e82bed1b73c6aef8d5dd31e5abe6666c57e6d45e2649f4f887" -dependencies = [ - "core-foundation-sys 0.6.2", - "libc", -] - [[package]] name = "core-foundation" version = "0.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "57d24c7a13c43e870e37c1556b74555437870a04514f7685f5b354e090567171" dependencies = [ - "core-foundation-sys 0.7.0", + "core-foundation-sys", "libc", ] -[[package]] -name = "core-foundation-sys" -version = "0.6.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e7ca8a5221364ef15ce201e8ed2f609fc312682a8f4e0e3d4aa5879764e0fa3b" - [[package]] name = "core-foundation-sys" version = "0.7.0" @@ -1007,18 +933,6 @@ dependencies = [ "rustc-std-workspace-core", ] -[[package]] -name = "dtoa" -version = "0.4.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ea57b42383d091c85abcc2706240b94ab2a8fa1fc81c10ff23c4de06e2a90b5e" - -[[package]] -name = "dunce" -version = "1.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d0ad6bf6a88548d1126045c413548df1453d9be094a8ab9fd59bf1fdd338da4f" - [[package]] name = "either" version = "1.5.0" @@ -1049,15 +963,6 @@ dependencies = [ "log", ] -[[package]] -name = "encoding_rs" -version = "0.8.17" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4155785c79f2f6701f185eb2e6b4caf0555ec03477cb4c70db67b465311620ed" -dependencies = [ - "cfg-if", -] - [[package]] name = "env_logger" version = "0.6.2" @@ -1252,16 +1157,6 @@ version = "0.1.28" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "45dc39533a6cae6da2b56da48edae506bb767ec07370f86f70fc062e9d435869" -[[package]] -name = "futures-cpupool" -version = "0.1.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ab90cde24b3319636588d0c35fe03b1333857621051837ed769faefb4c2162e4" -dependencies = [ - "futures", - "num_cpus", -] - [[package]] name = "fwdansi" version = "1.0.1" @@ -1349,24 +1244,6 @@ dependencies = [ "regex", ] -[[package]] -name = "h2" -version = "0.1.25" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a539b63339fbbb00e081e84b6e11bd1d9634a82d91da2984a18ac74a8823f392" -dependencies = [ - "byteorder", - "bytes", - "fnv", - "futures", - "http", - "indexmap", - "log", - "slab", - "string", - "tokio-io", -] - [[package]] name = "handlebars" version = "3.0.1" @@ -1449,35 +1326,6 @@ dependencies = [ "syn 1.0.11", ] -[[package]] -name = "http" -version = "0.1.19" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d7e06e336150b178206af098a055e3621e8336027e2b4d126bda0bc64824baaf" -dependencies = [ - "bytes", - "fnv", - "itoa", -] - -[[package]] -name = "http-body" -version = "0.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6741c859c1b2463a423a1dbce98d418e6c3c3fc720fb0d45528657320920292d" -dependencies = [ - "bytes", - "futures", - "http", - "tokio-buf", -] - -[[package]] -name = "httparse" -version = "1.3.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cd179ae861f0c2e53da70d892f5f3029f9594be0c41dc5269cd371691b1dc2f9" - [[package]] name = "humantime" version = "1.3.0" @@ -1493,49 +1341,6 @@ version = "2.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b9b6c53306532d3c8e8087b44e6580e10db51a023cf9b433cea2ac38066b92da" -[[package]] -name = "hyper" -version = "0.12.31" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6481fff8269772d4463253ca83c788104a7305cb3fb9136bc651a6211e46e03f" -dependencies = [ - "bytes", - "futures", - "futures-cpupool", - "h2", - "http", - "http-body", - "httparse", - "iovec", - "itoa", - "log", - "net2", - "rustc_version", - "time", - "tokio", - "tokio-buf", - "tokio-executor", - "tokio-io", - "tokio-reactor", - "tokio-tcp", - "tokio-threadpool", - "tokio-timer", - "want", -] - -[[package]] -name = "hyper-tls" -version = "0.3.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3a800d6aa50af4b5850b2b0f659625ce9504df908e9733b635720483be26174f" -dependencies = [ - "bytes", - "futures", - "hyper", - "native-tls", - "tokio-io", -] - [[package]] name = "ident_case" version = "1.0.1" @@ -2019,33 +1824,6 @@ dependencies = [ "toml-query", ] -[[package]] -name = "mdbook-linkcheck" -version = "0.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c0a04db564ca37c47771f8455c825dc941ea851ff0deffcf55a04c512406b409" -dependencies = [ - "codespan", - "codespan-reporting", - "dunce", - "either", - "env_logger 0.7.1", - "failure", - "http", - "log", - "mdbook", - "percent-encoding 2.1.0", - "pulldown-cmark 0.6.1", - "rayon", - "regex", - "reqwest", - "semver 0.9.0", - "serde", - "serde_derive", - "serde_json", - "structopt", -] - [[package]] name = "measureme" version = "0.7.1" @@ -2083,25 +1861,6 @@ dependencies = [ "rustc_version", ] -[[package]] -name = "mime" -version = "0.3.13" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3e27ca21f40a310bd06d9031785f4801710d566c184a6e15bad4f1d9b65f9425" -dependencies = [ - "unicase", -] - -[[package]] -name = "mime_guess" -version = "2.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1a0ed03949aef72dbdf3116a383d7b38b4768e6f960528cd6a6044aa9ed68599" -dependencies = [ - "mime", - "unicase", -] - [[package]] name = "minifier" version = "0.0.33" @@ -2202,24 +1961,6 @@ dependencies = [ "shell-escape", ] -[[package]] -name = "native-tls" -version = "0.2.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4b2df1a4c22fd44a62147fd8f13dd0f95c9d8ca7b2610299b2a2f9cf8964274e" -dependencies = [ - "lazy_static", - "libc", - "log", - "openssl", - "openssl-probe", - "openssl-sys", - "schannel", - "security-framework", - "security-framework-sys", - "tempfile", -] - [[package]] name = "net2" version = "0.2.33" @@ -2670,19 +2411,6 @@ dependencies = [ "cc", ] -[[package]] -name = "publicsuffix" -version = "1.5.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9bf259a81de2b2eb9850ec990ec78e6a25319715584fd7652b9b26f96fcb1510" -dependencies = [ - "error-chain", - "idna 0.2.0", - "lazy_static", - "regex", - "url 2.1.0", -] - [[package]] name = "pulldown-cmark" version = "0.6.1" @@ -3002,40 +2730,6 @@ dependencies = [ "winapi 0.3.8", ] -[[package]] -name = "reqwest" -version = "0.9.22" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2c2064233e442ce85c77231ebd67d9eca395207dec2127fe0bbedde4bd29a650" -dependencies = [ - "base64", - "bytes", - "cookie", - "cookie_store", - "encoding_rs", - "flate2", - "futures", - "http", - "hyper", - "hyper-tls", - "log", - "mime", - "mime_guess", - "native-tls", - "serde", - "serde_json", - "serde_urlencoded", - "time", - "tokio", - "tokio-executor", - "tokio-io", - "tokio-threadpool", - "tokio-timer", - "url 1.7.2", - "uuid", - "winreg", -] - [[package]] name = "rls" version = "1.41.0" @@ -3162,12 +2856,7 @@ name = "rustbook" version = "0.1.0" dependencies = [ "clap", - "codespan", - "codespan-reporting", - "failure", "mdbook", - "mdbook-linkcheck", - "rustc-workspace-hack", ] [[package]] @@ -4525,27 +4214,6 @@ version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b42e15e59b18a828bbf5c58ea01debb36b9b096346de35d941dcb89009f24a0d" -[[package]] -name = "security-framework" -version = "0.3.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eee63d0f4a9ec776eeb30e220f0bc1e092c3ad744b2a379e3993070364d3adc2" -dependencies = [ - "core-foundation 0.6.3", - "core-foundation-sys 0.6.2", - "libc", - "security-framework-sys", -] - -[[package]] -name = "security-framework-sys" -version = "0.3.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9636f8989cbf61385ae4824b98c1aaa54c994d7d8b41f11c601ed799f0549a56" -dependencies = [ - "core-foundation-sys 0.6.2", -] - [[package]] name = "semver" version = "0.9.0" @@ -4623,18 +4291,6 @@ dependencies = [ "syn 1.0.11", ] -[[package]] -name = "serde_urlencoded" -version = "0.5.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "642dd69105886af2efd227f75a520ec9b44a820d65bc133a9131f7d229fd165a" -dependencies = [ - "dtoa", - "itoa", - "serde", - "url 1.7.2", -] - [[package]] name = "sha-1" version = "0.8.2" @@ -4756,15 +4412,6 @@ dependencies = [ "wasi", ] -[[package]] -name = "string" -version = "0.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d24114bfcceb867ca7f71a0d3fe45d45619ec47a6fbfa98cb14e14250bfa5d6d" -dependencies = [ - "bytes", -] - [[package]] name = "string_cache" version = "0.7.3" @@ -5072,17 +4719,6 @@ dependencies = [ "tokio-uds", ] -[[package]] -name = "tokio-buf" -version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8fb220f46c53859a4b7ec083e41dec9778ff0b1851c0942b211edb89e0ccdc46" -dependencies = [ - "bytes", - "either", - "futures", -] - [[package]] name = "tokio-codec" version = "0.1.1" @@ -5365,21 +5001,6 @@ dependencies = [ "lazy_static", ] -[[package]] -name = "try-lock" -version = "0.2.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e604eb7b43c06650e854be16a2a03155743d3752dd1c943f6829e26b7a36e382" - -[[package]] -name = "try_from" -version = "0.3.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "283d3b89e1368717881a9d51dad843cc435380d8109c9e47d38780a324698d8b" -dependencies = [ - "cfg-if", -] - [[package]] name = "typenum" version = "1.12.0" @@ -5541,15 +5162,6 @@ version = "0.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8772a4ccbb4e89959023bc5b7cb8623a795caa7092d99f3aa9501b9484d4557d" -[[package]] -name = "uuid" -version = "0.7.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "90dbc611eb48397705a6b0f6e917da23ae517e4d127123d2cf7674206627d32a" -dependencies = [ - "rand 0.6.1", -] - [[package]] name = "vcpkg" version = "0.2.8" @@ -5598,17 +5210,6 @@ dependencies = [ "winapi-util", ] -[[package]] -name = "want" -version = "0.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b6395efa4784b027708f7451087e647ec73cc74f5d9bc2e418404248d679a230" -dependencies = [ - "futures", - "log", - "try-lock", -] - [[package]] name = "wasi" version = "0.9.0+wasi-snapshot-preview1" @@ -5673,15 +5274,6 @@ dependencies = [ "winapi-util", ] -[[package]] -name = "winreg" -version = "0.6.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b2986deb581c4fe11b621998a5e53361efe6b48a151178d0cd9eeffa4dc6acc9" -dependencies = [ - "winapi 0.3.8", -] - [[package]] name = "ws2_32-sys" version = "0.2.1" diff --git a/src/bootstrap/tool.rs b/src/bootstrap/tool.rs index 0055dee6092..063fb8fbb95 100644 --- a/src/bootstrap/tool.rs +++ b/src/bootstrap/tool.rs @@ -12,7 +12,7 @@ use crate::channel; use crate::channel::GitInfo; use crate::compile; use crate::toolstate::ToolState; -use crate::util::{add_dylib_path, exe, CiEnv}; +use crate::util::{add_dylib_path, exe}; use crate::Compiler; use crate::Mode; @@ -236,7 +236,6 @@ pub fn prepare_tool_cargo( || path.ends_with("rls") || path.ends_with("clippy") || path.ends_with("miri") - || path.ends_with("rustbook") || path.ends_with("rustfmt") { cargo.env("LIBZ_SYS_STATIC", "1"); @@ -272,20 +271,6 @@ pub fn prepare_tool_cargo( cargo } -fn rustbook_features() -> Vec { - let mut features = Vec::new(); - - // Due to CI budged and risk of spurious failures we want to limit jobs running this check. - // At same time local builds should run it regardless of the platform. - // `CiEnv::None` means it's local build and `CHECK_LINKS` is defined in x86_64-gnu-tools to - // explicitly enable it on single job - if CiEnv::current() == CiEnv::None || env::var("CHECK_LINKS").is_ok() { - features.push("linkcheck".to_string()); - } - - features -} - macro_rules! bootstrap_tool { ($( $name:ident, $path:expr, $tool_name:expr @@ -368,7 +353,7 @@ macro_rules! bootstrap_tool { } bootstrap_tool!( - Rustbook, "src/tools/rustbook", "rustbook", features = rustbook_features(); + Rustbook, "src/tools/rustbook", "rustbook"; UnstableBookGen, "src/tools/unstable-book-gen", "unstable-book-gen"; Tidy, "src/tools/tidy", "tidy"; Linkchecker, "src/tools/linkchecker", "linkchecker"; diff --git a/src/ci/docker/x86_64-gnu-tools/Dockerfile b/src/ci/docker/x86_64-gnu-tools/Dockerfile index 148e09f6ad1..3b6e4c2cb98 100644 --- a/src/ci/docker/x86_64-gnu-tools/Dockerfile +++ b/src/ci/docker/x86_64-gnu-tools/Dockerfile @@ -19,9 +19,6 @@ RUN sh /scripts/sccache.sh COPY x86_64-gnu-tools/checktools.sh /tmp/ -# Run rustbook with `linkcheck` feature enabled -ENV CHECK_LINKS 1 - ENV RUST_CONFIGURE_ARGS \ --build=x86_64-unknown-linux-gnu \ --save-toolstates=/tmp/toolstate/toolstates.json diff --git a/src/tools/rustbook/Cargo.toml b/src/tools/rustbook/Cargo.toml index ff41197faa1..bde9aca85d8 100644 --- a/src/tools/rustbook/Cargo.toml +++ b/src/tools/rustbook/Cargo.toml @@ -5,22 +5,8 @@ version = "0.1.0" license = "MIT OR Apache-2.0" edition = "2018" -[features] -linkcheck = ["mdbook-linkcheck", "codespan-reporting", "codespan"] - [dependencies] clap = "2.25.0" -failure = "0.1" -mdbook-linkcheck = { version = "0.5.0", optional = true } -# Keep in sync with mdbook-linkcheck. -codespan = { version = "0.5", optional = true } -codespan-reporting = { version = "0.5", optional = true } - - -# A noop dependency that changes in the Rust repository, it's a bit of a hack. -# See the `src/tools/rustc-workspace-hack/README.md` file in `rust-lang/rust` -# for more information. -rustc-workspace-hack = "1.0.0" [dependencies.mdbook] version = "0.3.7" diff --git a/src/tools/rustbook/src/main.rs b/src/tools/rustbook/src/main.rs index 60bd0b72910..8526568e4f9 100644 --- a/src/tools/rustbook/src/main.rs +++ b/src/tools/rustbook/src/main.rs @@ -30,11 +30,6 @@ fn main() { .about("Tests that a book's Rust code samples compile") .arg_from_usage(dir_message), ) - .subcommand( - SubCommand::with_name("linkcheck") - .about("Run linkcheck with mdBook 3") - .arg_from_usage(dir_message), - ) .get_matches(); // Check which subcomamnd the user ran... @@ -49,94 +44,10 @@ fn main() { handle_error(e); } } - ("linkcheck", Some(sub_matches)) => { - #[cfg(feature = "linkcheck")] - { - let (diags, files) = linkcheck(sub_matches).expect("Error while linkchecking."); - if !diags.is_empty() { - let color = codespan_reporting::term::termcolor::ColorChoice::Auto; - let mut writer = - codespan_reporting::term::termcolor::StandardStream::stderr(color); - let cfg = codespan_reporting::term::Config::default(); - - for diag in diags { - codespan_reporting::term::emit(&mut writer, &cfg, &files, &diag) - .expect("Unable to emit linkcheck error."); - } - - std::process::exit(101); - } - } - - #[cfg(not(feature = "linkcheck"))] - { - // This avoids the `unused_binding` lint. - println!( - "mdbook-linkcheck is disabled, but arguments were passed: {:?}", - sub_matches - ); - } - } (_, _) => unreachable!(), }; } -#[cfg(feature = "linkcheck")] -pub fn linkcheck( - args: &ArgMatches<'_>, -) -> Result<(Vec, codespan::Files), failure::Error> { - use mdbook_linkcheck::Reason; - - let book_dir = get_book_dir(args); - let src_dir = book_dir.join("src"); - let book = MDBook::load(&book_dir).unwrap(); - let linkck_cfg = mdbook_linkcheck::get_config(&book.config)?; - let mut files = codespan::Files::new(); - let target_files = mdbook_linkcheck::load_files_into_memory(&book.book, &mut files); - let cache = mdbook_linkcheck::Cache::default(); - - let (links, incomplete) = mdbook_linkcheck::extract_links(target_files, &files); - - let outcome = - mdbook_linkcheck::validate(&links, &linkck_cfg, &src_dir, &cache, &files, incomplete)?; - - let mut is_real_error = false; - - for link in outcome.invalid_links.iter() { - match &link.reason { - Reason::FileNotFound | Reason::TraversesParentDirectories => { - is_real_error = true; - } - Reason::UnsuccessfulServerResponse(status) => { - if status.as_u16() == 429 { - eprintln!("Received 429 (TOO_MANY_REQUESTS) for link `{}`", link.link.uri); - } else if status.is_client_error() { - is_real_error = true; - } else { - eprintln!("Unsuccessful server response for link `{}`", link.link.uri); - } - } - Reason::Client(err) => { - if err.is_timeout() { - eprintln!("Timeout for link `{}`", link.link.uri); - } else if err.is_server_error() { - eprintln!("Server error for link `{}`", link.link.uri); - } else if !err.is_http() { - eprintln!("Non-HTTP-related error for link: {} {}", link.link.uri, err); - } else { - is_real_error = true; - } - } - } - } - - if is_real_error { - Ok((outcome.generate_diagnostics(&files, linkck_cfg.warning_policy), files)) - } else { - Ok((vec![], files)) - } -} - // Build command implementation pub fn build(args: &ArgMatches<'_>) -> Result3<()> { let book_dir = get_book_dir(args); diff --git a/src/tools/tidy/src/deps.rs b/src/tools/tidy/src/deps.rs index 093db2a49d0..e956d0afeba 100644 --- a/src/tools/tidy/src/deps.rs +++ b/src/tools/tidy/src/deps.rs @@ -45,9 +45,6 @@ const EXCEPTIONS: &[(&str, &str)] = &[ ("bitmaps", "MPL-2.0+"), // cargo via im-rc // FIXME: this dependency violates the documentation comment above: ("fortanix-sgx-abi", "MPL-2.0"), // libstd but only for `sgx` target - ("dunce", "CC0-1.0"), // mdbook-linkcheck - ("codespan-reporting", "Apache-2.0"), // mdbook-linkcheck - ("codespan", "Apache-2.0"), // mdbook-linkcheck ("crossbeam-channel", "MIT/Apache-2.0 AND BSD-2-Clause"), // cargo ];