beta test

This commit is contained in:
Josh Stone 2019-03-06 16:00:17 -08:00
parent 3e79b5e2c3
commit a103b2abf4
4 changed files with 14 additions and 200 deletions

View File

@ -1,57 +0,0 @@
From 55030c7543d8e877ec7a6b577a51422c38f01259 Mon Sep 17 00:00:00 2001
From: Josh Stone <jistone@redhat.com>
Date: Fri, 1 Mar 2019 09:27:45 -0800
Subject: [PATCH] Backport deprecation fixes from commit b7f030e
---
src/tools/linkchecker/main.rs | 6 +++---
src/tools/tidy/src/features.rs | 2 +-
2 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/src/tools/linkchecker/main.rs b/src/tools/linkchecker/main.rs
index 59662be349dc..2cf0fcfd34cd 100644
--- a/src/tools/linkchecker/main.rs
+++ b/src/tools/linkchecker/main.rs
@@ -78,7 +78,7 @@ impl FileEntry {
fn parse_ids(&mut self, file: &Path, contents: &str, errors: &mut bool) {
if self.ids.is_empty() {
with_attrs_in_source(contents, " id", |fragment, i, _| {
- let frag = fragment.trim_left_matches("#").to_owned();
+ let frag = fragment.trim_start_matches("#").to_owned();
let encoded = small_url_encode(&frag);
if !self.ids.insert(frag) {
*errors = true;
@@ -343,7 +343,7 @@ fn with_attrs_in_source<F: FnMut(&str, usize, &str)>(contents: &str, attr: &str,
Some(i) => i,
None => continue,
};
- if rest[..pos_equals].trim_left_matches(" ") != "" {
+ if rest[..pos_equals].trim_start_matches(" ") != "" {
continue;
}
@@ -355,7 +355,7 @@ fn with_attrs_in_source<F: FnMut(&str, usize, &str)>(contents: &str, attr: &str,
};
let quote_delim = rest.as_bytes()[pos_quote] as char;
- if rest[..pos_quote].trim_left_matches(" ") != "" {
+ if rest[..pos_quote].trim_start_matches(" ") != "" {
continue;
}
let rest = &rest[pos_quote + 1..];
diff --git a/src/tools/tidy/src/features.rs b/src/tools/tidy/src/features.rs
index 2435a0cfd4e3..bf2cfbf32fc7 100644
--- a/src/tools/tidy/src/features.rs
+++ b/src/tools/tidy/src/features.rs
@@ -188,7 +188,7 @@ pub fn collect_lang_features(base_src_path: &Path, bad: &mut bool) -> Features {
}
let mut parts = line.split(',');
- let level = match parts.next().map(|l| l.trim().trim_left_matches('(')) {
+ let level = match parts.next().map(|l| l.trim().trim_start_matches('(')) {
Some("active") => Status::Unstable,
Some("removed") => Status::Removed,
Some("accepted") => Status::Stable,
--
2.20.1

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-25
# Only the specified arches will use bootstrap binaries.
#global bootstrap_arches %%{rust_arches}
@ -53,8 +53,8 @@
%endif
Name: rust
Version: 1.33.0
Release: 2%{?dist}
Version: 1.34.0
Release: 0.1.beta.1%{?dist}
Summary: The Rust Programming Language
License: (ASL 2.0 or MIT) and (BSD and MIT)
# ^ written as: (rust itself) and (bundled libraries)
@ -68,18 +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
# https://github.com/rust-lang/rust/issues/58845
Patch4: 0001-Backport-deprecation-fixes-from-commit-b7f030e.patch
Patch1: rust-pr57840-llvm7-debuginfo-variants.patch
# Get the Rust triple for any arch.
%{lua: function rust_triple(arch)
@ -164,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
@ -409,12 +399,7 @@ test -f '%{local_rust_root}/bin/rustc'
%setup -q -n %{rustc_package}
pushd vendor/rls-analysis
%patch1 -p1
popd
%patch2 -p1
%patch3 -p1 -R
%patch4 -p1
%patch1 -p1 -R
%if "%{python}" == "python3"
sed -i.try-py3 -e '/try python2.7/i try python3 "$@"' ./configure
@ -626,6 +611,7 @@ rm -f %{buildroot}%{rustlibdir}/etc/lldb_*.py*
%files gdb
%{_bindir}/rust-gdb
%{rustlibdir}/etc/gdb_*.py*
%exclude %{_bindir}/rust-gdbgui
%if %with lldb
@ -642,7 +628,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
@ -695,6 +683,9 @@ rm -f %{buildroot}%{rustlibdir}/etc/lldb_*.py*
%changelog
* Wed Mar 06 2019 Josh Stone <jistone@redhat.com> - 1.34.0-0.1.beta.1
- beta test
* Fri Mar 01 2019 Josh Stone <jistone@redhat.com> - 1.33.0-2
- Fix deprecations for self-rebuild