import rust-1.39.0-2.module+el8.2.0+4690+0bc47b91
This commit is contained in:
parent
a0b3e8f7bb
commit
8e6c7e6781
2
.gitignore
vendored
2
.gitignore
vendored
@ -1 +1 @@
|
|||||||
SOURCES/rustc-1.35.0-src.tar.xz
|
SOURCES/rustc-1.39.0-src.tar.xz
|
||||||
|
@ -1 +1 @@
|
|||||||
50cece3a9a40909c1042344e380e50681365e808 SOURCES/rustc-1.35.0-src.tar.xz
|
6cf245536bb7f8e58825f838be9a403579e45640 SOURCES/rustc-1.39.0-src.tar.xz
|
||||||
|
38
SOURCES/0001-Hopefully-fix-rustdoc-build.patch
Normal file
38
SOURCES/0001-Hopefully-fix-rustdoc-build.patch
Normal file
@ -0,0 +1,38 @@
|
|||||||
|
From 73369f32621f6a844a80a8513ae3ded901e4a406 Mon Sep 17 00:00:00 2001
|
||||||
|
From: Mark Rousskov <mark.simulacrum@gmail.com>
|
||||||
|
Date: Tue, 5 Nov 2019 11:16:46 -0500
|
||||||
|
Subject: [PATCH] Hopefully fix rustdoc build
|
||||||
|
|
||||||
|
It's super unclear why this broke when we switched to beta but not
|
||||||
|
previously -- but at least it's hopefully fixed now.
|
||||||
|
---
|
||||||
|
src/bootstrap/builder.rs | 13 ++++++++++++-
|
||||||
|
1 file changed, 12 insertions(+), 1 deletion(-)
|
||||||
|
|
||||||
|
diff --git a/src/bootstrap/builder.rs b/src/bootstrap/builder.rs
|
||||||
|
index 2748903f2d47..2edcef203ad2 100644
|
||||||
|
--- a/src/bootstrap/builder.rs
|
||||||
|
+++ b/src/bootstrap/builder.rs
|
||||||
|
@@ -886,7 +886,18 @@ impl<'a> Builder<'a> {
|
||||||
|
// things still build right, please do!
|
||||||
|
match mode {
|
||||||
|
Mode::Std => metadata.push_str("std"),
|
||||||
|
- _ => {},
|
||||||
|
+ // When we're building rustc tools, they're built with a search path
|
||||||
|
+ // that contains things built during the rustc build. For example,
|
||||||
|
+ // bitflags is built during the rustc build, and is a dependency of
|
||||||
|
+ // rustdoc as well. We're building rustdoc in a different target
|
||||||
|
+ // directory, though, which means that Cargo will rebuild the
|
||||||
|
+ // dependency. When we go on to build rustdoc, we'll look for
|
||||||
|
+ // bitflags, and find two different copies: one built during the
|
||||||
|
+ // rustc step and one that we just built. This isn't always a
|
||||||
|
+ // problem, somehow -- not really clear why -- but we know that this
|
||||||
|
+ // fixes things.
|
||||||
|
+ Mode::ToolRustc => metadata.push_str("tool-rustc"),
|
||||||
|
+ _ => {}
|
||||||
|
}
|
||||||
|
cargo.env("__CARGO_DEFAULT_LIB_METADATA", &metadata);
|
||||||
|
|
||||||
|
--
|
||||||
|
2.23.0
|
||||||
|
|
@ -1,29 +0,0 @@
|
|||||||
From b4131e297e18fde119f6f461b3e622218166b009 Mon Sep 17 00:00:00 2001
|
|
||||||
From: Josh Stone <jistone@redhat.com>
|
|
||||||
Date: Fri, 26 Apr 2019 08:58:14 -0700
|
|
||||||
Subject: [PATCH] Limit internalization in LLVM 8 ThinLTO
|
|
||||||
|
|
||||||
---
|
|
||||||
src/rustllvm/PassWrapper.cpp | 5 ++++-
|
|
||||||
1 file changed, 4 insertions(+), 1 deletion(-)
|
|
||||||
|
|
||||||
diff --git a/src/rustllvm/PassWrapper.cpp b/src/rustllvm/PassWrapper.cpp
|
|
||||||
index 319c66a21f17..0ebef82d3768 100644
|
|
||||||
--- a/src/rustllvm/PassWrapper.cpp
|
|
||||||
+++ b/src/rustllvm/PassWrapper.cpp
|
|
||||||
@@ -873,8 +873,11 @@ LLVMRustCreateThinLTOData(LLVMRustThinLTOModule *modules,
|
|
||||||
return PrevailingType::Unknown;
|
|
||||||
};
|
|
||||||
#if LLVM_VERSION_GE(8, 0)
|
|
||||||
+ // We don't have a complete picture in our use of ThinLTO, just our immediate
|
|
||||||
+ // crate, so we need `ImportEnabled = false` to limit internalization.
|
|
||||||
+ // Otherwise, we sometimes lose `static` values -- see #60184.
|
|
||||||
computeDeadSymbolsWithConstProp(Ret->Index, Ret->GUIDPreservedSymbols,
|
|
||||||
- deadIsPrevailing, /* ImportEnabled = */ true);
|
|
||||||
+ deadIsPrevailing, /* ImportEnabled = */ false);
|
|
||||||
#else
|
|
||||||
computeDeadSymbols(Ret->Index, Ret->GUIDPreservedSymbols, deadIsPrevailing);
|
|
||||||
#endif
|
|
||||||
--
|
|
||||||
2.20.1
|
|
||||||
|
|
@ -1,24 +0,0 @@
|
|||||||
From 26e9a81c487f63c734bb7ac1739cdae2da2cb9b1 Mon Sep 17 00:00:00 2001
|
|
||||||
From: Mazdak Farrokhzad <twingoow@gmail.com>
|
|
||||||
Date: Mon, 15 Apr 2019 04:05:37 +0200
|
|
||||||
Subject: [PATCH] bump bootstrap; fix compiletest wrt. exclude_should_panic
|
|
||||||
|
|
||||||
---
|
|
||||||
src/tools/compiletest/src/main.rs | 1 +
|
|
||||||
1 file changed, 1 insertion(+)
|
|
||||||
|
|
||||||
diff --git a/src/tools/compiletest/src/main.rs b/src/tools/compiletest/src/main.rs
|
|
||||||
index 9e3c49119dea..431fd7969be0 100644
|
|
||||||
--- a/src/tools/compiletest/src/main.rs
|
|
||||||
+++ b/src/tools/compiletest/src/main.rs
|
|
||||||
@@ -523,6 +523,7 @@ pub fn run_tests(config: &Config) {
|
|
||||||
|
|
||||||
pub fn test_opts(config: &Config) -> test::TestOpts {
|
|
||||||
test::TestOpts {
|
|
||||||
+ exclude_should_panic: false,
|
|
||||||
filter: config.filter.clone(),
|
|
||||||
filter_exact: config.filter_exact,
|
|
||||||
run_ignored: if config.run_ignored {
|
|
||||||
--
|
|
||||||
2.21.0
|
|
||||||
|
|
@ -1,229 +0,0 @@
|
|||||||
From 476732995c2f5dc08e20eb8f9f03c628a48f5f41 Mon Sep 17 00:00:00 2001
|
|
||||||
From: Oliver Scherer <github35764891676564198441@oli-obk.de>
|
|
||||||
Date: Thu, 23 May 2019 17:05:48 +0200
|
|
||||||
Subject: [PATCH 1/3] WIP
|
|
||||||
|
|
||||||
---
|
|
||||||
src/librustc_typeck/check/mod.rs | 22 +++++++++++-----------
|
|
||||||
src/test/run-pass/issue-60989.rs | 4 ++++
|
|
||||||
2 files changed, 15 insertions(+), 11 deletions(-)
|
|
||||||
create mode 100644 src/test/run-pass/issue-60989.rs
|
|
||||||
|
|
||||||
diff --git a/src/librustc_typeck/check/mod.rs b/src/librustc_typeck/check/mod.rs
|
|
||||||
index 313ed19b945d..088729f12b1e 100644
|
|
||||||
--- a/src/librustc_typeck/check/mod.rs
|
|
||||||
+++ b/src/librustc_typeck/check/mod.rs
|
|
||||||
@@ -5396,17 +5396,6 @@ impl<'a, 'gcx, 'tcx> FnCtxt<'a, 'gcx, 'tcx> {
|
|
||||||
|
|
||||||
let tcx = self.tcx;
|
|
||||||
|
|
||||||
- match def {
|
|
||||||
- Def::Local(nid) | Def::Upvar(nid, ..) => {
|
|
||||||
- let hid = self.tcx.hir().node_to_hir_id(nid);
|
|
||||||
- let ty = self.local_ty(span, hid).decl_ty;
|
|
||||||
- let ty = self.normalize_associated_types_in(span, &ty);
|
|
||||||
- self.write_ty(hir_id, ty);
|
|
||||||
- return (ty, def);
|
|
||||||
- }
|
|
||||||
- _ => {}
|
|
||||||
- }
|
|
||||||
-
|
|
||||||
let (def, def_id, ty) = self.rewrite_self_ctor(def, span);
|
|
||||||
let path_segs = AstConv::def_ids_for_path_segments(self, segments, self_ty, def);
|
|
||||||
|
|
||||||
@@ -5469,6 +5458,17 @@ impl<'a, 'gcx, 'tcx> FnCtxt<'a, 'gcx, 'tcx> {
|
|
||||||
user_self_ty = None;
|
|
||||||
}
|
|
||||||
|
|
||||||
+ match def {
|
|
||||||
+ Def::Local(nid) | Def::Upvar(nid, ..) => {
|
|
||||||
+ let hid = self.tcx.hir().node_to_hir_id(nid);
|
|
||||||
+ let ty = self.local_ty(span, hid).decl_ty;
|
|
||||||
+ let ty = self.normalize_associated_types_in(span, &ty);
|
|
||||||
+ self.write_ty(hir_id, ty);
|
|
||||||
+ return (ty, def);
|
|
||||||
+ }
|
|
||||||
+ _ => {}
|
|
||||||
+ }
|
|
||||||
+
|
|
||||||
// Now we have to compare the types that the user *actually*
|
|
||||||
// provided against the types that were *expected*. If the user
|
|
||||||
// did not provide any types, then we want to substitute inference
|
|
||||||
diff --git a/src/test/run-pass/issue-60989.rs b/src/test/run-pass/issue-60989.rs
|
|
||||||
new file mode 100644
|
|
||||||
index 000000000000..efaa74da3baa
|
|
||||||
--- /dev/null
|
|
||||||
+++ b/src/test/run-pass/issue-60989.rs
|
|
||||||
@@ -0,0 +1,4 @@
|
|
||||||
+fn main() {
|
|
||||||
+ let c1 = ();
|
|
||||||
+ c1::<()>;
|
|
||||||
+}
|
|
||||||
--
|
|
||||||
2.21.0
|
|
||||||
|
|
||||||
|
|
||||||
From 97f204e6ae43bfe0fed64221d709a194bef728a4 Mon Sep 17 00:00:00 2001
|
|
||||||
From: Oliver Scherer <github35764891676564198441@oli-obk.de>
|
|
||||||
Date: Thu, 23 May 2019 17:21:32 +0200
|
|
||||||
Subject: [PATCH 2/3] Make regression test a compile-fail test
|
|
||||||
|
|
||||||
---
|
|
||||||
src/test/{run-pass => compile-fail}/issue-60989.rs | 0
|
|
||||||
1 file changed, 0 insertions(+), 0 deletions(-)
|
|
||||||
rename src/test/{run-pass => compile-fail}/issue-60989.rs (100%)
|
|
||||||
|
|
||||||
diff --git a/src/test/run-pass/issue-60989.rs b/src/test/compile-fail/issue-60989.rs
|
|
||||||
similarity index 100%
|
|
||||||
rename from src/test/run-pass/issue-60989.rs
|
|
||||||
rename to src/test/compile-fail/issue-60989.rs
|
|
||||||
--
|
|
||||||
2.21.0
|
|
||||||
|
|
||||||
|
|
||||||
From 6e81f8205a6d47648d086d26e96bf05e962e3715 Mon Sep 17 00:00:00 2001
|
|
||||||
From: Eduard-Mihai Burtescu <edy.burt@gmail.com>
|
|
||||||
Date: Thu, 23 May 2019 19:23:00 +0300
|
|
||||||
Subject: [PATCH 3/3] rustc_typeck: don't produce a `DefId` or `Ty` from
|
|
||||||
`rewrite_self_ctor`, only a `Def`.
|
|
||||||
|
|
||||||
---
|
|
||||||
src/librustc_typeck/check/mod.rs | 30 ++++++++++++++++++----------
|
|
||||||
src/test/compile-fail/issue-60989.rs | 4 ----
|
|
||||||
src/test/ui/issue-60989.rs | 18 +++++++++++++++++
|
|
||||||
src/test/ui/issue-60989.stderr | 15 ++++++++++++++
|
|
||||||
4 files changed, 52 insertions(+), 15 deletions(-)
|
|
||||||
delete mode 100644 src/test/compile-fail/issue-60989.rs
|
|
||||||
create mode 100644 src/test/ui/issue-60989.rs
|
|
||||||
create mode 100644 src/test/ui/issue-60989.stderr
|
|
||||||
|
|
||||||
diff --git a/src/librustc_typeck/check/mod.rs b/src/librustc_typeck/check/mod.rs
|
|
||||||
index 088729f12b1e..b6adcdbf35e9 100644
|
|
||||||
--- a/src/librustc_typeck/check/mod.rs
|
|
||||||
+++ b/src/librustc_typeck/check/mod.rs
|
|
||||||
@@ -5330,7 +5330,7 @@ impl<'a, 'gcx, 'tcx> FnCtxt<'a, 'gcx, 'tcx> {
|
|
||||||
}
|
|
||||||
|
|
||||||
// Rewrite `SelfCtor` to `Ctor`
|
|
||||||
- pub fn rewrite_self_ctor(&self, def: Def, span: Span) -> (Def, DefId, Ty<'tcx>) {
|
|
||||||
+ pub fn rewrite_self_ctor(&self, def: Def, span: Span) -> Def {
|
|
||||||
let tcx = self.tcx;
|
|
||||||
if let Def::SelfCtor(impl_def_id) = def {
|
|
||||||
let ty = self.impl_self_ty(span, impl_def_id).ty;
|
|
||||||
@@ -5340,8 +5340,7 @@ impl<'a, 'gcx, 'tcx> FnCtxt<'a, 'gcx, 'tcx> {
|
|
||||||
Some(adt_def) if adt_def.has_ctor() => {
|
|
||||||
let variant = adt_def.non_enum_variant();
|
|
||||||
let ctor_def_id = variant.ctor_def_id.unwrap();
|
|
||||||
- let def = Def::Ctor(ctor_def_id, CtorOf::Struct, variant.ctor_kind);
|
|
||||||
- (def, ctor_def_id, tcx.type_of(ctor_def_id))
|
|
||||||
+ Def::Ctor(ctor_def_id, CtorOf::Struct, variant.ctor_kind)
|
|
||||||
}
|
|
||||||
_ => {
|
|
||||||
let mut err = tcx.sess.struct_span_err(span,
|
|
||||||
@@ -5364,16 +5363,11 @@ impl<'a, 'gcx, 'tcx> FnCtxt<'a, 'gcx, 'tcx> {
|
|
||||||
}
|
|
||||||
err.emit();
|
|
||||||
|
|
||||||
- (def, impl_def_id, tcx.types.err)
|
|
||||||
+ def
|
|
||||||
}
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
- let def_id = def.def_id();
|
|
||||||
-
|
|
||||||
- // The things we are substituting into the type should not contain
|
|
||||||
- // escaping late-bound regions, and nor should the base type scheme.
|
|
||||||
- let ty = tcx.type_of(def_id);
|
|
||||||
- (def, def_id, ty)
|
|
||||||
+ def
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@@ -5396,7 +5390,7 @@ impl<'a, 'gcx, 'tcx> FnCtxt<'a, 'gcx, 'tcx> {
|
|
||||||
|
|
||||||
let tcx = self.tcx;
|
|
||||||
|
|
||||||
- let (def, def_id, ty) = self.rewrite_self_ctor(def, span);
|
|
||||||
+ let def = self.rewrite_self_ctor(def, span);
|
|
||||||
let path_segs = AstConv::def_ids_for_path_segments(self, segments, self_ty, def);
|
|
||||||
|
|
||||||
let mut user_self_ty = None;
|
|
||||||
@@ -5501,6 +5495,20 @@ impl<'a, 'gcx, 'tcx> FnCtxt<'a, 'gcx, 'tcx> {
|
|
||||||
tcx.generics_of(*def_id).has_self
|
|
||||||
}).unwrap_or(false);
|
|
||||||
|
|
||||||
+ let (def_id, ty) = if let Def::SelfCtor(impl_def_id) = def {
|
|
||||||
+ // NOTE(eddyb) an error has already been emitted by `rewrite_self_ctor`,
|
|
||||||
+ // avoid using the wrong type here. This isn't in `rewrite_self_ctor`
|
|
||||||
+ // itself because that runs too early (see #60989).
|
|
||||||
+ (impl_def_id, tcx.types.err)
|
|
||||||
+ } else {
|
|
||||||
+ let def_id = def.def_id();
|
|
||||||
+
|
|
||||||
+ // The things we are substituting into the type should not contain
|
|
||||||
+ // escaping late-bound regions, and nor should the base type scheme.
|
|
||||||
+ let ty = tcx.type_of(def_id);
|
|
||||||
+ (def_id, ty)
|
|
||||||
+ };
|
|
||||||
+
|
|
||||||
let substs = AstConv::create_substs_for_generic_args(
|
|
||||||
tcx,
|
|
||||||
def_id,
|
|
||||||
diff --git a/src/test/compile-fail/issue-60989.rs b/src/test/compile-fail/issue-60989.rs
|
|
||||||
deleted file mode 100644
|
|
||||||
index efaa74da3baa..000000000000
|
|
||||||
--- a/src/test/compile-fail/issue-60989.rs
|
|
||||||
+++ /dev/null
|
|
||||||
@@ -1,4 +0,0 @@
|
|
||||||
-fn main() {
|
|
||||||
- let c1 = ();
|
|
||||||
- c1::<()>;
|
|
||||||
-}
|
|
||||||
diff --git a/src/test/ui/issue-60989.rs b/src/test/ui/issue-60989.rs
|
|
||||||
new file mode 100644
|
|
||||||
index 000000000000..930e98bedce8
|
|
||||||
--- /dev/null
|
|
||||||
+++ b/src/test/ui/issue-60989.rs
|
|
||||||
@@ -0,0 +1,18 @@
|
|
||||||
+struct A {}
|
|
||||||
+struct B {}
|
|
||||||
+
|
|
||||||
+impl From<A> for B {
|
|
||||||
+ fn from(a: A) -> B {
|
|
||||||
+ B{}
|
|
||||||
+ }
|
|
||||||
+}
|
|
||||||
+
|
|
||||||
+fn main() {
|
|
||||||
+ let c1 = ();
|
|
||||||
+ c1::<()>;
|
|
||||||
+ //~^ ERROR type arguments are not allowed for this type
|
|
||||||
+
|
|
||||||
+ let c1 = A {};
|
|
||||||
+ c1::<Into<B>>;
|
|
||||||
+ //~^ ERROR type arguments are not allowed for this type
|
|
||||||
+}
|
|
||||||
diff --git a/src/test/ui/issue-60989.stderr b/src/test/ui/issue-60989.stderr
|
|
||||||
new file mode 100644
|
|
||||||
index 000000000000..55a0b9626df7
|
|
||||||
--- /dev/null
|
|
||||||
+++ b/src/test/ui/issue-60989.stderr
|
|
||||||
@@ -0,0 +1,15 @@
|
|
||||||
+error[E0109]: type arguments are not allowed for this type
|
|
||||||
+ --> $DIR/issue-60989.rs:12:10
|
|
||||||
+ |
|
|
||||||
+LL | c1::<()>;
|
|
||||||
+ | ^^ type argument not allowed
|
|
||||||
+
|
|
||||||
+error[E0109]: type arguments are not allowed for this type
|
|
||||||
+ --> $DIR/issue-60989.rs:16:10
|
|
||||||
+ |
|
|
||||||
+LL | c1::<Into<B>>;
|
|
||||||
+ | ^^^^^^^ type argument not allowed
|
|
||||||
+
|
|
||||||
+error: aborting due to 2 previous errors
|
|
||||||
+
|
|
||||||
+For more information about this error, try `rustc --explain E0109`.
|
|
||||||
--
|
|
||||||
2.21.0
|
|
||||||
|
|
479
SOURCES/rust-pr65474-split-rustc-dev.patch
Normal file
479
SOURCES/rust-pr65474-split-rustc-dev.patch
Normal file
@ -0,0 +1,479 @@
|
|||||||
|
From 8e0007f829661e57d008d2e908c95f6e84b04b25 Mon Sep 17 00:00:00 2001
|
||||||
|
From: bors <bors@rust-lang.org>
|
||||||
|
Date: Thu, 24 Oct 2019 07:27:00 +0000
|
||||||
|
Subject: [PATCH] Auto merge of #65474 - Mark-Simulacrum:rustc-dev-split,
|
||||||
|
r=pietroalbini
|
||||||
|
|
||||||
|
Split the rustc target libraries into separate rustc-dev component
|
||||||
|
|
||||||
|
This is re-applies a squashed version of #64823 as well as including #65337 to fix bugs noted after merging the first PR.
|
||||||
|
|
||||||
|
The second PR is confirmed as fixing windows-gnu, and presumably also fixes other platforms, such as musl (i.e. #65335 should be fixed); `RUSTUP_DIST_SERVER=https://dev-static.rust-lang.org rustup toolchain install nightly-2019-10-16` can be installed to confirm that this is indeed the case.
|
||||||
|
|
||||||
|
diff --git a/src/bootstrap/builder.rs b/src/bootstrap/builder.rs
|
||||||
|
index b8071b98f707..2748903f2d47 100644
|
||||||
|
--- a/src/bootstrap/builder.rs
|
||||||
|
+++ b/src/bootstrap/builder.rs
|
||||||
|
@@ -443,6 +443,7 @@ impl<'a> Builder<'a> {
|
||||||
|
dist::Rustc,
|
||||||
|
dist::DebuggerScripts,
|
||||||
|
dist::Std,
|
||||||
|
+ dist::RustcDev,
|
||||||
|
dist::Analysis,
|
||||||
|
dist::Src,
|
||||||
|
dist::PlainSourceTarball,
|
||||||
|
diff --git a/src/bootstrap/check.rs b/src/bootstrap/check.rs
|
||||||
|
index cadb9a7e441f..df1c72575846 100644
|
||||||
|
--- a/src/bootstrap/check.rs
|
||||||
|
+++ b/src/bootstrap/check.rs
|
||||||
|
@@ -55,6 +55,7 @@ impl Step for Std {
|
||||||
|
cargo,
|
||||||
|
args(builder.kind),
|
||||||
|
&libstd_stamp(builder, compiler, target),
|
||||||
|
+ vec![],
|
||||||
|
true);
|
||||||
|
|
||||||
|
let libdir = builder.sysroot_libdir(compiler, target);
|
||||||
|
@@ -103,6 +104,7 @@ impl Step for Rustc {
|
||||||
|
cargo,
|
||||||
|
args(builder.kind),
|
||||||
|
&librustc_stamp(builder, compiler, target),
|
||||||
|
+ vec![],
|
||||||
|
true);
|
||||||
|
|
||||||
|
let libdir = builder.sysroot_libdir(compiler, target);
|
||||||
|
@@ -155,6 +157,7 @@ impl Step for CodegenBackend {
|
||||||
|
cargo,
|
||||||
|
args(builder.kind),
|
||||||
|
&codegen_backend_stamp(builder, compiler, target, backend),
|
||||||
|
+ vec![],
|
||||||
|
true);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
@@ -199,6 +202,7 @@ impl Step for Rustdoc {
|
||||||
|
cargo,
|
||||||
|
args(builder.kind),
|
||||||
|
&rustdoc_stamp(builder, compiler, target),
|
||||||
|
+ vec![],
|
||||||
|
true);
|
||||||
|
|
||||||
|
let libdir = builder.sysroot_libdir(compiler, target);
|
||||||
|
diff --git a/src/bootstrap/compile.rs b/src/bootstrap/compile.rs
|
||||||
|
index 5074b035789a..da8d43ed49b7 100644
|
||||||
|
--- a/src/bootstrap/compile.rs
|
||||||
|
+++ b/src/bootstrap/compile.rs
|
||||||
|
@@ -69,7 +69,7 @@ impl Step for Std {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
- builder.ensure(StartupObjects { compiler, target });
|
||||||
|
+ let mut target_deps = builder.ensure(StartupObjects { compiler, target });
|
||||||
|
|
||||||
|
let compiler_to_use = builder.compiler_for(compiler.stage, compiler.host, target);
|
||||||
|
if compiler_to_use != compiler {
|
||||||
|
@@ -91,7 +91,7 @@ impl Step for Std {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
- copy_third_party_objects(builder, &compiler, target);
|
||||||
|
+ target_deps.extend(copy_third_party_objects(builder, &compiler, target).into_iter());
|
||||||
|
|
||||||
|
let mut cargo = builder.cargo(compiler, Mode::Std, target, "build");
|
||||||
|
std_cargo(builder, &compiler, target, &mut cargo);
|
||||||
|
@@ -102,6 +102,7 @@ impl Step for Std {
|
||||||
|
cargo,
|
||||||
|
vec![],
|
||||||
|
&libstd_stamp(builder, compiler, target),
|
||||||
|
+ target_deps,
|
||||||
|
false);
|
||||||
|
|
||||||
|
builder.ensure(StdLink {
|
||||||
|
@@ -113,9 +114,22 @@ impl Step for Std {
|
||||||
|
}
|
||||||
|
|
||||||
|
/// Copies third pary objects needed by various targets.
|
||||||
|
-fn copy_third_party_objects(builder: &Builder<'_>, compiler: &Compiler, target: Interned<String>) {
|
||||||
|
+fn copy_third_party_objects(builder: &Builder<'_>, compiler: &Compiler, target: Interned<String>)
|
||||||
|
+ -> Vec<PathBuf>
|
||||||
|
+{
|
||||||
|
let libdir = builder.sysroot_libdir(*compiler, target);
|
||||||
|
|
||||||
|
+ let mut target_deps = vec![];
|
||||||
|
+
|
||||||
|
+ let mut copy_and_stamp = |sourcedir: &Path, name: &str| {
|
||||||
|
+ let target = libdir.join(name);
|
||||||
|
+ builder.copy(
|
||||||
|
+ &sourcedir.join(name),
|
||||||
|
+ &target,
|
||||||
|
+ );
|
||||||
|
+ target_deps.push(target);
|
||||||
|
+ };
|
||||||
|
+
|
||||||
|
// Copies the crt(1,i,n).o startup objects
|
||||||
|
//
|
||||||
|
// Since musl supports fully static linking, we can cross link for it even
|
||||||
|
@@ -123,19 +137,13 @@ fn copy_third_party_objects(builder: &Builder<'_>, compiler: &Compiler, target:
|
||||||
|
// files. As those shipped with glibc won't work, copy the ones provided by
|
||||||
|
// musl so we have them on linux-gnu hosts.
|
||||||
|
if target.contains("musl") {
|
||||||
|
+ let srcdir = builder.musl_root(target).unwrap().join("lib");
|
||||||
|
for &obj in &["crt1.o", "crti.o", "crtn.o"] {
|
||||||
|
- builder.copy(
|
||||||
|
- &builder.musl_root(target).unwrap().join("lib").join(obj),
|
||||||
|
- &libdir.join(obj),
|
||||||
|
- );
|
||||||
|
+ copy_and_stamp(&srcdir, obj);
|
||||||
|
}
|
||||||
|
} else if target.ends_with("-wasi") {
|
||||||
|
- for &obj in &["crt1.o"] {
|
||||||
|
- builder.copy(
|
||||||
|
- &builder.wasi_root(target).unwrap().join("lib/wasm32-wasi").join(obj),
|
||||||
|
- &libdir.join(obj),
|
||||||
|
- );
|
||||||
|
- }
|
||||||
|
+ let srcdir = builder.wasi_root(target).unwrap().join("lib/wasm32-wasi");
|
||||||
|
+ copy_and_stamp(&srcdir, "crt1.o");
|
||||||
|
}
|
||||||
|
|
||||||
|
// Copies libunwind.a compiled to be linked wit x86_64-fortanix-unknown-sgx.
|
||||||
|
@@ -145,11 +153,11 @@ fn copy_third_party_objects(builder: &Builder<'_>, compiler: &Compiler, target:
|
||||||
|
// which is provided by std for this target.
|
||||||
|
if target == "x86_64-fortanix-unknown-sgx" {
|
||||||
|
let src_path_env = "X86_FORTANIX_SGX_LIBS";
|
||||||
|
- let obj = "libunwind.a";
|
||||||
|
let src = env::var(src_path_env).expect(&format!("{} not found in env", src_path_env));
|
||||||
|
- let src = Path::new(&src).join(obj);
|
||||||
|
- builder.copy(&src, &libdir.join(obj));
|
||||||
|
+ copy_and_stamp(Path::new(&src), "libunwind.a");
|
||||||
|
}
|
||||||
|
+
|
||||||
|
+ target_deps
|
||||||
|
}
|
||||||
|
|
||||||
|
/// Configure cargo to compile the standard library, adding appropriate env vars
|
||||||
|
@@ -306,7 +314,7 @@ pub struct StartupObjects {
|
||||||
|
}
|
||||||
|
|
||||||
|
impl Step for StartupObjects {
|
||||||
|
- type Output = ();
|
||||||
|
+ type Output = Vec<PathBuf>;
|
||||||
|
|
||||||
|
fn should_run(run: ShouldRun<'_>) -> ShouldRun<'_> {
|
||||||
|
run.path("src/rtstartup")
|
||||||
|
@@ -325,13 +333,15 @@ impl Step for StartupObjects {
|
||||||
|
/// They don't require any library support as they're just plain old object
|
||||||
|
/// files, so we just use the nightly snapshot compiler to always build them (as
|
||||||
|
/// no other compilers are guaranteed to be available).
|
||||||
|
- fn run(self, builder: &Builder<'_>) {
|
||||||
|
+ fn run(self, builder: &Builder<'_>) -> Vec<PathBuf> {
|
||||||
|
let for_compiler = self.compiler;
|
||||||
|
let target = self.target;
|
||||||
|
if !target.contains("windows-gnu") {
|
||||||
|
- return
|
||||||
|
+ return vec![]
|
||||||
|
}
|
||||||
|
|
||||||
|
+ let mut target_deps = vec![];
|
||||||
|
+
|
||||||
|
let src_dir = &builder.src.join("src/rtstartup");
|
||||||
|
let dst_dir = &builder.native_dir(target).join("rtstartup");
|
||||||
|
let sysroot_dir = &builder.sysroot_libdir(for_compiler, target);
|
||||||
|
@@ -350,7 +360,9 @@ impl Step for StartupObjects {
|
||||||
|
.arg(src_file));
|
||||||
|
}
|
||||||
|
|
||||||
|
- builder.copy(dst_file, &sysroot_dir.join(file.to_string() + ".o"));
|
||||||
|
+ let target = sysroot_dir.join(file.to_string() + ".o");
|
||||||
|
+ builder.copy(dst_file, &target);
|
||||||
|
+ target_deps.push(target);
|
||||||
|
}
|
||||||
|
|
||||||
|
for obj in ["crt2.o", "dllcrt2.o"].iter() {
|
||||||
|
@@ -358,8 +370,12 @@ impl Step for StartupObjects {
|
||||||
|
builder.cc(target),
|
||||||
|
target,
|
||||||
|
obj);
|
||||||
|
- builder.copy(&src, &sysroot_dir.join(obj));
|
||||||
|
+ let target = sysroot_dir.join(obj);
|
||||||
|
+ builder.copy(&src, &target);
|
||||||
|
+ target_deps.push(target);
|
||||||
|
}
|
||||||
|
+
|
||||||
|
+ target_deps
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@@ -437,6 +453,7 @@ impl Step for Rustc {
|
||||||
|
cargo,
|
||||||
|
vec![],
|
||||||
|
&librustc_stamp(builder, compiler, target),
|
||||||
|
+ vec![],
|
||||||
|
false);
|
||||||
|
|
||||||
|
builder.ensure(RustcLink {
|
||||||
|
@@ -585,7 +602,7 @@ impl Step for CodegenBackend {
|
||||||
|
|
||||||
|
let tmp_stamp = out_dir.join(".tmp.stamp");
|
||||||
|
|
||||||
|
- let files = run_cargo(builder, cargo, vec![], &tmp_stamp, false);
|
||||||
|
+ let files = run_cargo(builder, cargo, vec![], &tmp_stamp, vec![], false);
|
||||||
|
if builder.config.dry_run {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
@@ -941,6 +958,7 @@ pub fn run_cargo(builder: &Builder<'_>,
|
||||||
|
cargo: Cargo,
|
||||||
|
tail_args: Vec<String>,
|
||||||
|
stamp: &Path,
|
||||||
|
+ additional_target_deps: Vec<PathBuf>,
|
||||||
|
is_check: bool)
|
||||||
|
-> Vec<PathBuf>
|
||||||
|
{
|
||||||
|
@@ -1057,6 +1075,7 @@ pub fn run_cargo(builder: &Builder<'_>,
|
||||||
|
deps.push((path_to_add.into(), false));
|
||||||
|
}
|
||||||
|
|
||||||
|
+ deps.extend(additional_target_deps.into_iter().map(|d| (d, false)));
|
||||||
|
deps.sort();
|
||||||
|
let mut new_contents = Vec::new();
|
||||||
|
for (dep, proc_macro) in deps.iter() {
|
||||||
|
diff --git a/src/bootstrap/dist.rs b/src/bootstrap/dist.rs
|
||||||
|
index 514ad1144491..93143570b0fe 100644
|
||||||
|
--- a/src/bootstrap/dist.rs
|
||||||
|
+++ b/src/bootstrap/dist.rs
|
||||||
|
@@ -637,6 +637,28 @@ impl Step for DebuggerScripts {
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
+fn skip_host_target_lib(builder: &Builder<'_>, compiler: Compiler) -> bool {
|
||||||
|
+ // The only true set of target libraries came from the build triple, so
|
||||||
|
+ // let's reduce redundant work by only producing archives from that host.
|
||||||
|
+ if compiler.host != builder.config.build {
|
||||||
|
+ builder.info("\tskipping, not a build host");
|
||||||
|
+ true
|
||||||
|
+ } else {
|
||||||
|
+ false
|
||||||
|
+ }
|
||||||
|
+}
|
||||||
|
+
|
||||||
|
+/// Copy stamped files into an image's `target/lib` directory.
|
||||||
|
+fn copy_target_libs(builder: &Builder<'_>, target: &str, image: &Path, stamp: &Path) {
|
||||||
|
+ let dst = image.join("lib/rustlib").join(target).join("lib");
|
||||||
|
+ t!(fs::create_dir_all(&dst));
|
||||||
|
+ for (path, host) in builder.read_stamp_file(stamp) {
|
||||||
|
+ if !host || builder.config.build == target {
|
||||||
|
+ builder.copy(&path, &dst.join(path.file_name().unwrap()));
|
||||||
|
+ }
|
||||||
|
+ }
|
||||||
|
+}
|
||||||
|
+
|
||||||
|
#[derive(Debug, PartialOrd, Ord, Copy, Clone, Hash, PartialEq, Eq)]
|
||||||
|
pub struct Std {
|
||||||
|
pub compiler: Compiler,
|
||||||
|
@@ -667,44 +689,19 @@ impl Step for Std {
|
||||||
|
let target = self.target;
|
||||||
|
|
||||||
|
let name = pkgname(builder, "rust-std");
|
||||||
|
-
|
||||||
|
- // The only true set of target libraries came from the build triple, so
|
||||||
|
- // let's reduce redundant work by only producing archives from that host.
|
||||||
|
- if compiler.host != builder.config.build {
|
||||||
|
- builder.info("\tskipping, not a build host");
|
||||||
|
- return distdir(builder).join(format!("{}-{}.tar.gz", name, target));
|
||||||
|
+ let archive = distdir(builder).join(format!("{}-{}.tar.gz", name, target));
|
||||||
|
+ if skip_host_target_lib(builder, compiler) {
|
||||||
|
+ return archive;
|
||||||
|
}
|
||||||
|
|
||||||
|
- // We want to package up as many target libraries as possible
|
||||||
|
- // for the `rust-std` package, so if this is a host target we
|
||||||
|
- // depend on librustc and otherwise we just depend on libtest.
|
||||||
|
- if builder.hosts.iter().any(|t| t == target) {
|
||||||
|
- builder.ensure(compile::Rustc { compiler, target });
|
||||||
|
- } else {
|
||||||
|
- builder.ensure(compile::Std { compiler, target });
|
||||||
|
- }
|
||||||
|
+ builder.ensure(compile::Std { compiler, target });
|
||||||
|
|
||||||
|
let image = tmpdir(builder).join(format!("{}-{}-image", name, target));
|
||||||
|
let _ = fs::remove_dir_all(&image);
|
||||||
|
|
||||||
|
- let dst = image.join("lib/rustlib").join(target);
|
||||||
|
- t!(fs::create_dir_all(&dst));
|
||||||
|
- let mut src = builder.sysroot_libdir(compiler, target).to_path_buf();
|
||||||
|
- src.pop(); // Remove the trailing /lib folder from the sysroot_libdir
|
||||||
|
- builder.cp_filtered(&src, &dst, &|path| {
|
||||||
|
- if let Some(name) = path.file_name().and_then(|s| s.to_str()) {
|
||||||
|
- if name == builder.config.rust_codegen_backends_dir.as_str() {
|
||||||
|
- return false
|
||||||
|
- }
|
||||||
|
- if name == "bin" {
|
||||||
|
- return false
|
||||||
|
- }
|
||||||
|
- if name.contains("LLVM") {
|
||||||
|
- return false
|
||||||
|
- }
|
||||||
|
- }
|
||||||
|
- true
|
||||||
|
- });
|
||||||
|
+ let compiler_to_use = builder.compiler_for(compiler.stage, compiler.host, target);
|
||||||
|
+ let stamp = compile::libstd_stamp(builder, compiler_to_use, target);
|
||||||
|
+ copy_target_libs(builder, &target, &image, &stamp);
|
||||||
|
|
||||||
|
let mut cmd = rust_installer(builder);
|
||||||
|
cmd.arg("generate")
|
||||||
|
@@ -723,7 +720,73 @@ impl Step for Std {
|
||||||
|
let _time = timeit(builder);
|
||||||
|
builder.run(&mut cmd);
|
||||||
|
builder.remove_dir(&image);
|
||||||
|
- distdir(builder).join(format!("{}-{}.tar.gz", name, target))
|
||||||
|
+ archive
|
||||||
|
+ }
|
||||||
|
+}
|
||||||
|
+
|
||||||
|
+#[derive(Debug, PartialOrd, Ord, Copy, Clone, Hash, PartialEq, Eq)]
|
||||||
|
+pub struct RustcDev {
|
||||||
|
+ pub compiler: Compiler,
|
||||||
|
+ pub target: Interned<String>,
|
||||||
|
+}
|
||||||
|
+
|
||||||
|
+impl Step for RustcDev {
|
||||||
|
+ type Output = PathBuf;
|
||||||
|
+ const DEFAULT: bool = true;
|
||||||
|
+ const ONLY_HOSTS: bool = true;
|
||||||
|
+
|
||||||
|
+ fn should_run(run: ShouldRun<'_>) -> ShouldRun<'_> {
|
||||||
|
+ run.path("rustc-dev")
|
||||||
|
+ }
|
||||||
|
+
|
||||||
|
+ fn make_run(run: RunConfig<'_>) {
|
||||||
|
+ run.builder.ensure(RustcDev {
|
||||||
|
+ compiler: run.builder.compiler_for(
|
||||||
|
+ run.builder.top_stage,
|
||||||
|
+ run.builder.config.build,
|
||||||
|
+ run.target,
|
||||||
|
+ ),
|
||||||
|
+ target: run.target,
|
||||||
|
+ });
|
||||||
|
+ }
|
||||||
|
+
|
||||||
|
+ fn run(self, builder: &Builder<'_>) -> PathBuf {
|
||||||
|
+ let compiler = self.compiler;
|
||||||
|
+ let target = self.target;
|
||||||
|
+
|
||||||
|
+ let name = pkgname(builder, "rustc-dev");
|
||||||
|
+ let archive = distdir(builder).join(format!("{}-{}.tar.gz", name, target));
|
||||||
|
+ if skip_host_target_lib(builder, compiler) {
|
||||||
|
+ return archive;
|
||||||
|
+ }
|
||||||
|
+
|
||||||
|
+ builder.ensure(compile::Rustc { compiler, target });
|
||||||
|
+
|
||||||
|
+ let image = tmpdir(builder).join(format!("{}-{}-image", name, target));
|
||||||
|
+ let _ = fs::remove_dir_all(&image);
|
||||||
|
+
|
||||||
|
+ let compiler_to_use = builder.compiler_for(compiler.stage, compiler.host, target);
|
||||||
|
+ let stamp = compile::librustc_stamp(builder, compiler_to_use, target);
|
||||||
|
+ copy_target_libs(builder, &target, &image, &stamp);
|
||||||
|
+
|
||||||
|
+ let mut cmd = rust_installer(builder);
|
||||||
|
+ cmd.arg("generate")
|
||||||
|
+ .arg("--product-name=Rust")
|
||||||
|
+ .arg("--rel-manifest-dir=rustlib")
|
||||||
|
+ .arg("--success-message=Rust-is-ready-to-develop.")
|
||||||
|
+ .arg("--image-dir").arg(&image)
|
||||||
|
+ .arg("--work-dir").arg(&tmpdir(builder))
|
||||||
|
+ .arg("--output-dir").arg(&distdir(builder))
|
||||||
|
+ .arg(format!("--package-name={}-{}", name, target))
|
||||||
|
+ .arg(format!("--component-name=rustc-dev-{}", target))
|
||||||
|
+ .arg("--legacy-manifest-dirs=rustlib,cargo");
|
||||||
|
+
|
||||||
|
+ builder.info(&format!("Dist rustc-dev stage{} ({} -> {})",
|
||||||
|
+ compiler.stage, &compiler.host, target));
|
||||||
|
+ let _time = timeit(builder);
|
||||||
|
+ builder.run(&mut cmd);
|
||||||
|
+ builder.remove_dir(&image);
|
||||||
|
+ archive
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
diff --git a/src/bootstrap/lib.rs b/src/bootstrap/lib.rs
|
||||||
|
index a182405f3b2d..d1cf1cbca784 100644
|
||||||
|
--- a/src/bootstrap/lib.rs
|
||||||
|
+++ b/src/bootstrap/lib.rs
|
||||||
|
@@ -1137,6 +1137,7 @@ impl Build {
|
||||||
|
pub fn copy(&self, src: &Path, dst: &Path) {
|
||||||
|
if self.config.dry_run { return; }
|
||||||
|
self.verbose_than(1, &format!("Copy {:?} to {:?}", src, dst));
|
||||||
|
+ if src == dst { return; }
|
||||||
|
let _ = fs::remove_file(&dst);
|
||||||
|
let metadata = t!(src.symlink_metadata());
|
||||||
|
if metadata.file_type().is_symlink() {
|
||||||
|
diff --git a/src/tools/build-manifest/src/main.rs b/src/tools/build-manifest/src/main.rs
|
||||||
|
index f41e7dd17ede..c0d2deab2f8b 100644
|
||||||
|
--- a/src/tools/build-manifest/src/main.rs
|
||||||
|
+++ b/src/tools/build-manifest/src/main.rs
|
||||||
|
@@ -399,6 +399,7 @@ impl Builder {
|
||||||
|
fn add_packages_to(&mut self, manifest: &mut Manifest) {
|
||||||
|
let mut package = |name, targets| self.package(name, &mut manifest.pkg, targets);
|
||||||
|
package("rustc", HOSTS);
|
||||||
|
+ package("rustc-dev", HOSTS);
|
||||||
|
package("cargo", HOSTS);
|
||||||
|
package("rust-mingw", MINGW);
|
||||||
|
package("rust-std", TARGETS);
|
||||||
|
@@ -426,6 +427,13 @@ impl Builder {
|
||||||
|
"rls-preview", "rust-src", "llvm-tools-preview",
|
||||||
|
"lldb-preview", "rust-analysis", "miri-preview"
|
||||||
|
]);
|
||||||
|
+
|
||||||
|
+ // The compiler libraries are not stable for end users, but `rustc-dev` was only recently
|
||||||
|
+ // split out of `rust-std`. We'll include it by default as a transition for nightly users.
|
||||||
|
+ if self.rust_release == "nightly" {
|
||||||
|
+ self.extend_profile("default", &mut manifest.profiles, &["rustc-dev"]);
|
||||||
|
+ self.extend_profile("complete", &mut manifest.profiles, &["rustc-dev"]);
|
||||||
|
+ }
|
||||||
|
}
|
||||||
|
|
||||||
|
fn add_renames_to(&self, manifest: &mut Manifest) {
|
||||||
|
@@ -481,6 +489,15 @@ impl Builder {
|
||||||
|
components.push(host_component("rust-mingw"));
|
||||||
|
}
|
||||||
|
|
||||||
|
+ // The compiler libraries are not stable for end users, but `rustc-dev` was only recently
|
||||||
|
+ // split out of `rust-std`. We'll include it by default as a transition for nightly users,
|
||||||
|
+ // but ship it as an optional component on the beta and stable channels.
|
||||||
|
+ if self.rust_release == "nightly" {
|
||||||
|
+ components.push(host_component("rustc-dev"));
|
||||||
|
+ } else {
|
||||||
|
+ extensions.push(host_component("rustc-dev"));
|
||||||
|
+ }
|
||||||
|
+
|
||||||
|
// Tools are always present in the manifest,
|
||||||
|
// but might be marked as unavailable if they weren't built.
|
||||||
|
extensions.extend(vec![
|
||||||
|
@@ -498,6 +515,11 @@ impl Builder {
|
||||||
|
.filter(|&&target| target != host)
|
||||||
|
.map(|target| Component::from_str("rust-std", target))
|
||||||
|
);
|
||||||
|
+ extensions.extend(
|
||||||
|
+ HOSTS.iter()
|
||||||
|
+ .filter(|&&target| target != host)
|
||||||
|
+ .map(|target| Component::from_str("rustc-dev", target))
|
||||||
|
+ );
|
||||||
|
extensions.push(Component::from_str("rust-src", "*"));
|
||||||
|
|
||||||
|
// If the components/extensions don't actually exist for this
|
||||||
|
@@ -534,6 +556,14 @@ impl Builder {
|
||||||
|
dst.insert(profile_name.to_owned(), pkgs.iter().map(|s| (*s).to_owned()).collect());
|
||||||
|
}
|
||||||
|
|
||||||
|
+ fn extend_profile(&mut self,
|
||||||
|
+ profile_name: &str,
|
||||||
|
+ dst: &mut BTreeMap<String, Vec<String>>,
|
||||||
|
+ pkgs: &[&str]) {
|
||||||
|
+ dst.get_mut(profile_name).expect("existing profile")
|
||||||
|
+ .extend(pkgs.iter().map(|s| (*s).to_owned()));
|
||||||
|
+ }
|
||||||
|
+
|
||||||
|
fn package(&mut self,
|
||||||
|
pkgname: &str,
|
||||||
|
dst: &mut BTreeMap<String, Package>,
|
39
SOURCES/rust-pr66317-bindir-relative.patch
Normal file
39
SOURCES/rust-pr66317-bindir-relative.patch
Normal file
@ -0,0 +1,39 @@
|
|||||||
|
diff --git a/src/bootstrap/builder.rs b/src/bootstrap/builder.rs
|
||||||
|
index 2748903f2d47..10d02d6db829 100644
|
||||||
|
--- a/src/bootstrap/builder.rs
|
||||||
|
+++ b/src/bootstrap/builder.rs
|
||||||
|
@@ -1231,7 +1231,8 @@ impl<'a> Builder<'a> {
|
||||||
|
cargo.arg("--frozen");
|
||||||
|
}
|
||||||
|
|
||||||
|
- cargo.env("RUSTC_INSTALL_BINDIR", &self.config.bindir);
|
||||||
|
+ // Try to use a sysroot-relative bindir, in case it was configured absolutely.
|
||||||
|
+ cargo.env("RUSTC_INSTALL_BINDIR", self.config.bindir_relative());
|
||||||
|
|
||||||
|
self.ci_env.force_coloring_in_ci(&mut cargo);
|
||||||
|
|
||||||
|
diff --git a/src/bootstrap/config.rs b/src/bootstrap/config.rs
|
||||||
|
index d1bdfa0a7676..0c03b95c7b25 100644
|
||||||
|
--- a/src/bootstrap/config.rs
|
||||||
|
+++ b/src/bootstrap/config.rs
|
||||||
|
@@ -647,6 +647,20 @@ impl Config {
|
||||||
|
config
|
||||||
|
}
|
||||||
|
|
||||||
|
+ /// Try to find the relative path of `bindir`, otherwise return it in full.
|
||||||
|
+ pub fn bindir_relative(&self) -> &Path {
|
||||||
|
+ let bindir = &self.bindir;
|
||||||
|
+ if bindir.is_absolute() {
|
||||||
|
+ // Try to make it relative to the prefix.
|
||||||
|
+ if let Some(prefix) = &self.prefix {
|
||||||
|
+ if let Ok(stripped) = bindir.strip_prefix(prefix) {
|
||||||
|
+ return stripped;
|
||||||
|
+ }
|
||||||
|
+ }
|
||||||
|
+ }
|
||||||
|
+ bindir
|
||||||
|
+ }
|
||||||
|
+
|
||||||
|
/// Try to find the relative path of `libdir`.
|
||||||
|
pub fn libdir_relative(&self) -> Option<&Path> {
|
||||||
|
let libdir = self.libdir.as_ref()?;
|
42
SOURCES/rustc-1.39.0-disable-libssh2.patch
Normal file
42
SOURCES/rustc-1.39.0-disable-libssh2.patch
Normal file
@ -0,0 +1,42 @@
|
|||||||
|
--- rustc-1.39.0-src/Cargo.lock.orig 2019-11-04 07:45:21.000000000 -0800
|
||||||
|
+++ rustc-1.39.0-src/Cargo.lock 2019-11-08 13:25:37.743377197 -0800
|
||||||
|
@@ -1697,7 +1697,6 @@
|
||||||
|
dependencies = [
|
||||||
|
"cc",
|
||||||
|
"libc",
|
||||||
|
- "libssh2-sys",
|
||||||
|
"libz-sys",
|
||||||
|
"openssl-sys",
|
||||||
|
"pkg-config",
|
||||||
|
@@ -1714,20 +1713,6 @@
|
||||||
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
-name = "libssh2-sys"
|
||||||
|
-version = "0.2.11"
|
||||||
|
-source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
-checksum = "126a1f4078368b163bfdee65fbab072af08a1b374a5551b21e87ade27b1fbf9d"
|
||||||
|
-dependencies = [
|
||||||
|
- "cc",
|
||||||
|
- "libc",
|
||||||
|
- "libz-sys",
|
||||||
|
- "openssl-sys",
|
||||||
|
- "pkg-config",
|
||||||
|
- "vcpkg",
|
||||||
|
-]
|
||||||
|
-
|
||||||
|
-[[package]]
|
||||||
|
name = "libz-sys"
|
||||||
|
version = "1.0.25"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
--- rustc-1.39.0-src/vendor/git2/Cargo.toml.orig 2019-11-04 09:34:41.000000000 -0800
|
||||||
|
+++ rustc-1.39.0-src/vendor/git2/Cargo.toml 2019-11-08 13:25:13.174904479 -0800
|
||||||
|
@@ -55,7 +55,7 @@
|
||||||
|
version = "0.1.39"
|
||||||
|
|
||||||
|
[features]
|
||||||
|
-default = ["ssh", "https", "ssh_key_from_memory"]
|
||||||
|
+default = ["https"]
|
||||||
|
https = ["libgit2-sys/https", "openssl-sys", "openssl-probe"]
|
||||||
|
ssh = ["libgit2-sys/ssh"]
|
||||||
|
ssh_key_from_memory = ["libgit2-sys/ssh_key_from_memory"]
|
110
SPECS/rust.spec
110
SPECS/rust.spec
@ -10,10 +10,10 @@
|
|||||||
# e.g. 1.10.0 wants rustc: 1.9.0-2016-05-24
|
# e.g. 1.10.0 wants rustc: 1.9.0-2016-05-24
|
||||||
# or nightly wants some beta-YYYY-MM-DD
|
# or nightly wants some beta-YYYY-MM-DD
|
||||||
# Note that cargo matches the program version here, not its crate version.
|
# Note that cargo matches the program version here, not its crate version.
|
||||||
%global bootstrap_rust 1.34.0
|
%global bootstrap_rust 1.38.0
|
||||||
%global bootstrap_cargo 1.34.0
|
%global bootstrap_cargo 1.38.0
|
||||||
%global bootstrap_channel 1.34.2
|
%global bootstrap_channel 1.38.0
|
||||||
%global bootstrap_date 2019-05-14
|
%global bootstrap_date 2019-09-26
|
||||||
|
|
||||||
# Only the specified arches will use bootstrap binaries.
|
# Only the specified arches will use bootstrap binaries.
|
||||||
#global bootstrap_arches %%{rust_arches}
|
#global bootstrap_arches %%{rust_arches}
|
||||||
@ -22,7 +22,7 @@
|
|||||||
%bcond_with llvm_static
|
%bcond_with llvm_static
|
||||||
|
|
||||||
# We can also choose to just use Rust's bundled LLVM, in case the system LLVM
|
# We can also choose to just use Rust's bundled LLVM, in case the system LLVM
|
||||||
# is insufficient. Rust currently requires LLVM 5.0+.
|
# is insufficient. Rust currently requires LLVM 6.0+.
|
||||||
%if 0%{?rhel} && 0%{?rhel} <= 6 && !0%{?epel}
|
%if 0%{?rhel} && 0%{?rhel} <= 6 && !0%{?epel}
|
||||||
%bcond_without bundled_llvm
|
%bcond_without bundled_llvm
|
||||||
%else
|
%else
|
||||||
@ -36,7 +36,7 @@
|
|||||||
%bcond_without bundled_libgit2
|
%bcond_without bundled_libgit2
|
||||||
|
|
||||||
%if 0%{?rhel}
|
%if 0%{?rhel}
|
||||||
%bcond_without bundled_libssh2
|
%bcond_without disabled_libssh2
|
||||||
%else
|
%else
|
||||||
%bcond_with bundled_libssh2
|
%bcond_with bundled_libssh2
|
||||||
%endif
|
%endif
|
||||||
@ -49,7 +49,7 @@
|
|||||||
%endif
|
%endif
|
||||||
|
|
||||||
Name: rust
|
Name: rust
|
||||||
Version: 1.35.0
|
Version: 1.39.0
|
||||||
Release: 2%{?dist}
|
Release: 2%{?dist}
|
||||||
Summary: The Rust Programming Language
|
Summary: The Rust Programming Language
|
||||||
License: (ASL 2.0 or MIT) and (BSD and MIT)
|
License: (ASL 2.0 or MIT) and (BSD and MIT)
|
||||||
@ -68,14 +68,20 @@ Source0: https://static.rust-lang.org/dist/%{rustc_package}.tar.xz
|
|||||||
# We do have the necessary fix in our LLVM 7.
|
# We do have the necessary fix in our LLVM 7.
|
||||||
Patch1: rust-pr57840-llvm7-debuginfo-variants.patch
|
Patch1: rust-pr57840-llvm7-debuginfo-variants.patch
|
||||||
|
|
||||||
# https://github.com/rust-lang/rust/pull/60313
|
# Reduce the size of rust-std
|
||||||
Patch2: 0001-Limit-internalization-in-LLVM-8-ThinLTO.patch
|
# https://github.com/rust-lang/rust/pull/65474
|
||||||
|
Patch2: rust-pr65474-split-rustc-dev.patch
|
||||||
|
|
||||||
# https://github.com/rust-lang/rust/pull/61085
|
# Fix conflicting libraries of rustc tools
|
||||||
Patch3: rust-pr61085-fix-ICE-with-incorrect-turbofish.patch
|
# https://github.com/rust-lang/rust/commit/73369f32621f6a844a80a8513ae3ded901e4a406
|
||||||
|
Patch3: 0001-Hopefully-fix-rustdoc-build.patch
|
||||||
|
|
||||||
# https://github.com/rust-lang/rust/pull/59974/commits/26e9a81c487f63c734bb7ac1739cdae2da2cb9b1
|
# Fix the bindir used by rustdoc to find rustc
|
||||||
Patch4: 0001-bump-bootstrap-fix-compiletest-wrt.-exclude_should_p.patch
|
# https://github.com/rust-lang/rust/pull/66317
|
||||||
|
Patch4: rust-pr66317-bindir-relative.patch
|
||||||
|
|
||||||
|
# Disable cargo->libgit2->libssh2, as it's not approved for FIPS (rhbz1732949)
|
||||||
|
Patch10: rustc-1.39.0-disable-libssh2.patch
|
||||||
|
|
||||||
# Get the Rust triple for any arch.
|
# Get the Rust triple for any arch.
|
||||||
%{lua: function rust_triple(arch)
|
%{lua: function rust_triple(arch)
|
||||||
@ -143,7 +149,7 @@ BuildRequires: pkgconfig(zlib)
|
|||||||
BuildRequires: pkgconfig(libgit2) >= 0.27
|
BuildRequires: pkgconfig(libgit2) >= 0.27
|
||||||
%endif
|
%endif
|
||||||
|
|
||||||
%if %without bundled_libssh2
|
%if %{without disabled_libssh2} && %{without bundled_libssh2}
|
||||||
# needs libssh2_userauth_publickey_frommemory
|
# needs libssh2_userauth_publickey_frommemory
|
||||||
BuildRequires: pkgconfig(libssh2) >= 1.6.0
|
BuildRequires: pkgconfig(libssh2) >= 1.6.0
|
||||||
%endif
|
%endif
|
||||||
@ -161,7 +167,7 @@ BuildRequires: %{python}
|
|||||||
|
|
||||||
%if %with bundled_llvm
|
%if %with bundled_llvm
|
||||||
BuildRequires: cmake3 >= 3.4.3
|
BuildRequires: cmake3 >= 3.4.3
|
||||||
Provides: bundled(llvm) = 8.0.0~svn
|
Provides: bundled(llvm) = 8.0.0
|
||||||
%else
|
%else
|
||||||
BuildRequires: cmake >= 2.8.11
|
BuildRequires: cmake >= 2.8.11
|
||||||
%if 0%{?epel}
|
%if 0%{?epel}
|
||||||
@ -270,7 +276,11 @@ programs.
|
|||||||
Summary: LLDB pretty printers for Rust
|
Summary: LLDB pretty printers for Rust
|
||||||
BuildArch: noarch
|
BuildArch: noarch
|
||||||
Requires: lldb
|
Requires: lldb
|
||||||
|
%if 0%{?fedora} >= 31 || 0%{?rhel} > 7
|
||||||
Requires: python3-lldb
|
Requires: python3-lldb
|
||||||
|
%else
|
||||||
|
Requires: python2-lldb
|
||||||
|
%endif
|
||||||
Requires: %{name}-debugger-common = %{version}-%{release}
|
Requires: %{name}-debugger-common = %{version}-%{release}
|
||||||
|
|
||||||
%description lldb
|
%description lldb
|
||||||
@ -295,7 +305,7 @@ its standard library.
|
|||||||
%package -n cargo
|
%package -n cargo
|
||||||
Summary: Rust's package manager and build tool
|
Summary: Rust's package manager and build tool
|
||||||
%if %with bundled_libgit2
|
%if %with bundled_libgit2
|
||||||
Provides: bundled(libgit2) = 0.27
|
Provides: bundled(libgit2) = 0.28.2
|
||||||
%endif
|
%endif
|
||||||
%if %with bundled_libssh2
|
%if %with bundled_libssh2
|
||||||
Provides: bundled(libssh2) = 1.8.1~dev
|
Provides: bundled(libssh2) = 1.8.1~dev
|
||||||
@ -305,6 +315,11 @@ BuildRequires: git
|
|||||||
# Cargo is not much use without Rust
|
# Cargo is not much use without Rust
|
||||||
Requires: rust
|
Requires: rust
|
||||||
|
|
||||||
|
# "cargo vendor" is a builtin command starting with 1.37. The Obsoletes and
|
||||||
|
# Provides are mostly relevant to RHEL, but harmless to have on Fedora/etc. too
|
||||||
|
Obsoletes: cargo-vendor <= 0.1.23
|
||||||
|
Provides: cargo-vendor = %{version}-%{release}
|
||||||
|
|
||||||
%description -n cargo
|
%description -n cargo
|
||||||
Cargo is a tool that allows Rust projects to declare their various dependencies
|
Cargo is a tool that allows Rust projects to declare their various dependencies
|
||||||
and ensure that you'll always get a repeatable build.
|
and ensure that you'll always get a repeatable build.
|
||||||
@ -336,7 +351,7 @@ A tool for formatting Rust code according to style guidelines.
|
|||||||
%package -n rls
|
%package -n rls
|
||||||
Summary: Rust Language Server for IDE integration
|
Summary: Rust Language Server for IDE integration
|
||||||
%if %with bundled_libgit2
|
%if %with bundled_libgit2
|
||||||
Provides: bundled(libgit2) = 0.27
|
Provides: bundled(libgit2) = 0.28.2
|
||||||
%endif
|
%endif
|
||||||
%if %with bundled_libssh2
|
%if %with bundled_libssh2
|
||||||
Provides: bundled(libssh2) = 1.8.1~dev
|
Provides: bundled(libssh2) = 1.8.1~dev
|
||||||
@ -406,6 +421,10 @@ test -f '%{local_rust_root}/bin/rustc'
|
|||||||
%patch3 -p1
|
%patch3 -p1
|
||||||
%patch4 -p1
|
%patch4 -p1
|
||||||
|
|
||||||
|
%if %with disabled_libssh2
|
||||||
|
%patch10 -p1
|
||||||
|
%endif
|
||||||
|
|
||||||
%if "%{python}" != "python2"
|
%if "%{python}" != "python2"
|
||||||
sed -i.try-py3 -e '/try python2.7/i try %{python} "$@"' ./configure
|
sed -i.try-py3 -e '/try python2.7/i try %{python} "$@"' ./configure
|
||||||
%endif
|
%endif
|
||||||
@ -417,6 +436,27 @@ rm -rf src/llvm-project/
|
|||||||
# We never enable emscripten.
|
# We never enable emscripten.
|
||||||
rm -rf src/llvm-emscripten/
|
rm -rf src/llvm-emscripten/
|
||||||
|
|
||||||
|
# Remove other unused vendored libraries
|
||||||
|
rm -rf vendor/curl-sys/curl/
|
||||||
|
rm -rf vendor/jemalloc-sys/jemalloc/
|
||||||
|
rm -rf vendor/libz-sys/src/zlib/
|
||||||
|
rm -rf vendor/lzma-sys/xz-*/
|
||||||
|
rm -rf vendor/openssl-src/openssl/
|
||||||
|
|
||||||
|
%if %without bundled_libgit2
|
||||||
|
rm -rf vendor/libgit2-sys/libgit2/
|
||||||
|
%endif
|
||||||
|
|
||||||
|
%if %without bundled_libssh2
|
||||||
|
rm -rf vendor/libssh2-sys/libssh2/
|
||||||
|
%endif
|
||||||
|
%if %with disabled_libssh2
|
||||||
|
rm -rf vendor/libssh2-sys/
|
||||||
|
%endif
|
||||||
|
|
||||||
|
# This only affects the transient rust-installer, but let it use our dynamic xz-libs
|
||||||
|
sed -i.lzma -e '/LZMA_API_STATIC/d' src/bootstrap/tool.rs
|
||||||
|
|
||||||
# rename bundled license for packaging
|
# rename bundled license for packaging
|
||||||
cp -a vendor/backtrace-sys/src/libbacktrace/LICENSE{,-libbacktrace}
|
cp -a vendor/backtrace-sys/src/libbacktrace/LICENSE{,-libbacktrace}
|
||||||
|
|
||||||
@ -439,6 +479,10 @@ sed -i.ffi -e '$a #[link(name = "ffi")] extern {}' \
|
|||||||
find vendor -name .cargo-checksum.json \
|
find vendor -name .cargo-checksum.json \
|
||||||
-exec sed -i.uncheck -e 's/"files":{[^}]*}/"files":{ }/' '{}' '+'
|
-exec sed -i.uncheck -e 's/"files":{[^}]*}/"files":{ }/' '{}' '+'
|
||||||
|
|
||||||
|
# Sometimes Rust sources start with #![...] attributes, and "smart" editors think
|
||||||
|
# it's a shebang and make them executable. Then brp-mangle-shebangs gets upset...
|
||||||
|
find -name '*.rs' -type f -perm /111 -exec chmod -v -x '{}' '+'
|
||||||
|
|
||||||
|
|
||||||
%build
|
%build
|
||||||
|
|
||||||
@ -466,12 +510,12 @@ export LIBSSH2_SYS_USE_PKG_CONFIG=1
|
|||||||
%if (0%{?fedora} && 0%{?fedora} < 27) || (0%{?rhel} && 0%{?rhel} <= 7)
|
%if (0%{?fedora} && 0%{?fedora} < 27) || (0%{?rhel} && 0%{?rhel} <= 7)
|
||||||
# Older rpmbuild didn't work with partial debuginfo coverage.
|
# Older rpmbuild didn't work with partial debuginfo coverage.
|
||||||
%global debug_package %{nil}
|
%global debug_package %{nil}
|
||||||
%define enable_debuginfo --disable-debuginfo --disable-debuginfo-only-std --disable-debuginfo-tools --disable-debuginfo-lines
|
%define enable_debuginfo --debuginfo-level=0
|
||||||
%else
|
%else
|
||||||
%define enable_debuginfo --enable-debuginfo --enable-debuginfo-only-std --disable-debuginfo-tools --disable-debuginfo-lines
|
%define enable_debuginfo --debuginfo-level=0 --debuginfo-level-std=2
|
||||||
%endif
|
%endif
|
||||||
%else
|
%else
|
||||||
%define enable_debuginfo --enable-debuginfo --disable-debuginfo-only-std --enable-debuginfo-tools --disable-debuginfo-lines
|
%define enable_debuginfo --debuginfo-level=2
|
||||||
%endif
|
%endif
|
||||||
|
|
||||||
# We want the best optimization for std, but it caused problems for rpm-ostree
|
# We want the best optimization for std, but it caused problems for rpm-ostree
|
||||||
@ -484,6 +528,7 @@ export LIBSSH2_SYS_USE_PKG_CONFIG=1
|
|||||||
%configure --disable-option-checking \
|
%configure --disable-option-checking \
|
||||||
--libdir=%{common_libdir} \
|
--libdir=%{common_libdir} \
|
||||||
--build=%{rust_triple} --host=%{rust_triple} --target=%{rust_triple} \
|
--build=%{rust_triple} --host=%{rust_triple} --target=%{rust_triple} \
|
||||||
|
--python=%{python} \
|
||||||
--local-rust-root=%{local_rust_root} \
|
--local-rust-root=%{local_rust_root} \
|
||||||
%{!?with_bundled_llvm: --llvm-root=%{llvm_root} \
|
%{!?with_bundled_llvm: --llvm-root=%{llvm_root} \
|
||||||
%{!?llvm_has_filecheck: --disable-codegen-tests} \
|
%{!?llvm_has_filecheck: --disable-codegen-tests} \
|
||||||
@ -523,9 +568,11 @@ find %{buildroot}%{_libdir} -maxdepth 1 -type f -name '*.so' \
|
|||||||
(cd "%{buildroot}%{rustlibdir}/%{rust_triple}/lib" &&
|
(cd "%{buildroot}%{rustlibdir}/%{rust_triple}/lib" &&
|
||||||
find ../../../../%{_lib} -maxdepth 1 -name '*.so' |
|
find ../../../../%{_lib} -maxdepth 1 -name '*.so' |
|
||||||
while read lib; do
|
while read lib; do
|
||||||
# make sure they're actually identical!
|
if [ -f "${lib##*/}" ]; then
|
||||||
cmp "$lib" "${lib##*/}"
|
# make sure they're actually identical!
|
||||||
ln -v -f -s -t . "$lib"
|
cmp "$lib" "${lib##*/}"
|
||||||
|
ln -v -f -s -t . "$lib"
|
||||||
|
fi
|
||||||
done)
|
done)
|
||||||
|
|
||||||
# Remove installer artifacts (manifests, uninstall scripts, etc.)
|
# Remove installer artifacts (manifests, uninstall scripts, etc.)
|
||||||
@ -639,6 +686,7 @@ rm -f %{buildroot}%{rustlibdir}/etc/lldb_*.py*
|
|||||||
%{_docdir}/%{name}/html/*.svg
|
%{_docdir}/%{name}/html/*.svg
|
||||||
%{_docdir}/%{name}/html/*.woff
|
%{_docdir}/%{name}/html/*.woff
|
||||||
%license %{_docdir}/%{name}/html/*.txt
|
%license %{_docdir}/%{name}/html/*.txt
|
||||||
|
%license %{_docdir}/%{name}/html/*.md
|
||||||
|
|
||||||
|
|
||||||
%files -n cargo
|
%files -n cargo
|
||||||
@ -688,6 +736,22 @@ rm -f %{buildroot}%{rustlibdir}/etc/lldb_*.py*
|
|||||||
|
|
||||||
|
|
||||||
%changelog
|
%changelog
|
||||||
|
* Tue Nov 12 2019 Josh Stone <jistone@redhat.com> - 1.39.0-2
|
||||||
|
- Fix a couple build and test issues with rustdoc.
|
||||||
|
|
||||||
|
* Thu Nov 07 2019 Josh Stone <jistone@redhat.com> - 1.39.0-1
|
||||||
|
- Update to 1.39.0.
|
||||||
|
|
||||||
|
* Thu Sep 26 2019 Josh Stone <jistone@redhat.com> - 1.38.0-1
|
||||||
|
- Update to 1.38.0.
|
||||||
|
|
||||||
|
* Thu Aug 15 2019 Josh Stone <jistone@redhat.com> - 1.37.0-1
|
||||||
|
- Update to 1.37.0.
|
||||||
|
- Disable libssh2 (git+ssh support).
|
||||||
|
|
||||||
|
* Thu Jul 04 2019 Josh Stone <jistone@redhat.com> - 1.36.0-1
|
||||||
|
- Update to 1.36.0.
|
||||||
|
|
||||||
* Wed May 29 2019 Josh Stone <jistone@redhat.com> - 1.35.0-2
|
* Wed May 29 2019 Josh Stone <jistone@redhat.com> - 1.35.0-2
|
||||||
- Fix compiletest for rebuild testing.
|
- Fix compiletest for rebuild testing.
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user