@@ -36,6 +36,12 @@
impl GitInfo {
- pub fn new(ignore_git: bool, dir: &Path) -> GitInfo {
+ pub fn new(omit_git_hash: bool, dir: &Path) -> GitInfo {
+ //
+ // Debian: returning early because the Debian package is also in a git
+ // repository, but we don't want to parse gitinfo. This is
match read_commit_info_file(dir) {
--- a/src/bootstrap/dist.rs
+++ b/src/bootstrap/dist.rs
-@@ -968,7 +968,10 @@
+@@ -995,7 +995,10 @@
}
// If we're building from git sources, we need to vendor a complete distribution.
--- a/src/bootstrap/doc.rs
+++ b/src/bootstrap/doc.rs
-@@ -598,7 +598,6 @@
+@@ -612,7 +612,6 @@
.arg(&*target_dir.to_string_lossy())
.arg("-p")
.arg(package)
.arg("--")
.arg("-Z")
.arg("unstable-options")
-@@ -695,7 +694,6 @@
+@@ -712,7 +711,6 @@
cargo.rustdocflag("--generate-link-to-definition");
- compile::rustc_cargo(builder, &mut cargo, target);
+ compile::rustc_cargo(builder, &mut cargo, target, compiler.stage);
cargo.arg("-Zunstable-options");
- cargo.arg("-Zskip-rustdoc-fingerprint");
// Only include compiler crates, no dependencies of those, such as `libc`.
// Do link to dependencies on `docs.rs` however using `rustdoc-map`.
-@@ -811,7 +809,6 @@
+@@ -845,7 +843,6 @@
&[],
);
--- a/vendor/rustix/Cargo.toml
+++ b/vendor/rustix/Cargo.toml
-@@ -115,9 +115,9 @@
+@@ -125,9 +125,9 @@
[dev-dependencies.tempfile]
- version = "3.2.0"
+ version = "3.4.0"
-[build-dependencies.cc]
+[build-dependencies.cc_dep]
[features]
all-apis = [
-@@ -230,6 +230,7 @@
+@@ -242,6 +242,7 @@
"Win32_NetworkManagement_IpHelper",
"Win32_System_Threading",
]
use std::env::var;
use std::io::Write;
-@@ -118,16 +117,16 @@
+@@ -158,16 +157,16 @@
println!("cargo:rerun-if-changed={}", to);
// If "cc" is not enabled, use a pre-built library.
+ //#[cfg(feature = "cc")]
{
let out_dir = var("OUT_DIR").unwrap();
- Build::new().file(&asm_name).compile(&name);
+ // Add `-gdwarf-3` so that we always get the same output, regardless of
diff --git a/src/etc/rust-gdb b/src/etc/rust-gdb
index b950cea..5ec8752 100755
---- a/src/etc/rust-gdb
-+++ b/src/etc/rust-gdb
-@@ -11,7 +11,7 @@ else
- fi
-
- # Find out where the pretty printer Python module is
--RUSTC_SYSROOT="$("$RUSTC" --print=sysroot)"
-+RUSTC_SYSROOT="$(if type "$RUSTC" >/dev/null 2>&1; then "$RUSTC" --print=sysroot; else echo /usr; fi)"
- GDB_PYTHON_MODULE_DIRECTORY="$RUSTC_SYSROOT/lib/rustlib/etc"
-
- # Run GDB with the additional arguments that load the pretty printers
-diff --git a/src/etc/rust-gdbgui b/src/etc/rust-gdbgui
-index 9744913..613737d 100755
--- a/src/etc/rust-gdbgui
+++ b/src/etc/rust-gdbgui
@@ -40,7 +40,7 @@ else
-RUSTC_SYSROOT="$("$RUSTC" --print=sysroot)"
+RUSTC_SYSROOT="$(if type "$RUSTC" >/dev/null 2>&1; then "$RUSTC" --print=sysroot; else echo /usr; fi)"
GDB_PYTHON_MODULE_DIRECTORY="$RUSTC_SYSROOT/lib/rustlib/etc"
-
- # Set the environment variable `RUST_GDB` to overwrite the call to a
+ # Get the commit hash for path remapping
+ RUSTC_COMMIT_HASH="$("$RUSTC" -vV | sed -n 's/commit-hash: \([a-zA-Z0-9_]*\)/\1/p')"
# Patches for upstream
# pending, or forwarded
-u-ignore-reproducible-failure.patch
u-reproducible-build.patch
u-ignore-endian-big-diff.patch
u-fix-get-toml-when-test.patch
-u-fix-sysroot-detection-logic.patch
-
-# can be dropped once upstream updates rustix
-u-fix-rustix-for-sparc64.patch
# not forwarded, or forwarded but unlikely to be merged
u-ignore-ppc-hangs.patch
u-rustc-llvm-cross-flags.patch
u-reproducible-dl-stage0.patch
-u-make-tests-work-without-rpath.patch
#u-allow-system-compiler-rt.patch
# Debian-specific patches, not suitable for upstream
+++ /dev/null
---- a/vendor/rustix/src/termios/constants.rs
-+++ b/vendor/rustix/src/termios/constants.rs
-@@ -33,6 +33,8 @@
- )))]
- pub use backend::termios::types::B1500000;
- #[cfg(not(any(
-+ target_arch = "sparc",
-+ target_arch = "sparc64",
- target_os = "dragonfly",
- target_os = "freebsd",
- target_os = "haiku",
-@@ -96,6 +98,8 @@
- )))]
- pub use backend::termios::types::B4000000;
- #[cfg(not(any(
-+ target_arch = "sparc",
-+ target_arch = "sparc64",
- target_os = "dragonfly",
- target_os = "haiku",
- target_os = "ios",
-@@ -104,6 +108,8 @@
- )))]
- pub use backend::termios::types::B460800;
- #[cfg(not(any(
-+ target_arch = "sparc",
-+ target_arch = "sparc64",
- target_os = "dragonfly",
- target_os = "freebsd",
- target_os = "haiku",
-@@ -116,6 +122,8 @@
- )))]
- pub use backend::termios::types::B500000;
- #[cfg(not(any(
-+ target_arch = "sparc",
-+ target_arch = "sparc64",
- target_os = "dragonfly",
- target_os = "freebsd",
- target_os = "haiku",
-@@ -732,6 +740,8 @@
- )))]
- backend::termios::types::B500000 => Some(500_000),
- #[cfg(not(any(
-+ target_arch = "sparc",
-+ target_arch = "sparc64",
- target_os = "dragonfly",
- target_os = "freebsd",
- target_os = "haiku",
-@@ -744,6 +754,8 @@
- )))]
- backend::termios::types::B576000 => Some(576_000),
- #[cfg(not(any(
-+ target_arch = "sparc",
-+ target_arch = "sparc64",
- target_os = "dragonfly",
- target_os = "haiku",
- target_os = "ios",
-@@ -752,6 +764,8 @@
- )))]
- backend::termios::types::B921600 => Some(921_600),
- #[cfg(not(any(
-+ target_arch = "sparc",
-+ target_arch = "sparc64",
- target_os = "dragonfly",
- target_os = "freebsd",
- target_os = "haiku",
---- a/vendor/rustix/src/termios/mod.rs
-+++ b/vendor/rustix/src/termios/mod.rs
-@@ -41,6 +41,8 @@
- )))]
- pub use constants::B1500000;
- #[cfg(not(any(
-+ target_arch = "sparc",
-+ target_arch = "sparc64",
- target_os = "dragonfly",
- target_os = "freebsd",
- target_os = "haiku",
-@@ -104,6 +106,8 @@
- )))]
- pub use constants::B4000000;
- #[cfg(not(any(
-+ target_arch = "sparc",
-+ target_arch = "sparc64",
- target_os = "dragonfly",
- target_os = "haiku",
- target_os = "ios",
-@@ -112,6 +116,8 @@
- )))]
- pub use constants::B460800;
- #[cfg(not(any(
-+ target_arch = "sparc",
-+ target_arch = "sparc64",
- target_os = "dragonfly",
- target_os = "freebsd",
- target_os = "haiku",
-@@ -124,6 +130,8 @@
- )))]
- pub use constants::B500000;
- #[cfg(not(any(
-+ target_arch = "sparc",
-+ target_arch = "sparc64",
- target_os = "dragonfly",
- target_os = "freebsd",
- target_os = "haiku",
+++ /dev/null
-Description: Fix sysroot detection which would result in /usr/lib/lib/rustlib
- This patch is a mixture of two upstream fix attempts. The first from
- https://github.com/rust-lang/rust/pull/108376 didn't actually solve the
- problem in Debian's case. After reporting that in $Bug, a second attempt is
- made at https://github.com/rust-lang/rust/pull/110281, which worked.
-Bug: https://github.com/rust-lang/rust/issues/109994
---- a/compiler/rustc_session/src/filesearch.rs
-+++ b/compiler/rustc_session/src/filesearch.rs
-@@ -179,7 +179,7 @@
- ))?;
-
- // if `dir` points target's dir, move up to the sysroot
-- if dir.ends_with(crate::config::host_triple()) {
-+ let mut sysroot_dir = if dir.ends_with(crate::config::host_triple()) {
- dir.parent() // chop off `$target`
- .and_then(|p| p.parent()) // chop off `rustlib`
- .and_then(|p| {
-@@ -194,13 +194,25 @@
- }
- })
- .map(|s| s.to_owned())
-- .ok_or(format!(
-+ .ok_or_else(|| format!(
- "Could not move 3 levels upper using `parent()` on {}",
- dir.display()
-- ))
-+ ))?
- } else {
-- Ok(dir.to_owned())
-+ dir.to_owned()
-+ };
-+
-+ // On multiarch linux systems, there will be multiarch directory named
-+ // with the architecture(e.g `x86_64-linux-gnu`) under the `lib` directory.
-+ // Which cause us to mistakenly end up in the lib directory instead of the sysroot directory.
-+ if sysroot_dir.ends_with("lib") {
-+ sysroot_dir =
-+ sysroot_dir.parent().map(|real_sysroot| real_sysroot.to_owned()).ok_or_else(
-+ || format!("Could not move to parent path of {}", sysroot_dir.display()),
-+ )?
- }
-+
-+ Ok(sysroot_dir)
- }
-
- // Use env::args().next() to get the path of the executable without
+++ /dev/null
-From: Debian Rust Maintainers <pkg-rust-maintainers@alioth-lists.debian.net>
-Date: Thu, 14 Jul 2022 13:17:37 +0200
-Subject: u-ignore-reproducible-failure
-
-Bug: https://github.com/rust-lang/rust/issues/89911
----
- src/test/run-make-fulldeps/reproducible-build-2/Makefile | 2 +-
- 1 file changed, 1 insertion(+), 1 deletion(-)
-
-diff --git a/tests/run-make-fulldeps/reproducible-build-2/Makefile b/tests/run-make-fulldeps/reproducible-build-2/Makefile
-index fd94516..957e1f4 100644
---- a/tests/run-make-fulldeps/reproducible-build-2/Makefile
-+++ b/tests/run-make-fulldeps/reproducible-build-2/Makefile
-@@ -14,7 +14,7 @@ fat_lto:
- $(RUSTC) reproducible-build.rs -C lto=fat
- cp $(TMPDIR)/reproducible-build $(TMPDIR)/reproducible-build-a
- $(RUSTC) reproducible-build.rs -C lto=fat
-- cmp "$(TMPDIR)/reproducible-build-a" "$(TMPDIR)/reproducible-build" || exit 1
-+ cmp "$(TMPDIR)/reproducible-build-a" "$(TMPDIR)/reproducible-build" || exit 0
-
- sysroot:
- rm -rf $(TMPDIR) && mkdir $(TMPDIR)
+++ /dev/null
-From: Chris Coulson <chris.coulson@canonical.com>
-Date: Thu, 14 Jul 2022 13:17:38 +0200
-Subject: u-make-tests-work-without-rpath
-
-Forwarded: TODO
-
-===================================================================
----
- src/test/run-make-fulldeps/sysroot-crates-are-unstable/Makefile | 6 +++++-
- 1 file changed, 5 insertions(+), 1 deletion(-)
-
-diff --git a/tests/run-make-fulldeps/sysroot-crates-are-unstable/Makefile b/tests/run-make-fulldeps/sysroot-crates-are-unstable/Makefile
-index 1e267fb..ac46c24 100644
---- a/tests/run-make-fulldeps/sysroot-crates-are-unstable/Makefile
-+++ b/tests/run-make-fulldeps/sysroot-crates-are-unstable/Makefile
-@@ -1,2 +1,6 @@
-+include ../tools.mk
-+
-+RUSTC := $(RUSTC_ORIGINAL)
-+
- all:
-- '$(PYTHON)' test.py
-+ $(HOST_RPATH_ENV) '$(PYTHON)' test.py