From: Fabian Grünbichler Date: Tue, 4 Oct 2022 08:16:45 +0000 (+0200) Subject: Update early-stage patches for 1.64.0+dfsg1 X-Git-Url: https://git.proxmox.com/?a=commitdiff_plain;h=2eebeb27e0d569bddd4e7e9f3eb46fa22a6224e2;p=rustc.git Update early-stage patches for 1.64.0+dfsg1 rust-analyzer is now an in-tree tool, but it is itself a workspace so not trivial to integrate into our existing vendor-cut-down mechanism. skip including it for the time being. --- diff --git a/debian/patches/d-0000-ignore-removed-submodules.patch b/debian/patches/d-0000-ignore-removed-submodules.patch index e7889ca2b1..08753f22f0 100644 --- a/debian/patches/d-0000-ignore-removed-submodules.patch +++ b/debian/patches/d-0000-ignore-removed-submodules.patch @@ -3,21 +3,21 @@ Date: Sat, 2 Oct 2021 01:07:59 +0100 Subject: d-0000-ignore-removed-submodules --- - Cargo.toml | 29 ----------------------------- - src/bootstrap/bootstrap.py | 15 --------------- + Cargo.toml | 36 ++++++++---------------------------- + src/bootstrap/bootstrap.py | 4 ---- src/bootstrap/builder.rs | 7 +------ src/bootstrap/doc.rs | 1 - src/bootstrap/test.rs | 12 +----------- src/tools/clippy/Cargo.toml | 5 ----- src/tools/rustfmt/Cargo.toml | 5 ----- src/tools/tidy/src/deps.rs | 2 +- - 8 files changed, 3 insertions(+), 73 deletions(-) + 8 files changed, 11 insertions(+), 61 deletions(-) diff --git a/Cargo.toml b/Cargo.toml -index 4e78399..4a87674 100644 +index ffc886d..7231b60 100644 --- a/Cargo.toml +++ b/Cargo.toml -@@ -18,25 +18,14 @@ members = [ +@@ -16,25 +16,14 @@ members = [ "src/tools/tidy", "src/tools/tier-check", "src/tools/build-manifest", @@ -43,9 +43,9 @@ index 4e78399..4a87674 100644 "src/tools/lld-wrapper", ] -@@ -106,25 +95,7 @@ debug = 0 - # Only use debuginfo=1 to further reduce compile times. - bootstrap.debug = 1 +@@ -96,25 +85,16 @@ gimli.debug = 0 + miniz_oxide.debug = 0 + object.debug = 0 -# We want the RLS to use the version of Cargo that we've got vendored in this -# repository to ensure that the same exact version of Cargo is used by both the @@ -61,7 +61,15 @@ index 4e78399..4a87674 100644 -# that we're shipping as well (to ensure that the rustfmt in RLS and the -# `rustfmt` executable are the same exact version). -rustfmt-nightly = { path = "src/tools/rustfmt" } -- ++# The only package that ever uses debug builds is bootstrap. ++# We care a lot about bootstrap's compile times, so don't include debug info for ++# dependencies, only bootstrap itself. ++[profile.dev] ++debug = 0 ++[profile.dev.package] ++# Only use debuginfo=1 to further reduce compile times. ++bootstrap.debug = 1 + [patch.crates-io] -# See comments in `src/tools/rustc-workspace-hack/README.md` for what's going on -# here @@ -70,10 +78,10 @@ index 4e78399..4a87674 100644 # See comments in `library/rustc-std-workspace-core/README.md` for what's going on # here diff --git a/src/bootstrap/bootstrap.py b/src/bootstrap/bootstrap.py -index 40d478a..126b74c 100644 +index 03eec02..c40811f 100644 --- a/src/bootstrap/bootstrap.py +++ b/src/bootstrap/bootstrap.py -@@ -793,10 +793,6 @@ class RustBuild(object): +@@ -759,10 +759,6 @@ class RustBuild(object): os.path.join(self.rust_root, "src/bootstrap/Cargo.toml")] for _ in range(0, self.verbose): args.append("--verbose") @@ -84,37 +92,47 @@ index 40d478a..126b74c 100644 if self.get_toml("metrics", "build"): args.append("--features") args.append("build-metrics") -@@ -854,17 +850,6 @@ class RustBuild(object): - def update_submodules(self): - """Update submodules""" - has_git = os.path.exists(os.path.join(self.rust_root, ".git")) -- # This just arbitrarily checks for cargo, but any workspace member in -- # a submodule would work. -- has_submodules = os.path.exists(os.path.join(self.rust_root, "src/tools/cargo/Cargo.toml")) -- if not has_git and not has_submodules: -- print("This is not a git repository, and the requisite git submodules were not found.") -- print("If you downloaded the source from https://github.com/rust-lang/rust/releases,") -- print("those sources will not work. Instead, consider downloading from the source") -- print("releases linked at") -- print("https://forge.rust-lang.org/infra/other-installation-methods.html#source-code") -- print("or clone the repository at https://github.com/rust-lang/rust/.") -- raise SystemExit(1) - if not has_git or self.get_toml('submodules') == "false": - return - diff --git a/src/bootstrap/builder.rs b/src/bootstrap/builder.rs -index 62b5416..144aefa 100644 +index 0ab4824..629e1bb 100644 --- a/src/bootstrap/builder.rs +++ b/src/bootstrap/builder.rs -@@ -692,7 +692,6 @@ impl<'a> Builder<'a> { +@@ -600,8 +600,6 @@ impl<'a> Builder<'a> { + tool::RustInstaller, + tool::Cargo, + tool::Rls, +- tool::RustAnalyzer, +- tool::RustAnalyzerProcMacroSrv, + tool::RustDemangler, + tool::Rustdoc, + tool::Clippy, +@@ -622,7 +620,6 @@ impl<'a> Builder<'a> { + check::Clippy, + check::Miri, + check::Rls, +- check::RustAnalyzer, + check::Rustfmt, + check::Bootstrap + ), +@@ -650,7 +647,6 @@ impl<'a> Builder<'a> { + test::Cargotest, + test::Cargo, + test::Rls, +- test::RustAnalyzer, + test::ErrorIndex, + test::Distcheck, + test::RunMakeFullDeps, +@@ -698,10 +694,8 @@ impl<'a> Builder<'a> { doc::RustdocBook, doc::RustByExample, doc::RustcBook, - doc::CargoBook, doc::Clippy, + doc::ClippyBook, +- doc::Miri, doc::EmbeddedBook, doc::EditionGuide, -@@ -715,7 +714,6 @@ impl<'a> Builder<'a> { + ), +@@ -723,7 +717,6 @@ impl<'a> Builder<'a> { dist::Miri, dist::LlvmTools, dist::RustDev, @@ -122,7 +140,7 @@ index 62b5416..144aefa 100644 // It seems that PlainSourceTarball somehow changes how some of the tools // perceive their dependencies (see #93033) which would invalidate fingerprints // and force us to rebuild tools after vendoring dependencies. -@@ -2049,10 +2047,7 @@ impl<'a> Builder<'a> { +@@ -2054,10 +2047,7 @@ impl<'a> Builder<'a> { } } @@ -135,7 +153,7 @@ index 62b5416..144aefa 100644 } diff --git a/src/bootstrap/doc.rs b/src/bootstrap/doc.rs -index be6655d..91e0772 100644 +index 2852442..5faa8e5 100644 --- a/src/bootstrap/doc.rs +++ b/src/bootstrap/doc.rs @@ -73,7 +73,6 @@ macro_rules! book { @@ -143,14 +161,14 @@ index be6655d..91e0772 100644 // and checking against it?). book!( - CargoBook, "src/tools/cargo/src/doc", "cargo", submodule = "src/tools/cargo"; + ClippyBook, "src/tools/clippy/book", "clippy"; EditionGuide, "src/doc/edition-guide", "edition-guide", submodule; EmbeddedBook, "src/doc/embedded-book", "embedded-book", submodule; - Nomicon, "src/doc/nomicon", "nomicon", submodule; diff --git a/src/bootstrap/test.rs b/src/bootstrap/test.rs -index 9958306..4e4945b 100644 +index c0fa8c9..8fbc390 100644 --- a/src/bootstrap/test.rs +++ b/src/bootstrap/test.rs -@@ -1842,17 +1842,7 @@ impl Step for RustcGuide { +@@ -1910,17 +1910,7 @@ impl Step for RustcGuide { } fn run(self, builder: &Builder<'_>) { @@ -170,10 +188,10 @@ index 9958306..4e4945b 100644 } diff --git a/src/tools/clippy/Cargo.toml b/src/tools/clippy/Cargo.toml -index e4060ce..a86a9e6 100644 +index 1c875c3..1aad7cf 100644 --- a/src/tools/clippy/Cargo.toml +++ b/src/tools/clippy/Cargo.toml -@@ -34,11 +34,6 @@ regex = "1.5" +@@ -36,11 +36,6 @@ walkdir = "2.3" # This is used by the `collect-metadata` alias. filetime = "0.2" @@ -202,10 +220,10 @@ index 7a4e02d..27b91f2 100644 [package.metadata.rust-analyzer] diff --git a/src/tools/tidy/src/deps.rs b/src/tools/tidy/src/deps.rs -index 7775bbb..ae0489e 100644 +index 333f85f..4df2b54 100644 --- a/src/tools/tidy/src/deps.rs +++ b/src/tools/tidy/src/deps.rs -@@ -294,7 +294,7 @@ const FORBIDDEN_TO_HAVE_DUPLICATES: &[&str] = &[ +@@ -306,7 +306,7 @@ const FORBIDDEN_TO_HAVE_DUPLICATES: &[&str] = &[ // These two crates take quite a long time to build, so don't allow two versions of them // to accidentally sneak into our dependency graph, in order to ensure we keep our CI times // under control. @@ -214,3 +232,36 @@ index 7775bbb..ae0489e 100644 ]; /// Dependency checks. +Index: rust/src/bootstrap/dist.rs +=================================================================== +--- rust.orig/src/bootstrap/dist.rs ++++ rust/src/bootstrap/dist.rs +@@ -362,17 +362,17 @@ impl Step for Rustc { + + builder.install(&builder.rustdoc(compiler), &image.join("bin"), 0o755); + +- let ra_proc_macro_srv = builder +- .ensure(tool::RustAnalyzerProcMacroSrv { +- compiler: builder.compiler_for( +- compiler.stage, +- builder.config.build, +- compiler.host, +- ), +- target: compiler.host, +- }) +- .expect("rust-analyzer-proc-macro-server always builds"); +- builder.install(&ra_proc_macro_srv, &image.join("libexec"), 0o755); ++ //let ra_proc_macro_srv = builder ++ // .ensure(tool::RustAnalyzerProcMacroSrv { ++ // compiler: builder.compiler_for( ++ // compiler.stage, ++ // builder.config.build, ++ // compiler.host, ++ // ), ++ // target: compiler.host, ++ // }) ++ // .expect("rust-analyzer-proc-macro-server always builds"); ++ //builder.install(&ra_proc_macro_srv, &image.join("libexec"), 0o755); + + let libdir_relative = builder.libdir_relative(compiler); + diff --git a/debian/patches/d-0001-pkg-config-no-special-snowflake.patch b/debian/patches/d-0001-pkg-config-no-special-snowflake.patch index f8b0d12c49..db66e2c34b 100644 --- a/debian/patches/d-0001-pkg-config-no-special-snowflake.patch +++ b/debian/patches/d-0001-pkg-config-no-special-snowflake.patch @@ -1,59 +1,55 @@ From: Debian Rust Maintainers Date: Sat, 2 Oct 2021 01:08:00 +0100 -Subject: d-0002-pkg-config-no-special-snowflake +Subject: d-0001-pkg-config-no-special-snowflake --- - vendor/pkg-config/src/lib.rs | 22 ++++++++++------------ + vendor/pkg-config/src/lib.rs | 25 ++++++++++--------------- vendor/pkg-config/tests/test.rs | 2 -- - 2 files changed, 10 insertions(+), 14 deletions(-) + 2 files changed, 10 insertions(+), 17 deletions(-) diff --git a/vendor/pkg-config/src/lib.rs b/vendor/pkg-config/src/lib.rs -index 2be11b3..0975563 100644 +index a28304e..11f9460 100644 --- a/vendor/pkg-config/src/lib.rs +++ b/vendor/pkg-config/src/lib.rs -@@ -9,8 +9,6 @@ - //! A number of environment variables are available to globally configure how - //! this crate will invoke `pkg-config`: - //! --//! * `PKG_CONFIG_ALLOW_CROSS` - if this variable is not set, then `pkg-config` --//! will automatically be disabled for all cross compiles. - //! * `FOO_NO_PKG_CONFIG` - if set, this will disable running `pkg-config` when - //! probing for the library named `foo`. - //! -@@ -106,9 +104,8 @@ pub enum Error { +@@ -111,11 +111,8 @@ pub enum Error { /// Contains the name of the responsible environment variable. EnvNoPkgConfig(String), -- /// Cross compilation detected. +- /// Detected cross compilation without a custom sysroot. - /// -- /// Override with `PKG_CONFIG_ALLOW_CROSS=1`. +- /// Ignore the error with `PKG_CONFIG_ALLOW_CROSS=1`, +- /// which may let `pkg-config` select libraries +- /// for the host's architecture instead of the target's. + /// Cross compilation detected. Kept for compatibility; + /// the Debian package never emits this. CrossCompilation, /// Failed to run `pkg-config`. -@@ -132,11 +129,6 @@ impl fmt::Display for Error { +@@ -155,14 +152,6 @@ impl fmt::Display for Error { fn fmt(&self, f: &mut fmt::Formatter) -> Result<(), fmt::Error> { match *self { Error::EnvNoPkgConfig(ref name) => write!(f, "Aborted because {} is set", name), -- Error::CrossCompilation => write!( -- f, -- "Cross compilation detected. \ -- Use PKG_CONFIG_ALLOW_CROSS=1 to override" +- Error::CrossCompilation => f.write_str( +- "pkg-config has not been configured to support cross-compilation.\n\ +- \n\ +- Install a sysroot for the target platform and configure it via\n\ +- PKG_CONFIG_SYSROOT_DIR and PKG_CONFIG_PATH, or install a\n\ +- cross-compiling wrapper for pkg-config and set it via\n\ +- PKG_CONFIG environment variable.", - ), Error::Command { ref command, ref cause, -@@ -160,7 +152,7 @@ impl fmt::Display for Error { - } - Ok(()) +@@ -219,7 +208,7 @@ impl fmt::Display for Error { + )?; + format_output(output, f) } - Error::__Nonexhaustive => panic!(), + Error::CrossCompilation | Error::__Nonexhaustive => panic!(), } } } -@@ -321,6 +313,8 @@ impl Config { +@@ -411,6 +400,8 @@ impl Config { if host == target { return true; } @@ -62,10 +58,10 @@ index 2be11b3..0975563 100644 // pkg-config may not be aware of cross-compilation, and require // a wrapper script that sets up platform-specific prefixes. -@@ -380,7 +374,11 @@ impl Config { +@@ -470,7 +461,11 @@ impl Config { fn command(&self, name: &str, args: &[&str]) -> Command { let exe = self - .env_var_os("PKG_CONFIG") + .targetted_env_var("PKG_CONFIG") - .unwrap_or_else(|| OsString::from("pkg-config")); + .unwrap_or_else(|| { + self.env_var_os("DEB_HOST_GNU_TYPE") @@ -76,7 +72,7 @@ index 2be11b3..0975563 100644 if self.is_static(name) { cmd.arg("--static"); diff --git a/vendor/pkg-config/tests/test.rs b/vendor/pkg-config/tests/test.rs -index 33a623c..0f934c4 100644 +index 4e04ac0..f884e46 100644 --- a/vendor/pkg-config/tests/test.rs +++ b/vendor/pkg-config/tests/test.rs @@ -34,7 +34,6 @@ fn find(name: &str) -> Result { diff --git a/debian/patches/d-0002-mdbook-strip-embedded-libs.patch b/debian/patches/d-0002-mdbook-strip-embedded-libs.patch index 9655490ee1..3916871a2b 100644 --- a/debian/patches/d-0002-mdbook-strip-embedded-libs.patch +++ b/debian/patches/d-0002-mdbook-strip-embedded-libs.patch @@ -1,6 +1,6 @@ From: Debian Rust Maintainers Date: Sat, 2 Oct 2021 01:08:00 +0100 -Subject: d-0003-mdbook-strip-embedded-libs +Subject: d-0002-mdbook-strip-embedded-libs Comment: Use https://github.com/infinity0/mdBook/tree/debian to help you rebase the patch on top of a newer version. . Make sure the paths here match the ones in debian/rust-doc.links --- @@ -14,7 +14,7 @@ Comment: Use https://github.com/infinity0/mdBook/tree/debian to help you rebase 7 files changed, 35 insertions(+), 203 deletions(-) diff --git a/src/tools/linkchecker/main.rs b/src/tools/linkchecker/main.rs -index c9b1649..a22dc5f 100644 +index a7c78d8..22927f8 100644 --- a/src/tools/linkchecker/main.rs +++ b/src/tools/linkchecker/main.rs @@ -183,7 +183,17 @@ impl Checker { @@ -84,7 +84,7 @@ index 264c113..2b0ff3a 100644 } diff --git a/vendor/mdbook/src/renderer/html_handlebars/hbs_renderer.rs b/vendor/mdbook/src/renderer/html_handlebars/hbs_renderer.rs -index 3d2d1af..6017a6a 100644 +index b933a35..09b4a7a 100644 --- a/vendor/mdbook/src/renderer/html_handlebars/hbs_renderer.rs +++ b/vendor/mdbook/src/renderer/html_handlebars/hbs_renderer.rs @@ -3,7 +3,7 @@ use crate::config::{BookConfig, Config, HtmlConfig, Playground, RustEdition}; @@ -191,10 +191,10 @@ index 3d2d1af..6017a6a 100644 Ok(()) } diff --git a/vendor/mdbook/src/renderer/html_handlebars/search.rs b/vendor/mdbook/src/renderer/html_handlebars/search.rs -index 5dd063d..3a983b5 100644 +index c3b944c..d4bbe35 100644 --- a/vendor/mdbook/src/renderer/html_handlebars/search.rs +++ b/vendor/mdbook/src/renderer/html_handlebars/search.rs -@@ -34,8 +34,6 @@ pub fn create_files(search_config: &Search, destination: &Path, book: &Book) -> +@@ -52,8 +52,6 @@ pub fn create_files(search_config: &Search, destination: &Path, book: &Book) -> format!("Object.assign(window.search, {});", index).as_bytes(), )?; utils::fs::write_file(destination, "searcher.js", searcher::JS)?; diff --git a/debian/patches/d-0003-cc-psm-rebuild-wasm32.patch b/debian/patches/d-0003-cc-psm-rebuild-wasm32.patch index 14c9205e5f..4d793cb81a 100644 --- a/debian/patches/d-0003-cc-psm-rebuild-wasm32.patch +++ b/debian/patches/d-0003-cc-psm-rebuild-wasm32.patch @@ -1,6 +1,6 @@ From: Debian Rust Maintainers Date: Sat, 2 Oct 2021 01:08:00 +0100 -Subject: d-0004-cc-psm-rebuild-wasm32 +Subject: d-0003-cc-psm-rebuild-wasm32 --- vendor/cc/src/lib.rs | 2 +- diff --git a/debian/patches/d-0004-clippy-feature-sync.patch b/debian/patches/d-0004-clippy-feature-sync.patch index 194b662767..8c0c0fb97b 100644 --- a/debian/patches/d-0004-clippy-feature-sync.patch +++ b/debian/patches/d-0004-clippy-feature-sync.patch @@ -1,27 +1,19 @@ From: Debian Rust Maintainers Date: Sat, 2 Oct 2021 01:08:00 +0100 -Subject: d-0005-clippy-feature-sync +Subject: d-0004-clippy-feature-sync enable features needed by rustfmt to make build system happy and speedup build. this is what rustc_workspace_hack does in the upstream build. --- - src/tools/clippy/Cargo.toml | 2 +- + src/tools/clippy/Cargo.toml | 3 ++- src/tools/rustfmt/Cargo.toml | 2 +- - 2 files changed, 2 insertions(+), 2 deletions(-) + 2 files changed, 3 insertions(+), 2 deletions(-) -Index: rust/src/tools/clippy/Cargo.toml -=================================================================== ---- rust.orig/src/tools/clippy/Cargo.toml -+++ rust/src/tools/clippy/Cargo.toml -@@ -22,6 +22,7 @@ path = "src/driver.rs" - - [dependencies] - clippy_lints = { path = "clippy_lints" } -+memchr = { version = "2.5.0", features = ["use_std"] } # rustfmt sync! - semver = "1.0" - rustc_tools_util = { path = "rustc_tools_util" } - tempfile = { version = "3.2", optional = true } -@@ -41,7 +42,7 @@ if_chain = "1.0" +diff --git a/src/tools/clippy/Cargo.toml b/src/tools/clippy/Cargo.toml +index 1aad7cf..705a880 100644 +--- a/src/tools/clippy/Cargo.toml ++++ b/src/tools/clippy/Cargo.toml +@@ -42,7 +43,7 @@ if_chain = "1.0" itertools = "0.10.1" quote = "1.0" serde = { version = "1.0.125", features = ["derive"] } @@ -30,10 +22,10 @@ Index: rust/src/tools/clippy/Cargo.toml futures = "0.3" parking_lot = "0.12" tokio = { version = "1", features = ["io-util"] } -Index: rust/src/tools/rustfmt/Cargo.toml -=================================================================== ---- rust.orig/src/tools/rustfmt/Cargo.toml -+++ rust/src/tools/rustfmt/Cargo.toml +diff --git a/src/tools/rustfmt/Cargo.toml b/src/tools/rustfmt/Cargo.toml +index 27b91f2..12d1567 100644 +--- a/src/tools/rustfmt/Cargo.toml ++++ b/src/tools/rustfmt/Cargo.toml @@ -49,7 +49,7 @@ lazy_static = "1.4" log = "0.4" regex = "1.5" diff --git a/debian/patches/d-0005-no-jemalloc.patch b/debian/patches/d-0005-no-jemalloc.patch index f683e3f4e5..9953253001 100644 --- a/debian/patches/d-0005-no-jemalloc.patch +++ b/debian/patches/d-0005-no-jemalloc.patch @@ -1,6 +1,6 @@ From: Debian Rust Maintainers Date: Sat, 2 Oct 2021 01:08:00 +0100 -Subject: d-0006-no-jemalloc +Subject: d-0005-no-jemalloc --- compiler/rustc/Cargo.toml | 6 ------