Merge branch 'master' into f28

This commit is contained in:
Josh Stone 2019-04-11 13:31:44 -07:00
commit a9106e5fab
6 changed files with 36 additions and 162 deletions

8
.gitignore vendored
View File

@ -186,3 +186,11 @@
/rust-1.32.0-powerpc64-unknown-linux-gnu.tar.xz
/rust-1.32.0-s390x-unknown-linux-gnu.tar.xz
/rust-1.32.0-x86_64-unknown-linux-gnu.tar.xz
/rustc-1.34.0-src.tar.xz
/rust-1.33.0-aarch64-unknown-linux-gnu.tar.xz
/rust-1.33.0-armv7-unknown-linux-gnueabihf.tar.xz
/rust-1.33.0-i686-unknown-linux-gnu.tar.xz
/rust-1.33.0-powerpc64le-unknown-linux-gnu.tar.xz
/rust-1.33.0-powerpc64-unknown-linux-gnu.tar.xz
/rust-1.33.0-s390x-unknown-linux-gnu.tar.xz
/rust-1.33.0-x86_64-unknown-linux-gnu.tar.xz

View File

@ -1,90 +0,0 @@
From 72cd8aedc2901d6a6b598eadc001cc39040ae487 Mon Sep 17 00:00:00 2001
From: Josh Stone <jistone@redhat.com>
Date: Wed, 12 Dec 2018 16:51:31 -0800
Subject: [PATCH] Try to get the target triple from rustc itself
The prior method was trying to pick the triple out of the sysroot path.
A FIXME comment already notes that this doesn't work with custom
toolchains in rustup. It also fails with distro-installed toolchains,
where the sysroot may simply be `/usr`.
The output of `rustc -Vv` is a more reliable source, as it contains a
line like `host: x86_64-unknown-linux-gnu`. This should be enough to
identify the triple for any `rustc`, but just in case, the path-based
code is kept as a fallback.
---
src/loader.rs | 41 ++++++++++++++++++++++++++++++++++++++---
1 file changed, 38 insertions(+), 3 deletions(-)
diff --git a/src/loader.rs b/src/loader.rs
index 645c95139164..fe92bef1c596 100644
--- a/src/loader.rs
+++ b/src/loader.rs
@@ -108,9 +108,33 @@ impl AnalysisLoader for CargoAnalysisLoader {
}
}
+fn extract_target_triple(sys_root_path: &Path) -> String {
+ // First try to get the triple from the rustc version output,
+ // otherwise fall back on the rustup-style toolchain path.
+ extract_rustc_host_triple()
+ .unwrap_or_else(|| extract_rustup_target_triple(sys_root_path))
+}
+
+fn extract_rustc_host_triple() -> Option<String> {
+ let rustc = env::var("RUSTC").unwrap_or(String::from("rustc"));
+ let verbose_version = Command::new(rustc)
+ .arg("--verbose")
+ .arg("--version")
+ .output()
+ .ok()
+ .and_then(|out| String::from_utf8(out.stdout).ok())?;
+
+ // Extracts the triple from a line like `host: x86_64-unknown-linux-gnu`
+ verbose_version
+ .lines()
+ .find(|line| line.starts_with("host: "))
+ .and_then(|host| host.split_whitespace().nth(1))
+ .map(String::from)
+}
+
// FIXME: This can fail when using a custom toolchain in rustup (often linked to
// `/$rust_repo/build/$target/stage2`)
-fn extract_target_triple(sys_root_path: &Path) -> String {
+fn extract_rustup_target_triple(sys_root_path: &Path) -> String {
// Extracts nightly-x86_64-pc-windows-msvc from
// $HOME/.rustup/toolchains/nightly-x86_64-pc-windows-msvc
let toolchain = sys_root_path
@@ -169,7 +193,7 @@ mod tests {
r#"C:\Users\user\.rustup\toolchains\nightly-x86_64-pc-windows-msvc"#,
);
assert_eq!(
- extract_target_triple(path),
+ extract_rustup_target_triple(path),
String::from("x86_64-pc-windows-msvc")
);
}
@@ -180,8 +204,19 @@ mod tests {
"/home/user/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu",
);
assert_eq!(
- extract_target_triple(path),
+ extract_rustup_target_triple(path),
String::from("x86_64-unknown-linux-gnu")
);
}
+
+ #[test]
+ fn target_triple() {
+ let sys_root_path = sys_root_path();
+ let target_triple = extract_target_triple(&sys_root_path);
+ let target_path = sys_root_path
+ .join("lib")
+ .join("rustlib")
+ .join(&target_triple);
+ assert!(target_path.is_dir(), "{:?} is not a directory!", target_path);
+ }
}
--
2.19.2

View File

