Merge branch 'master' into f28

This commit is contained in:
Josh Stone 2018-09-13 21:36:25 -07:00
commit 3d9f254940
7 changed files with 412 additions and 112 deletions

8
.gitignore vendored
View File

@ -142,3 +142,11 @@
/rust-1.27.2-powerpc64-unknown-linux-gnu.tar.xz
/rust-1.27.2-s390x-unknown-linux-gnu.tar.xz
/rust-1.27.2-x86_64-unknown-linux-gnu.tar.xz
/rustc-1.29.0-src.tar.xz
/rust-1.28.0-aarch64-unknown-linux-gnu.tar.xz
/rust-1.28.0-armv7-unknown-linux-gnueabihf.tar.xz
/rust-1.28.0-i686-unknown-linux-gnu.tar.xz
/rust-1.28.0-powerpc64le-unknown-linux-gnu.tar.xz
/rust-1.28.0-powerpc64-unknown-linux-gnu.tar.xz
/rust-1.28.0-s390x-unknown-linux-gnu.tar.xz
/rust-1.28.0-x86_64-unknown-linux-gnu.tar.xz

View File

@ -0,0 +1,186 @@
From 4b95b1a4fd035a73998dc21b265ce4594e35f8ae Mon Sep 17 00:00:00 2001
From: Alex Crichton <alex@alexcrichton.com>
Date: Thu, 16 Aug 2018 13:19:04 -0700
Subject: [PATCH] Set more llvm function attributes for __rust_try
This shim is generated elsewhere in the compiler so this commit adds support to
ensure it goes through similar paths as the rest of the compiler to set llvm
function attributes like target features.
cc #53372
---
src/librustc_codegen_llvm/attributes.rs | 52 +++++++++++++++++++------
src/librustc_codegen_llvm/base.rs | 21 ----------
src/librustc_codegen_llvm/callee.rs | 2 +-
src/librustc_codegen_llvm/intrinsic.rs | 2 +
src/librustc_codegen_llvm/mono_item.rs | 2 +-
5 files changed, 44 insertions(+), 35 deletions(-)
diff --git a/src/librustc_codegen_llvm/attributes.rs b/src/librustc_codegen_llvm/attributes.rs
index 3b5f927d52f0..2a79ce2f2285 100644
--- a/src/librustc_codegen_llvm/attributes.rs
+++ b/src/librustc_codegen_llvm/attributes.rs
@@ -11,7 +11,7 @@
use std::ffi::{CStr, CString};
-use rustc::hir::CodegenFnAttrFlags;
+use rustc::hir::{CodegenFnAttrFlags, CodegenFnAttrs};
use rustc::hir::def_id::{DefId, LOCAL_CRATE};
use rustc::session::Session;
use rustc::session::config::Sanitizer;
@@ -123,11 +123,37 @@ pub fn llvm_target_features(sess: &Session) -> impl Iterator<Item = &str> {
/// Composite function which sets LLVM attributes for function depending on its AST (#[attribute])
/// attributes.
-pub fn from_fn_attrs(cx: &CodegenCx, llfn: ValueRef, id: DefId) {
- let codegen_fn_attrs = cx.tcx.codegen_fn_attrs(id);
+pub fn from_fn_attrs(
+ cx: &CodegenCx,
+ llfn: ValueRef,
+ id: Option<DefId>,
+) {
+ let codegen_fn_attrs = id.map(|id| cx.tcx.codegen_fn_attrs(id))
+ .unwrap_or(CodegenFnAttrs::new());
inline(llfn, codegen_fn_attrs.inline);
+ // The `uwtable` attribute according to LLVM is:
+ //
+ // This attribute indicates that the ABI being targeted requires that an
+ // unwind table entry be produced for this function even if we can show
+ // that no exceptions passes by it. This is normally the case for the
+ // ELF x86-64 abi, but it can be disabled for some compilation units.
+ //
+ // Typically when we're compiling with `-C panic=abort` (which implies this
+ // `no_landing_pads` check) we don't need `uwtable` because we can't
+ // generate any exceptions! On Windows, however, exceptions include other
+ // events such as illegal instructions, segfaults, etc. This means that on
+ // Windows we end up still needing the `uwtable` attribute even if the `-C
+ // panic=abort` flag is passed.
+ //
+ // You can also find more info on why Windows is whitelisted here in:
+ // https://bugzilla.mozilla.org/show_bug.cgi?id=1302078
+ if !cx.sess().no_landing_pads() ||
+ cx.sess().target.target.options.requires_uwtable {
+ attributes::emit_uwtable(llfn, true);
+ }
+
set_frame_pointer_elimination(cx, llfn);
set_probestack(cx, llfn);
@@ -151,7 +177,7 @@ pub fn from_fn_attrs(cx: &CodegenCx, llfn: ValueRef, id: DefId) {
// *in Rust code* may unwind. Foreign items like `extern "C" {
// fn foo(); }` are assumed not to unwind **unless** they have
// a `#[unwind]` attribute.
- } else if !cx.tcx.is_foreign_item(id) {
+ } else if id.map(|id| !cx.tcx.is_foreign_item(id)).unwrap_or(false) {
Some(true)
} else {
None
@@ -188,14 +214,16 @@ pub fn from_fn_attrs(cx: &CodegenCx, llfn: ValueRef, id: DefId) {
// Note that currently the `wasm-import-module` doesn't do anything, but
// eventually LLVM 7 should read this and ferry the appropriate import
// module to the output file.
- if cx.tcx.sess.target.target.arch == "wasm32" {
- if let Some(module) = wasm_import_module(cx.tcx, id) {
- llvm::AddFunctionAttrStringValue(
- llfn,
- llvm::AttributePlace::Function,
- cstr("wasm-import-module\0"),
- &module,
- );
+ if let Some(id) = id {
+ if cx.tcx.sess.target.target.arch == "wasm32" {
+ if let Some(module) = wasm_import_module(cx.tcx, id) {
+ llvm::AddFunctionAttrStringValue(
+ llfn,
+ llvm::AttributePlace::Function,
+ cstr("wasm-import-module\0"),
+ &module,
+ );
+ }
}
}
}
diff --git a/src/librustc_codegen_llvm/base.rs b/src/librustc_codegen_llvm/base.rs
index 223c04f420f3..b0461582ddcb 100644
--- a/src/librustc_codegen_llvm/base.rs
+++ b/src/librustc_codegen_llvm/base.rs
@@ -486,27 +486,6 @@ pub fn codegen_instance<'a, 'tcx>(cx: &CodegenCx<'a, 'tcx>, instance: Instance<'
cx.stats.borrow_mut().n_closures += 1;
- // The `uwtable` attribute according to LLVM is:
- //
- // This attribute indicates that the ABI being targeted requires that an
- // unwind table entry be produced for this function even if we can show
- // that no exceptions passes by it. This is normally the case for the
- // ELF x86-64 abi, but it can be disabled for some compilation units.
- //
- // Typically when we're compiling with `-C panic=abort` (which implies this
- // `no_landing_pads` check) we don't need `uwtable` because we can't
- // generate any exceptions! On Windows, however, exceptions include other
- // events such as illegal instructions, segfaults, etc. This means that on
- // Windows we end up still needing the `uwtable` attribute even if the `-C
- // panic=abort` flag is passed.
- //
- // You can also find more info on why Windows is whitelisted here in:
- // https://bugzilla.mozilla.org/show_bug.cgi?id=1302078
- if !cx.sess().no_landing_pads() ||
- cx.sess().target.target.options.requires_uwtable {
- attributes::emit_uwtable(lldecl, true);
- }
-
let mir = cx.tcx.instance_mir(instance.def);
mir::codegen_mir(cx, lldecl, &mir, instance, sig);
}
diff --git a/src/librustc_codegen_llvm/callee.rs b/src/librustc_codegen_llvm/callee.rs
index 2c01bd42cc77..97f07792ede8 100644
--- a/src/librustc_codegen_llvm/callee.rs
+++ b/src/librustc_codegen_llvm/callee.rs
@@ -97,7 +97,7 @@ pub fn get_fn<'a, 'tcx>(cx: &CodegenCx<'a, 'tcx>,
if instance.def.is_inline(tcx) {
attributes::inline(llfn, attributes::InlineAttr::Hint);
}
- attributes::from_fn_attrs(cx, llfn, instance.def.def_id());
+ attributes::from_fn_attrs(cx, llfn, Some(instance.def.def_id()));
let instance_def_id = instance.def_id();
diff --git a/src/librustc_codegen_llvm/intrinsic.rs b/src/librustc_codegen_llvm/intrinsic.rs
index 9c5c0f730c16..f69fce15dc55 100644
--- a/src/librustc_codegen_llvm/intrinsic.rs
+++ b/src/librustc_codegen_llvm/intrinsic.rs
@@ -10,6 +10,7 @@
#![allow(non_upper_case_globals)]
+use attributes;
use intrinsics::{self, Intrinsic};
use llvm;
use llvm::{ValueRef};
@@ -936,6 +937,7 @@ fn gen_fn<'a, 'tcx>(cx: &CodegenCx<'a, 'tcx>,
Abi::Rust
)));
let llfn = declare::define_internal_fn(cx, name, rust_fn_ty);
+ attributes::from_fn_attrs(cx, llfn, None);
let bx = Builder::new_block(cx, llfn, "entry-block");
codegen(bx);
llfn
diff --git a/src/librustc_codegen_llvm/mono_item.rs b/src/librustc_codegen_llvm/mono_item.rs
index a528008e3b4b..32d8b24e3c15 100644
--- a/src/librustc_codegen_llvm/mono_item.rs
+++ b/src/librustc_codegen_llvm/mono_item.rs
@@ -183,7 +183,7 @@ fn predefine_fn<'a, 'tcx>(cx: &CodegenCx<'a, 'tcx>,
if instance.def.is_inline(cx.tcx) {
attributes::inline(lldecl, attributes::InlineAttr::Hint);
}
- attributes::from_fn_attrs(cx, lldecl, instance.def.def_id());
+ attributes::from_fn_attrs(cx, lldecl, Some(instance.def.def_id()));
cx.instances.borrow_mut().insert(instance, lldecl);
}
--
2.17.1

View File

@ -0,0 +1,122 @@
From f4e8d57b6ad6f599de54c020ba185db83cb011a3 Mon Sep 17 00:00:00 2001
From: Josh Stone <jistone@redhat.com>
Date: Thu, 16 Aug 2018 11:26:27 -0700
Subject: [PATCH] std: stop backtracing when the frames are full
---
src/libstd/sys/cloudabi/backtrace.rs | 18 ++++++++++--------
src/libstd/sys/redox/backtrace/tracing.rs | 18 ++++++++++--------
src/libstd/sys/unix/backtrace/tracing/gcc_s.rs | 18 ++++++++++--------
3 files changed, 30 insertions(+), 24 deletions(-)
diff --git a/src/libstd/sys/cloudabi/backtrace.rs b/src/libstd/sys/cloudabi/backtrace.rs
index 1b970187558c..2c43b5937ce5 100644
--- a/src/libstd/sys/cloudabi/backtrace.rs
+++ b/src/libstd/sys/cloudabi/backtrace.rs
@@ -64,6 +64,10 @@ extern "C" fn trace_fn(
arg: *mut libc::c_void,
) -> uw::_Unwind_Reason_Code {
let cx = unsafe { &mut *(arg as *mut Context) };
+ if cx.idx >= cx.frames.len() {
+ return uw::_URC_NORMAL_STOP;
+ }
+
let mut ip_before_insn = 0;
let mut ip = unsafe { uw::_Unwind_GetIPInfo(ctx, &mut ip_before_insn) as *mut libc::c_void };
if !ip.is_null() && ip_before_insn == 0 {
@@ -73,14 +77,12 @@ extern "C" fn trace_fn(
}
let symaddr = unsafe { uw::_Unwind_FindEnclosingFunction(ip) };
- if cx.idx < cx.frames.len() {
- cx.frames[cx.idx] = Frame {
- symbol_addr: symaddr as *mut u8,
- exact_position: ip as *mut u8,
- inline_context: 0,
- };
- cx.idx += 1;
- }
+ cx.frames[cx.idx] = Frame {
+ symbol_addr: symaddr as *mut u8,
+ exact_position: ip as *mut u8,
+ inline_context: 0,
+ };
+ cx.idx += 1;
uw::_URC_NO_REASON
}
diff --git a/src/libstd/sys/redox/backtrace/tracing.rs b/src/libstd/sys/redox/backtrace/tracing.rs
index bb70ca360370..c0414b78f8d6 100644
--- a/src/libstd/sys/redox/backtrace/tracing.rs
+++ b/src/libstd/sys/redox/backtrace/tracing.rs
@@ -68,6 +68,10 @@ pub fn unwind_backtrace(frames: &mut [Frame])
extern fn trace_fn(ctx: *mut uw::_Unwind_Context,
arg: *mut libc::c_void) -> uw::_Unwind_Reason_Code {
let cx = unsafe { &mut *(arg as *mut Context) };
+ if cx.idx >= cx.frames.len() {
+ return uw::_URC_NORMAL_STOP;
+ }
+
let mut ip_before_insn = 0;
let mut ip = unsafe {
uw::_Unwind_GetIPInfo(ctx, &mut ip_before_insn) as *mut libc::c_void
@@ -94,14 +98,12 @@ extern fn trace_fn(ctx: *mut uw::_Unwind_Context,
unsafe { uw::_Unwind_FindEnclosingFunction(ip) }
};
- if cx.idx < cx.frames.len() {
- cx.frames[cx.idx] = Frame {
- symbol_addr: symaddr as *mut u8,
- exact_position: ip as *mut u8,
- inline_context: 0,
- };
- cx.idx += 1;
- }
+ cx.frames[cx.idx] = Frame {
+ symbol_addr: symaddr as *mut u8,
+ exact_position: ip as *mut u8,
+ inline_context: 0,
+ };
+ cx.idx += 1;
uw::_URC_NO_REASON
}
diff --git a/src/libstd/sys/unix/backtrace/tracing/gcc_s.rs b/src/libstd/sys/unix/backtrace/tracing/gcc_s.rs
index 1b92fc0e6ad0..6e8415686792 100644
--- a/src/libstd/sys/unix/backtrace/tracing/gcc_s.rs
+++ b/src/libstd/sys/unix/backtrace/tracing/gcc_s.rs
@@ -68,6 +68,10 @@ pub fn unwind_backtrace(frames: &mut [Frame])
extern fn trace_fn(ctx: *mut uw::_Unwind_Context,
arg: *mut libc::c_void) -> uw::_Unwind_Reason_Code {
let cx = unsafe { &mut *(arg as *mut Context) };
+ if cx.idx >= cx.frames.len() {
+ return uw::_URC_NORMAL_STOP;
+ }
+
let mut ip_before_insn = 0;
let mut ip = unsafe {
uw::_Unwind_GetIPInfo(ctx, &mut ip_before_insn) as *mut libc::c_void
@@ -94,14 +98,12 @@ extern fn trace_fn(ctx: *mut uw::_Unwind_Context,
unsafe { uw::_Unwind_FindEnclosingFunction(ip) }
};
- if cx.idx < cx.frames.len() {
- cx.frames[cx.idx] = Frame {
- symbol_addr: symaddr as *mut u8,
- exact_position: ip as *mut u8,
- inline_context: 0,
- };
- cx.idx += 1;
- }
+ cx.frames[cx.idx] = Frame {
+ symbol_addr: symaddr as *mut u8,
+ exact_position: ip as *mut u8,
+ inline_context: 0,
+ };
+ cx.idx += 1;
uw::_URC_NO_REASON
}
--
2.17.1

View File

@ -1,62 +0,0 @@
From efa11da26a882aaf57f7eae747e48d128c474bf3 Mon Sep 17 00:00:00 2001
From: Josh Stone <jistone@redhat.com>
Date: Thu, 26 Jul 2018 17:20:02 -0700
Subject: [PATCH] rustc_metadata: test loading atoi instead of cos
Some platforms don't actually have `libm` already linked in the test
infrastructure, and then `dynamic_lib::tests::test_loading_cosine` would
fail to find the "cos" symbol. Every platform running this test should
have `libc` and "atoi" though, so try to use that symbol instead.
Fixes #45410.
---
src/librustc_metadata/dynamic_lib.rs | 25 ++++++++++++-------------
1 file changed, 12 insertions(+), 13 deletions(-)
diff --git a/src/librustc_metadata/dynamic_lib.rs b/src/librustc_metadata/dynamic_lib.rs
index d7da0d00012e..182a071277ec 100644
--- a/src/librustc_metadata/dynamic_lib.rs
+++ b/src/librustc_metadata/dynamic_lib.rs
@@ -90,30 +90,29 @@ mod tests {
use std::mem;
#[test]
- fn test_loading_cosine() {
+ fn test_loading_atoi() {
if cfg!(windows) {
return
}
- // The math library does not need to be loaded since it is already
- // statically linked in
- let libm = match DynamicLibrary::open(None) {
+ // The C library does not need to be loaded since it is already linked in
+ let lib = match DynamicLibrary::open(None) {
Err(error) => panic!("Could not load self as module: {}", error),
- Ok(libm) => libm
+ Ok(lib) => lib
};
- let cosine: extern fn(libc::c_double) -> libc::c_double = unsafe {
- match libm.symbol("cos") {
- Err(error) => panic!("Could not load function cos: {}", error),
- Ok(cosine) => mem::transmute::<*mut u8, _>(cosine)
+ let atoi: extern fn(*const libc::c_char) -> libc::c_int = unsafe {
+ match lib.symbol("atoi") {
+ Err(error) => panic!("Could not load function atoi: {}", error),
+ Ok(atoi) => mem::transmute::<*mut u8, _>(atoi)
}
};
- let argument = 0.0;
- let expected_result = 1.0;
- let result = cosine(argument);
+ let argument = CString::new("1383428980").unwrap();
+ let expected_result = 0x52757374;
+ let result = atoi(argument.as_ptr());
if result != expected_result {
- panic!("cos({}) != {} but equaled {} instead", argument,
+ panic!("atoi({:?}) != {} but equaled {} instead", argument,
expected_result, result)
}
}

128
rust.spec
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.27.2
%global bootstrap_cargo 1.27.0
%global bootstrap_rust 1.28.0
%global bootstrap_cargo 1.28.0
%global bootstrap_channel %{bootstrap_rust}
%global bootstrap_date 2018-07-20
%global bootstrap_date 2018-08-02
# Only the specified arches will use bootstrap binaries.
#global bootstrap_arches %%{rust_arches}
@ -21,7 +21,7 @@
%bcond_with llvm_static
# We can also choose to just use Rust's bundled LLVM, in case the system LLVM
# is insufficient. Rust currently requires LLVM 3.9+.
# is insufficient. Rust currently requires LLVM 5.0+.
%if 0%{?rhel} && !0%{?epel}
%bcond_without bundled_llvm
%else
@ -34,6 +34,12 @@
# So, tread carefully if you toggle this...
%bcond_without bundled_libgit2
%if 0%{?rhel}
%bcond_without bundled_libssh2
%else
%bcond_with bundled_libssh2
%endif
# LLDB only works on some architectures
%ifarch %{arm} aarch64 %{ix86} x86_64
# LLDB isn't available everywhere...
@ -49,14 +55,15 @@
# Some sub-packages are versioned independently of the rust compiler and runtime itself.
# Also beware that if any of these are not changed in a version bump, then the release
# number should still increase, not be reset to 1!
%global rustc_version 1.28.0
%global cargo_version 1.28.0
%global rustfmt_version 0.8.2
%global rls_version 0.128.0
%global rustc_version 1.29.0
%global cargo_version 1.29.0
%global rustfmt_version 0.99.1
%global rls_version 0.130.0
%global clippy_version 0.0.212
Name: rust
Version: %{rustc_version}
Release: 2%{?dist}
Release: 1%{?dist}
Summary: The Rust Programming Language
License: (ASL 2.0 or MIT) and (BSD and MIT)
# ^ written as: (rust itself) and (bundled libraries)
@ -70,11 +77,14 @@ ExclusiveArch: %{rust_arches}
%endif
Source0: https://static.rust-lang.org/dist/%{rustc_package}.tar.xz
# https://github.com/rust-lang/rust/pull/52760
Patch1: rust-52760-test_loading_atoi.patch
# https://github.com/rust-lang/rust/pull/52876
Patch2: rust-52876-const-endianess.patch
Patch1: rust-52876-const-endianess.patch
# https://github.com/rust-lang/rust/pull/53436
Patch2: 0001-std-stop-backtracing-when-the-frames-are-full.patch
# https://github.com/rust-lang/rust/pull/53437
Patch3: 0001-Set-more-llvm-function-attributes-for-__rust_try.patch
# Get the Rust triple for any arch.
%{lua: function rust_triple(arch)
@ -135,10 +145,18 @@ BuildRequires: ncurses-devel
BuildRequires: curl
BuildRequires: pkgconfig(libcurl)
BuildRequires: pkgconfig(liblzma)
BuildRequires: pkgconfig(libssh2)
BuildRequires: pkgconfig(openssl)
BuildRequires: pkgconfig(zlib)
%if %without bundled_libgit2
BuildRequires: pkgconfig(libgit2) >= 0.27
%endif
%if %without bundled_libssh2
# needs libssh2_userauth_publickey_frommemory
BuildRequires: pkgconfig(libssh2) >= 1.6.0
%endif
%if 0%{?rhel} && 0%{?rhel} <= 7
%global python python2
%else
@ -148,7 +166,7 @@ BuildRequires: %{python}
%if %with bundled_llvm
BuildRequires: cmake3 >= 3.4.3
Provides: bundled(llvm) = 6.0
Provides: bundled(llvm) = 7.0
%else
BuildRequires: cmake >= 2.8.11
%if 0%{?epel}
@ -160,7 +178,7 @@ BuildRequires: cmake >= 2.8.11
%global llvm llvm
%global llvm_root %{_prefix}
%endif
BuildRequires: %{llvm}-devel >= 3.9
BuildRequires: %{llvm}-devel >= 5.0
%if %with llvm_static
BuildRequires: %{llvm}-static
BuildRequires: libffi-devel
@ -190,11 +208,11 @@ Requires: %{name}-std-static%{?_isa} = %{rustc_version}-%{release}
Requires: /usr/bin/cc
# ALL Rust libraries are private, because they don't keep an ABI.
%global _privatelibs lib(.*-[[:xdigit:]]*|rustc.*)[.]so.*
%global _privatelibs lib(.*-[[:xdigit:]]{16}*|rustc.*)[.]so.*
%global __provides_exclude ^(%{_privatelibs})$
%global __requires_exclude ^(%{_privatelibs})$
%global __provides_exclude_from ^%{_docdir}/.*$
%global __requires_exclude_from ^%{_docdir}/.*$
%global __provides_exclude_from ^(%{_docdir}|%{rustlibdir}/src)/.*$
%global __requires_exclude_from ^(%{_docdir}|%{rustlibdir}/src)/.*$
# While we don't want to encourage dynamic linking to Rust shared libraries, as
# there's no stable ABI, we still need the unallocated metadata (.rustc) to
@ -286,8 +304,9 @@ Summary: Rust's package manager and build tool
Version: %{cargo_version}
%if %with bundled_libgit2
Provides: bundled(libgit2) = 0.27
%else
BuildRequires: pkgconfig(libgit2) >= 0.27
%endif
%if %with bundled_libssh2
Provides: bundled(libssh2) = 1.8.1
%endif
# For tests:
BuildRequires: git
@ -305,7 +324,7 @@ Version: %{cargo_version}
BuildArch: noarch
# Cargo no longer builds its own documentation
# https://github.com/rust-lang/cargo/pull/4904
Requires: rust-doc
Requires: rust-doc = %{rustc_version}-%{release}
%description -n cargo-doc
This package includes HTML documentation for Cargo.
@ -332,6 +351,9 @@ Provides: rls = %{rls_version}
%if %with bundled_libgit2
Provides: bundled(libgit2) = 0.27
%endif
%if %with bundled_libssh2
Provides: bundled(libssh2) = 1.8.1
%endif
Requires: rust-analysis
# /usr/bin/rls is dynamically linked against internal rustc libs
Requires: %{name}%{?_isa} = %{rustc_version}-%{release}
@ -343,6 +365,19 @@ It supports functionality such as 'goto definition', symbol search,
reformatting, and code completion, and enables renaming and refactorings.
%package -n clippy-preview
Summary: Lints to catch common mistakes and improve your Rust code
Version: %{clippy_version}
License: MPLv2.0
Provides: clippy = %{clippy_version}
Requires: cargo
# /usr/bin/clippy-driver is dynamically linked against internal rustc libs
Requires: %{name}%{?_isa} = %{rustc_version}-%{release}
%description -n clippy-preview
A collection of lints to catch common mistakes and improve your Rust code.
%package src
Summary: Sources for the Rust standard library
BuildArch: noarch
@ -376,6 +411,7 @@ test -f '%{local_rust_root}/bin/rustc'
%patch1 -p1
%patch2 -p1
%patch3 -p1
%if "%{python}" == "python3"
sed -i.try-py3 -e '/try python2.7/i try python3 "$@"' ./configure
@ -427,6 +463,11 @@ find src/vendor -name .cargo-checksum.json \
export LIBGIT2_SYS_USE_PKG_CONFIG=1
%endif
%if %without bundled_libssh2
# convince libssh2-sys to use the distro libssh2
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}"}
@ -494,12 +535,20 @@ find %{buildroot}%{_libdir} -maxdepth 1 -type f -name '*.so' \
# Remove installer artifacts (manifests, uninstall scripts, etc.)
find %{buildroot}%{rustlibdir} -maxdepth 1 -type f -exec rm -v '{}' '+'
# Remove backup files from %%configure munging
find %{buildroot}%{rustlibdir} -type f -name '*.orig' -exec rm -v '{}' '+'
# https://fedoraproject.org/wiki/Changes/Make_ambiguous_python_shebangs_error
# We don't actually need to ship any of those python scripts in rust-src anyway.
find %{buildroot}%{rustlibdir}/src -type f -name '*.py' -exec rm -v '{}' '+'
# FIXME: __os_install_post will strip the rlibs
# -- should we find a way to preserve debuginfo?
# Remove unwanted documentation files (we already package them)
rm -f %{buildroot}%{_docdir}/%{name}/README.md
rm -f %{buildroot}%{_docdir}/%{name}/COPYRIGHT
rm -f %{buildroot}%{_docdir}/%{name}/LICENSE
rm -f %{buildroot}%{_docdir}/%{name}/LICENSE-APACHE
rm -f %{buildroot}%{_docdir}/%{name}/LICENSE-MIT
rm -f %{buildroot}%{_docdir}/%{name}/LICENSE-THIRD-PARTY
@ -514,25 +563,8 @@ mkdir -p %{buildroot}%{_datadir}/cargo/registry
# Cargo no longer builds its own documentation
# https://github.com/rust-lang/cargo/pull/4904
mkdir -p %{buildroot}%{_docdir}/cargo/html
cat <<EOF > %{buildroot}%{_docdir}/cargo/html/index.html
<!DOCTYPE HTML>
<html lang="en-US">
<head>
<meta charset="UTF-8">
<meta http-equiv="refresh" content="0; url=../../rust/html/cargo/index.html">
<script type="text/javascript">
window.location.href = "../../rust/html/cargo/index.html"
</script>
<title>cargo-doc redirection</title>
</head>
<body>
Cargo documentation has been moved to the rust-doc package.
If you are not redirected automatically, please follow this
<a href="../../rust/html/cargo/index.html">link</a>.
</body>
</html>
EOF
mkdir -p %{buildroot}%{_docdir}/cargo
ln -sT ../rust/html/cargo/ %{buildroot}%{_docdir}/cargo/html
%if %without lldb
rm -f %{buildroot}%{_bindir}/rust-lldb
@ -548,6 +580,7 @@ rm -f %{buildroot}%{rustlibdir}/etc/lldb_*.py*
# The results are not stable on koji, so mask errors and just log it.
%{python} ./x.py test --no-fail-fast || :
%{python} ./x.py test --no-fail-fast cargo || :
%{python} ./x.py test --no-fail-fast clippy || :
%{python} ./x.py test --no-fail-fast rls || :
%{python} ./x.py test --no-fail-fast rustfmt || :
@ -621,6 +654,8 @@ rm -f %{buildroot}%{rustlibdir}/etc/lldb_*.py*
%files -n cargo-doc
%docdir %{_docdir}/cargo
%dir %{_docdir}/cargo
%{_docdir}/cargo/html
@ -637,6 +672,13 @@ rm -f %{buildroot}%{rustlibdir}/etc/lldb_*.py*
%license src/tools/rls/LICENSE-{APACHE,MIT}
%files -n clippy-preview
%{_bindir}/cargo-clippy
%{_bindir}/clippy-driver
%doc src/tools/clippy/{README.md,CHANGELOG.md}
%license src/tools/clippy/LICENSE
%files src
%dir %{rustlibdir}
%{rustlibdir}/src
@ -647,6 +689,10 @@ rm -f %{buildroot}%{rustlibdir}/etc/lldb_*.py*
%changelog
* Thu Sep 13 2018 Josh Stone <jistone@redhat.com> - 1.29.0-1
- Update to 1.29.0.
- Add a clippy-preview subpackage
* Thu Aug 09 2018 Josh Stone <jistone@redhat.com> - 1.28.0-2
- Rebuild for LLVM ppc64/s390x fixes

View File

@ -1 +1 @@
SHA512 (rustc-1.28.0-src.tar.xz) = a4885cd42a1006738cca2f0d8c0d5e4fd4014fc4629cbf691935bd36ffb896c553717022e67532359b5f1bd8e5050fc38b9dffed7c45cc76f7089ec134dfb980
SHA512 (rustc-1.29.0-src.tar.xz) = 87f416c76db2967c0ce2b39ee2d2c2fcad875bbe13cfa507f5483e170827c131f3af4400c11785ed836143b2732aaf32bc0291fcd93bbfb96b266a198c926a5b

View File

@ -1,8 +1,8 @@
SHA512 (rustc-1.28.0-src.tar.xz) = a4885cd42a1006738cca2f0d8c0d5e4fd4014fc4629cbf691935bd36ffb896c553717022e67532359b5f1bd8e5050fc38b9dffed7c45cc76f7089ec134dfb980
SHA512 (rust-1.27.2-aarch64-unknown-linux-gnu.tar.xz) = 84022350f1e8fc34a353a09848333424a557ddea3b9445a1a5fc9d2f2abced942154e80888ab4091174d6d83c6766f583ef240ab2e2233de5d536633d2765040
SHA512 (rust-1.27.2-armv7-unknown-linux-gnueabihf.tar.xz) = afa6469ebc851b1c4f3911434504c52d6fb0e2f9779048fa6217cce65cbf8fdd9f3ba990dc8f0e99371040b32ee304e88bfbf27604385c6d3216e0ca44f200a1
SHA512 (rust-1.27.2-i686-unknown-linux-gnu.tar.xz) = e17960120bdd18a527c0783ce8ca8d76cdc9b436f36a73a82fd2ea709b253f33feeb88310fab7a86305bad403eb5dad7ea43d0e5bc5ad1e3847f29e85040303a
SHA512 (rust-1.27.2-powerpc64le-unknown-linux-gnu.tar.xz) = 4993430b97f348620338524dbd5f64c6b662cfca51ce1616902e48e08babc0287f6b0db73e13b0ce478a60c98b17f3878c35a33823692fa0e37e265797bb661f
SHA512 (rust-1.27.2-powerpc64-unknown-linux-gnu.tar.xz) = 21d90f1e71f99e2bf11ba795e76eb428e88d6ac2cb0197f7111e3a4923fa2896b9f41bd54cac5c43329a3d03484d5441e3b8aad599164c69a0c99e08a7ecac15
SHA512 (rust-1.27.2-s390x-unknown-linux-gnu.tar.xz) = f6ee1e3c41c2602064377262fe74b39b0908a3fb8995c71a7b02ea8c8f0fe6909ffc7ee953e6b0865793d3a8e577096c85d9d9ce51388bb52d7fdc11fcb9db46
SHA512 (rust-1.27.2-x86_64-unknown-linux-gnu.tar.xz) = 14861392dad81d2c040d0deb64d5dd34652d5cc2875e404609a0f13c8fb6bdc38f9bc7b1e309829365a00c42b610f2b7a73cffa232ecfdf0618b5508a8667198
SHA512 (rustc-1.29.0-src.tar.xz) = 87f416c76db2967c0ce2b39ee2d2c2fcad875bbe13cfa507f5483e170827c131f3af4400c11785ed836143b2732aaf32bc0291fcd93bbfb96b266a198c926a5b
SHA512 (rust-1.28.0-aarch64-unknown-linux-gnu.tar.xz) = 8d9acbc90ddaa1e0de0234a21798b19b5365ea371a12f9a143c6ebacbb48f57344da6e827e867513be502bce2801de27a0dbbacdf8618c653aeb58026b6c469c
SHA512 (rust-1.28.0-armv7-unknown-linux-gnueabihf.tar.xz) = 9142110e0c24657aca41468648d9364c2e6fce60b08ca7113c944a53701fc5a309481a8fdd5845b229bcc750ccad63af561d452c3a3a0727ab1ca7a461b06d3d
SHA512 (rust-1.28.0-i686-unknown-linux-gnu.tar.xz) = ffdfab46db14f07354b553e02fdb9dc6602c2c52b78d8f17c499f4ddb1e257aa53479df836eb3f06a2548d34296b0277cdb6b4c6f3cec57265823df22752c135
SHA512 (rust-1.28.0-powerpc64le-unknown-linux-gnu.tar.xz) = bdbdf3a64a184dd4510a113bbe20c058f42e35321cd2fb7c938487dfc9b1f04320b523ea215dd92a23c2537292eeb064097119e2097d6e24a1c4e237d9d4fc8b
SHA512 (rust-1.28.0-powerpc64-unknown-linux-gnu.tar.xz) = 1bd2c5069beecb765a2305715070e4052d5a66dafe50a5b53bea2c2082b22b3f9a2d2b9fb059c93476f88ee5e602effc18b807e5c964610e8255a3a945931f51
SHA512 (rust-1.28.0-s390x-unknown-linux-gnu.tar.xz) = 5ffb44d16c990b8a6377b64e5042a3b2e709bcc7187013dbe4ab3c9d8cd781b6bf07b0d374340e2ccabe9f84fd4731b606cb05a10a739ebcfa49652518a2aa46
SHA512 (rust-1.28.0-x86_64-unknown-linux-gnu.tar.xz) = 4f427c11a9cd22aedd01bd7ed5bee2ba5e00a27db25af4f596cf8627d88eff8e72625eb83729d2e6c6780aaffd44c0e7065a1c8fa22f4899349b72c726cf6a5f