@ -1,30 +0,0 @@
From 9430423cab6909792fb1b3a850f1c3c8974a5111 Mon Sep 17 00:00:00 2001
From: Josh Stone <jistone@redhat.com>
Date: Tue, 15 Jan 2019 15:14:17 -0800
Subject: [PATCH] [rust-gdb] relax the GDB version regex
The pretty-printer script is checking `gdb.VERSION` to see if it's at
least 8.1 for some features. With `re.match`, it will only find the
version at the beginning of that string, but in Fedora the string is
something like "Fedora 8.2-5.fc29". Using `re.search` instead will find
the first location that matches anywhere, so it will find my 8.2.
---
src/etc/gdb_rust_pretty_printing.py | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/etc/gdb_rust_pretty_printing.py b/src/etc/gdb_rust_pretty_printing.py
index 08ae289d6037..b9413563fd9f 100755
--- a/src/etc/gdb_rust_pretty_printing.py
+++ b/src/etc/gdb_rust_pretty_printing.py
@@ -16,7 +16,7 @@ rust_enabled = 'set language rust' in gdb.execute('complete set language ru', to
# This fix went in 8.1, so check for that.
# See https://github.com/rust-lang/rust/issues/56730
gdb_81 = False
-_match = re.match('([0-9]+)\\.([0-9]+)', gdb.VERSION)
+_match = re.search('([0-9]+)\\.([0-9]+)', gdb.VERSION)
if _match:
if int(_match.group(1)) > 8 or (int(_match.group(1)) == 8 and int(_match.group(2)) >= 1):
gdb_81 = True
--
2.20.1

View File

@ -9,10 +9,10 @@
# e.g. 1.10.0 wants rustc: 1.9.0-2016-05-24
# or nightly wants some beta-YYYY-MM-DD
# Note that cargo matches the program version here, not its crate version.
%global bootstrap_rust 1.32.0
%global bootstrap_cargo 1.32.0
%global bootstrap_rust 1.33.0
%global bootstrap_cargo 1.33.0
%global bootstrap_channel %{bootstrap_rust}
%global bootstrap_date 2019-01-17
%global bootstrap_date 2019-02-28
# Only the specified arches will use bootstrap binaries.
#global bootstrap_arches %%{rust_arches}
@ -53,7 +53,7 @@
%endif
Name: rust
Version: 1.33.0
Version: 1.34.0
Release: 1%{?dist}
Summary: The Rust Programming Language
License: (ASL 2.0 or MIT) and (BSD and MIT)
@ -68,15 +68,9 @@ ExclusiveArch: %{rust_arches}
%endif
Source0: https://static.rust-lang.org/dist/%{rustc_package}.tar.xz
# https://github.com/rust-dev-tools/rls-analysis/pull/160
Patch1: 0001-Try-to-get-the-target-triple-from-rustc-itself.patch
# https://github.com/rust-lang/rust/pull/57647
Patch2: 0001-rust-gdb-relax-the-GDB-version-regex.patch
# Revert https://github.com/rust-lang/rust/pull/57840
# We do have the necessary fix in our LLVM 7.
Patch3: rust-pr57840-llvm7-debuginfo-variants.patch
Patch1: rust-pr57840-llvm7-debuginfo-variants.patch
# Get the Rust triple for any arch.
%{lua: function rust_triple(arch)
@ -161,8 +155,7 @@ BuildRequires: cmake3 >= 3.4.3
Provides: bundled(llvm) = 8.0.0~svn
%else
BuildRequires: cmake >= 2.8.11
%if 0%{?epel} || 0%{?fedora} >= 30
# TODO: for f30+, we'll be ready for LLVM8 in Rust 1.34
%if 0%{?epel}
%global llvm llvm7.0
%endif
%if %defined llvm
@ -226,10 +219,6 @@ Requires: /usr/bin/cc
%if "%{llvm_root}" == "%{_prefix}" || 0%{?scl:1}
%global llvm_has_filecheck 1
%endif
%if "%{llvm_root}" != "%{_prefix}"
# https://github.com/rust-lang/rust/issues/40717
%global library_path $(%{llvm_root}/bin/llvm-config --libdir)
%endif
%endif
%description
@ -406,28 +395,19 @@ test -f '%{local_rust_root}/bin/rustc'
%setup -q -n %{rustc_package}
pushd vendor/rls-analysis
%patch1 -p1
popd
%patch2 -p1
%patch3 -p1 -R
%patch1 -p1 -R
%if "%{python}" == "python3"
sed -i.try-py3 -e '/try python2.7/i try python3 "$@"' ./configure
%endif
%if %without bundled_llvm
rm -rf src/llvm/
rm -rf src/llvm-project/
%endif
# We never enable emscripten.
rm -rf src/llvm-emscripten/
# We never enable other LLVM tools.
rm -rf src/tools/clang
rm -rf src/tools/lld
rm -rf src/tools/lldb
# rename bundled license for packaging
cp -a vendor/backtrace-sys/src/libbacktrace/LICENSE{,-libbacktrace}
@ -464,7 +444,6 @@ export LIBSSH2_SYS_USE_PKG_CONFIG=1
%endif
%{?cmake_path:export PATH=%{cmake_path}:$PATH}
%{?library_path:export LIBRARY_PATH="%{library_path}"}
%{?rustflags:export RUSTFLAGS="%{rustflags}"}
# We're going to override --libdir when configuring to get rustlib into a
@ -472,7 +451,7 @@ export LIBSSH2_SYS_USE_PKG_CONFIG=1
%global common_libdir %{_prefix}/lib
%global rustlibdir %{common_libdir}/rustlib
%ifarch %{arm} %{ix86}
%ifarch %{arm} %{ix86} s390x
# full debuginfo is exhausting memory; just do libstd for now
# https://github.com/rust-lang/rust/issues/45854
%if (0%{?fedora} && 0%{?fedora} < 27) || (0%{?rhel} && 0%{?rhel} <= 7)
@ -506,7 +485,6 @@ export LIBSSH2_SYS_USE_PKG_CONFIG=1
%install
%{?cmake_path:export PATH=%{cmake_path}:$PATH}
%{?library_path:export LIBRARY_PATH="%{library_path}"}
%{?rustflags:export RUSTFLAGS="%{rustflags}"}
DESTDIR=%{buildroot} %{python} ./x.py install
@ -575,7 +553,6 @@ rm -f %{buildroot}%{rustlibdir}/etc/lldb_*.py*
%check
%{?cmake_path:export PATH=%{cmake_path}:$PATH}
%{?library_path:export LIBRARY_PATH="%{library_path}"}
%{?rustflags:export RUSTFLAGS="%{rustflags}"}
# The results are not stable on koji, so mask errors and just log it.
@ -603,7 +580,7 @@ rm -f %{buildroot}%{rustlibdir}/etc/lldb_*.py*
%dir %{rustlibdir}/%{rust_triple}/lib
%{rustlibdir}/%{rust_triple}/lib/*.so
%{rustlibdir}/%{rust_triple}/codegen-backends/
%exclude %{_bindir}/{cargo-,}miri
%exclude %{_bindir}/*miri
%files std-static
@ -622,6 +599,7 @@ rm -f %{buildroot}%{rustlibdir}/etc/lldb_*.py*
%files gdb
%{_bindir}/rust-gdb
%{rustlibdir}/etc/gdb_*.py*
%exclude %{_bindir}/rust-gdbgui
%if %with lldb
@ -638,7 +616,9 @@ rm -f %{buildroot}%{rustlibdir}/etc/lldb_*.py*
%{_docdir}/%{name}/html/*/
%{_docdir}/%{name}/html/*.html
%{_docdir}/%{name}/html/*.css
%{_docdir}/%{name}/html/*.ico
%{_docdir}/%{name}/html/*.js
%{_docdir}/%{name}/html/*.png
%{_docdir}/%{name}/html/*.svg
%{_docdir}/%{name}/html/*.woff
%license %{_docdir}/%{name}/html/*.txt
@ -691,6 +671,12 @@ rm -f %{buildroot}%{rustlibdir}/etc/lldb_*.py*
%changelog
* Thu Apr 11 2019 Josh Stone <jistone@redhat.com> - 1.34.0-1
- Update to 1.34.0.
* Fri Mar 01 2019 Josh Stone <jistone@redhat.com> - 1.33.0-2
- Fix deprecations for self-rebuild
* Thu Feb 28 2019 Josh Stone <jistone@redhat.com> - 1.33.0-1
- Update to 1.33.0.

View File

@ -1 +1 @@
SHA512 (rustc-1.33.0-src.tar.xz) = 3291e4e19f75f44c81e6fcf4c01edc7c9d326eca43722381231abcf2e99f4314059ba59a29b79f5511ad9421c358c45e8fe18584d6954d17fe2aabad0f9d9147
SHA512 (rustc-1.34.0-src.tar.xz) = cf9952cafe42987f84a6fe9e351a401f2db35c33ddc87d2efb762c4c33a643ffe516f00d848a1ae759f48cea1504243b6169c29ab28ba2e6b00a51422c745861

View File

@ -1,8 +1,8 @@
SHA512 (rustc-1.33.0-src.tar.xz) = 3291e4e19f75f44c81e6fcf4c01edc7c9d326eca43722381231abcf2e99f4314059ba59a29b79f5511ad9421c358c45e8fe18584d6954d17fe2aabad0f9d9147
SHA512 (rust-1.32.0-aarch64-unknown-linux-gnu.tar.xz) = b077c54bf38935a55a36fec39d1822562da760489ca924d48978e87b9ac5dc4b5107a7eb08dea0412a5a44c255428c649e31f07a5a67567c715de8644581018d
SHA512 (rust-1.32.0-armv7-unknown-linux-gnueabihf.tar.xz) = abadddae0a8de3ee326d1145e3bbe571d9ec0d80261569b6350dbc0fa38b9d31590933c318785f92b75c7add35d7b45e7713a3f1ef7dfd3de085b7255a855b2a
SHA512 (rust-1.32.0-i686-unknown-linux-gnu.tar.xz) = bec62be3e9f5e37197c10357a386a7083941f44151eab28e7a1c8892c0e8e65d168e1220d5e807bb55b9c86ef046bad5cb23fad89def9cb51d22ff69fb436172
SHA512 (rust-1.32.0-powerpc64le-unknown-linux-gnu.tar.xz) = 058c1ebe58bb22e8ff791a74edb058e7494e2673dd1d91ffad646ec71cfdc240e934b44fbae6e58639143b33161d314224e7d1c7b2cc35677bf9eab901e130eb
SHA512 (rust-1.32.0-powerpc64-unknown-linux-gnu.tar.xz) = e4c70ab500feccb2ed67435857f584381be051ba7b2d70cea55b0c94b846e61ba10930a20ceceb67ec981daa5baa166fc6dea7c14ac9ac28270c30841d9c16a1
SHA512 (rust-1.32.0-s390x-unknown-linux-gnu.tar.xz) = 4f32934472356d9b7e15abb0fa07be9eddccc7b9e0a1834bbee5ff279c6ece9174d942e2feed611f9b697613ee3b76f8a8ab68559b6d075e740aeab117223325
SHA512 (rust-1.32.0-x86_64-unknown-linux-gnu.tar.xz) = 5c5def0c415b0f34e1e7476841a0bd3f91fe4bde8321c7b06b1cd2a3d10a3d676ed16a26561929ce39c3c2cbcf7a16960c5decca9e385afe8295da32b4fb7a17
SHA512 (rustc-1.34.0-src.tar.xz) = cf9952cafe42987f84a6fe9e351a401f2db35c33ddc87d2efb762c4c33a643ffe516f00d848a1ae759f48cea1504243b6169c29ab28ba2e6b00a51422c745861
SHA512 (rust-1.33.0-aarch64-unknown-linux-gnu.tar.xz) = 51f6ca909411fd3b3c05baedc38be8a29923966e7cd6960a10152886687132d4ef9750140c5121b9486d6f6ee1ed7ff35f8105c9f0731fe98ce750d0ea9c528f
SHA512 (rust-1.33.0-armv7-unknown-linux-gnueabihf.tar.xz) = 25a16c576d826115fdac5a55b89bf3372dfb39c563f2ce7d39b0a7a3c9bdc43eaf10974dfa42e26c5aa04aee169ced3e797fa46fa82bd9f4ceddeddaf6687659
SHA512 (rust-1.33.0-i686-unknown-linux-gnu.tar.xz) = f61f97c529232fd6d7587bbf34c41dd9cc334272b1d523464d7b964aba5a102edaff8d387445e3fdb2b9587c1cdd870e97b9572c9421e79ee047479443f1896d
SHA512 (rust-1.33.0-powerpc64le-unknown-linux-gnu.tar.xz) = 393c808e93792cf2b126d6111834932a55cbf18339942ac0d20fc4a3692b0ac08c21a3c8fd393795f7aafecac5a2c5d7c9415c18017a7453f759f746045f5144
SHA512 (rust-1.33.0-powerpc64-unknown-linux-gnu.tar.xz) = 7d53501d20119ba8d9723650800cdbde17e4ed1719f6258c48c25113082e0400d9ac74ca1bfca54722dbb2049f7b5d34177bb613031c1611daa2545e1706c745
SHA512 (rust-1.33.0-s390x-unknown-linux-gnu.tar.xz) = 755a0203e2c143386cb3729faada4d2c38b254dfa7e6eeb722ec9847d6319a1d3d289c7b77a2bc478d79dbbabfcd826d8b015acd29fbdf5acb591feae1876205
SHA512 (rust-1.33.0-x86_64-unknown-linux-gnu.tar.xz) = b7f3087f34e99517cd729f5ff1f8cce3f3254cb36c734d5b90d878293e4406934c2f597bf7e2941e9257046f62c9274eb4769a64dabfbc5f0bbf2a1703f7fef8