Compare commits

..

88 Commits

Author SHA1 Message Date
Josh Stone d895cdd8f5 Merge branch 'rawhide' into epel7 2021-04-15 17:47:28 -07:00
Josh Stone 1df6ded419 Merge branch 'rawhide' into epel7 2021-03-25 18:56:08 -07:00
Josh Stone 2403c0ff71 Merge branch 'rawhide' into epel7 2021-02-19 20:46:37 -08:00
Josh Stone 43bc2d599a Merge branch 'master' into epel7 2021-01-05 16:45:32 -08:00
Josh Stone 924ba39635 Merge branch 'master' into epel7 2020-11-19 13:02:32 -08:00
Josh Stone 1b35f1ea8f Merge branch 'master' into epel7 2020-10-10 11:52:41 -07:00
Josh Stone 9f59ae84c9 Merge branch 'master' into epel7 2020-08-29 16:38:18 -07:00
Josh Stone d2b87b4484 Merge branch 'master' into epel7 2020-08-27 16:49:38 -07:00
Josh Stone dc8bfd349f Merge branch 'master' into epel7 2020-08-03 12:01:04 -07:00
Josh Stone 321d5558f4 Update patch to disable http2 2020-07-16 12:13:45 -07:00
Josh Stone 24ec976f18 Merge branch 'master' into epel7 2020-07-16 11:50:38 -07:00
Josh Stone 6561932d8f Merge branch 'master' into epel7 2020-06-18 15:34:30 -07:00
Josh Stone 85183d227e Update patch to disable http2 2020-06-04 15:55:22 -07:00
Josh Stone c3f4234736 Merge branch 'master' into epel7 2020-06-04 15:47:41 -07:00
Josh Stone 008cd73f30 in transition, need to explicitly require llvm7.0, rather than llvm-toolset-7 2020-05-26 12:06:31 -07:00
Josh Stone b659c74ccd Rebuild with LLVM 9. 2020-05-19 17:09:31 -07:00
Josh Stone 15bd97302d Merge branch 'master' into epel7 2020-05-07 11:35:12 -07:00
Josh Stone d5bc581fc8 Update patch to disable http2 2020-04-23 13:31:34 -07:00
Josh Stone c4e02f596e Merge branch 'master' into epel7 2020-04-23 13:20:43 -07:00
Josh Stone 2625654aa0 Update patch to disable http2 2020-03-12 15:47:42 -07:00
Josh Stone 5037c3fc20 Merge branch 'master' into epel7 2020-03-12 15:38:49 -07:00
Josh Stone 46c165a869 For older rpm's sake, don't use %elif 2020-02-27 13:31:18 -08:00
Josh Stone 40c3255521 Merge branch 'master' into epel7 2020-02-27 11:35:04 -08:00
Josh Stone 7a19313010 Reintroduce the workaround for LLVM library path
This reverts commit 93ecbc5a13,
reintroducing the workaround for rust#40717, now rust#68714.
2020-01-31 13:50:52 -08:00
Josh Stone 6eee6d5eb7 Update patch to disable http2 2020-01-31 10:50:12 -08:00
Josh Stone ac57ec79f8 Merge branch 'master' into epel7 2020-01-31 10:40:45 -08:00
Josh Stone 5470eaf23f Update patch to disable http2 2019-12-19 13:12:19 -08:00
Josh Stone 4057d60988 Merge branch 'master' into epel7 2019-12-19 13:00:47 -08:00
Josh Stone b229852f1b Update patch to disable http2 2019-11-07 11:55:31 -08:00
Josh Stone 0efd2fede8 Merge branch 'master' into epel7 2019-11-07 11:11:37 -08:00
Josh Stone 4aa461329e Merge branch 'master' into epel7 2019-09-27 20:50:58 -07:00
Josh Stone 9d6ffbec00 Disable HTTP/2 support, lacking in system libcurl. 2019-08-16 20:23:50 -07:00
Josh Stone 9d647b418c Merge branch 'master' into epel7 2019-08-15 16:17:50 -07:00
Josh Stone 0d9e250f39 Merge branch 'master' into epel7 2019-07-04 15:48:00 -07:00
Josh Stone 0e3412d609 Merge branch 'f30' into epel7 2019-05-24 09:54:56 -07:00
Josh Stone f83e7bc948 Merge branch 'master' into f30 2019-05-24 09:52:38 -07:00
Josh Stone cbda4b9d24 Merge branch 'f30' into epel7 2019-05-14 09:38:56 -07:00
Josh Stone fc2a6e14a2 Merge branch 'master' into f30 2019-05-14 09:36:55 -07:00
Josh Stone 7eb8695d43 Merge branch 'f30' into epel7 2019-04-26 17:24:55 -07:00
Josh Stone 20dd9904db Merge branch 'master' into f30 2019-04-26 17:22:02 -07:00
Josh Stone b428ab323c Merge branch 'master' into epel7 2019-04-11 13:32:06 -07:00
Josh Stone 9f69d98890 Merge branch 'master' into epel7 2019-03-04 14:34:50 -08:00
Josh Stone e7e63ea970 Merge branch 'master' into epel7 2019-01-17 15:34:36 -08:00
Josh Stone fdeeb3c7c2 Merge branch 'master' into epel7 2019-01-07 21:10:59 -08:00
Josh Stone 067006102e Merge branch 'master' into epel7 2018-12-06 13:11:55 -08:00
Josh Stone 6d9e676d52 Merge branch 'master' into epel7 2018-11-09 15:58:14 -08:00
Josh Stone 503e4b69c2 Rebuild without bootstrap binaries. 2018-11-01 09:15:07 -07:00
Josh Stone cf28e2f093 Re-bootstrap ppc64le for rust#54545 2018-10-31 15:48:17 -07:00
Josh Stone 936bbf68e3 Merge branch 'master' into epel7 2018-10-25 16:21:43 -07:00
Josh Stone 46caacd9c3 Merge branch 'master' into epel7 2018-10-12 16:52:16 -07:00
Josh Stone 54b7b277e8 Merge branch 'master' into epel7 2018-09-25 17:31:49 -07:00
Josh Stone a3ad4a30e5 Merge branch 'master' into epel7 2018-09-13 21:43:58 -07:00
Josh Stone eb5b02ceb8 Remove backup files from %%configure munging 2018-08-10 12:41:50 -07:00
Josh Stone 4b19ef4596 Revert part of pr50949 for LLVM5 2018-08-08 13:54:11 -07:00
Josh Stone d01c400c6d Merge branch 'master' into epel7 2018-08-08 11:21:54 -07:00
Josh Stone d7de968339 Merge branch 'master' into epel7 2018-07-24 17:39:39 -07:00
Josh Stone 302e344e53 Merge branch 'master' into epel7 2018-07-10 22:49:18 -07:00
Josh Stone a4accef2ec Merge branch 'master' into epel7 2018-07-10 17:05:21 -07:00
Josh Stone 88f8793a47 Merge branch 'master' into epel7 2018-06-22 09:45:02 -07:00
Josh Stone 98bc5af3a0 Merge branch 'master' into epel7 2018-06-06 12:38:39 -07:00
Josh Stone 15aaf32acc Merge branch 'master' into epel7 2018-05-29 18:04:59 -07:00
Josh Stone fb7a68c45d Merge branch 'master' into epel7 2018-05-10 17:49:25 -07:00
Josh Stone f178e9ef68 Merge branch 'master' into epel7 2018-03-29 18:19:39 -07:00
Josh Stone 7ef9fffd9d Merge branch 'master' into epel7 2018-03-01 20:56:32 -08:00
Josh Stone 7d2caa5f1a Merge branch 'master' into epel7 2018-02-19 21:38:18 -08:00
Josh Stone 099c0af3b5 Merge branch 'master' into epel7 2018-02-16 11:30:59 -08:00
Josh Stone e11de07846 fix binaryen on aarch64 2018-01-09 14:18:01 -08:00
Josh Stone 04482640db Merge branch 'master' into epel7 2018-01-09 11:48:31 -08:00
Josh Stone 077dd32c31 Merge branch 'master' into epel7 2017-11-27 21:19:29 -08:00
Josh Stone 6420cd5449 Merge branch 'master' into epel7 2017-10-12 16:17:15 -07:00
Josh Stone e51c53abd3 Merge branch 'master' into epel7 2017-08-31 21:17:38 -07:00
Josh Stone cd9e7dc3f4 Merge branch 'master' into epel7 2017-07-21 14:37:23 -07:00
Josh Stone 6565998cf7 Merge branch 'master' into epel7 2017-06-08 21:38:26 -07:00
Josh Stone 10f2e52a1e Merge branch 'master' into epel7 2017-04-27 16:17:58 -07:00
Josh Stone 0091da19db Merge branch 'master' into epel7 2017-03-16 13:06:24 -07:00
Josh Stone 358469cfaa Rebuild without bootstrap binaries. 2017-02-10 20:52:47 -08:00
Josh Stone 8e69a79270 Bootstrap ppc64 and ppc64le 2017-02-10 17:48:37 -08:00
Josh Stone d8b719e3a6 Merge branch 'master' into epel7 2017-02-10 11:35:25 -08:00
Josh Stone fce6ca15f9 No really, we're not ready for other arches 2017-01-03 17:39:44 -08:00
Josh Stone b705f891eb drop bootstrap sources too 2017-01-03 16:38:58 -08:00
Josh Stone 01270bce1c Revert the ppc64/ppc64le bootstrap
The upstream binaries are built with GLIBC_2.22 symbols, from Ubuntu 16.04,
so they're not usable on epel7.
2017-01-03 16:35:47 -08:00
Josh Stone 4f273206b9 Merge branch 'master' into epel7 2017-01-03 14:42:22 -08:00
Josh Stone 0e5ea0bfa8 Merge branch 'master' into epel7 2016-11-12 23:19:10 -08:00
Josh Stone d1dacf862b Rebuild without bootstrap binaries. 2016-10-22 10:23:50 -07:00
Josh Stone 7a5fc2b504 Bootstrap aarch64. 2016-10-22 00:05:33 -07:00
Josh Stone 51be00a780 Merge branch 'master' into epel7 2016-10-22 00:04:14 -07:00
Josh Stone 25c127f58c Rebuild without bootstrap binaries. 2016-09-20 00:36:43 -07:00
Josh Stone 76c6164a97 Bootstrap el7, with bundled llvm 2016-09-19 22:32:53 -07:00
39 changed files with 770 additions and 1696 deletions

View File

@ -1 +0,0 @@
1

87
.gitignore vendored
View File

@ -33,6 +33,8 @@
/rustc-1.14.0-powerpc64-unknown-linux-gnu.tar.gz
/rustc-1.14.0-s390x-unknown-linux-gnu.tar.gz
/rustc-1.14.0-x86_64-unknown-linux-gnu.tar.gz
/rustc-1.15.0-powerpc64-unknown-linux-gnu.tar.gz
/rustc-1.15.0-powerpc64le-unknown-linux-gnu.tar.gz
/rust-1.15.1-aarch64-unknown-linux-gnu.tar.gz
/rust-1.15.1-armv7-unknown-linux-gnueabihf.tar.gz
/rust-1.15.1-i686-unknown-linux-gnu.tar.gz
@ -335,88 +337,3 @@
/rust-1.50.0-powerpc64le-unknown-linux-gnu.tar.xz
/rust-1.50.0-s390x-unknown-linux-gnu.tar.xz
/rust-1.50.0-x86_64-unknown-linux-gnu.tar.xz
/rustc-1.52.0-src.tar.xz
/rust-1.51.0-aarch64-unknown-linux-gnu.tar.xz
/rust-1.51.0-armv7-unknown-linux-gnueabihf.tar.xz
/rust-1.51.0-i686-unknown-linux-gnu.tar.xz
/rust-1.51.0-powerpc64le-unknown-linux-gnu.tar.xz
/rust-1.51.0-s390x-unknown-linux-gnu.tar.xz
/rust-1.51.0-x86_64-unknown-linux-gnu.tar.xz
/rustc-1.52.1-src.tar.xz
/rustc-1.53.0-src.tar.xz
/rust-1.52.0-aarch64-unknown-linux-gnu.tar.xz
/rust-1.52.0-armv7-unknown-linux-gnueabihf.tar.xz
/rust-1.52.0-i686-unknown-linux-gnu.tar.xz
/rust-1.52.0-powerpc64le-unknown-linux-gnu.tar.xz
/rust-1.52.0-s390x-unknown-linux-gnu.tar.xz
/rust-1.52.0-x86_64-unknown-linux-gnu.tar.xz
/rustc-1.54.0-src.tar.xz
/rust-1.53.0-aarch64-unknown-linux-gnu.tar.xz
/rust-1.53.0-armv7-unknown-linux-gnueabihf.tar.xz
/rust-1.53.0-i686-unknown-linux-gnu.tar.xz
/rust-1.53.0-powerpc64le-unknown-linux-gnu.tar.xz
/rust-1.53.0-powerpc64-unknown-linux-gnu.tar.xz
/rust-1.53.0-s390x-unknown-linux-gnu.tar.xz
/rust-1.53.0-x86_64-unknown-linux-gnu.tar.xz
/rustc-1.55.0-src.tar.xz
/rust-1.54.0-aarch64-unknown-linux-gnu.tar.xz
/rust-1.54.0-armv7-unknown-linux-gnueabihf.tar.xz
/rust-1.54.0-i686-unknown-linux-gnu.tar.xz
/rust-1.54.0-powerpc64le-unknown-linux-gnu.tar.xz
/rust-1.54.0-powerpc64-unknown-linux-gnu.tar.xz
/rust-1.54.0-s390x-unknown-linux-gnu.tar.xz
/rust-1.54.0-x86_64-unknown-linux-gnu.tar.xz
/rustc-1.56.0-src.tar.xz
/rust-1.55.0-aarch64-unknown-linux-gnu.tar.xz
/rust-1.55.0-armv7-unknown-linux-gnueabihf.tar.xz
/rust-1.55.0-i686-unknown-linux-gnu.tar.xz
/rust-1.55.0-powerpc64-unknown-linux-gnu.tar.xz
/rust-1.55.0-powerpc64le-unknown-linux-gnu.tar.xz
/rust-1.55.0-s390x-unknown-linux-gnu.tar.xz
/rust-1.55.0-x86_64-unknown-linux-gnu.tar.xz
/rustc-1.56.1-src.tar.xz
/rustc-1.57.0-src.tar.xz
/wasi-libc-ad5133410f66b93a2381db5b542aad5e0964db96.tar.gz
/rust-1.56.1-aarch64-unknown-linux-gnu.tar.xz
/rust-1.56.1-armv7-unknown-linux-gnueabihf.tar.xz
/rust-1.56.1-i686-unknown-linux-gnu.tar.xz
/rust-1.56.1-powerpc64le-unknown-linux-gnu.tar.xz
/rust-1.56.1-s390x-unknown-linux-gnu.tar.xz
/rust-1.56.1-x86_64-unknown-linux-gnu.tar.xz
/rustc-1.58.0-src.tar.xz
/rust-1.57.0-aarch64-unknown-linux-gnu.tar.xz
/rust-1.57.0-armv7-unknown-linux-gnueabihf.tar.xz
/rust-1.57.0-i686-unknown-linux-gnu.tar.xz
/rust-1.57.0-powerpc64le-unknown-linux-gnu.tar.xz
/rust-1.57.0-s390x-unknown-linux-gnu.tar.xz
/rust-1.57.0-x86_64-unknown-linux-gnu.tar.xz
/rustc-1.58.1-src.tar.xz
/rustc-1.59.0-src.tar.xz
/rust-1.58.0-aarch64-unknown-linux-gnu.tar.xz
/rust-1.58.0-armv7-unknown-linux-gnueabihf.tar.xz
/rust-1.58.0-i686-unknown-linux-gnu.tar.xz
/rust-1.58.0-powerpc64le-unknown-linux-gnu.tar.xz
/rust-1.58.0-s390x-unknown-linux-gnu.tar.xz
/rust-1.58.0-x86_64-unknown-linux-gnu.tar.xz
/rustc-1.60.0-src.tar.xz
/rustc-1.61.0-src.tar.xz
/wasi-libc-9886d3d6200fcc3726329966860fc058707406cd.tar.gz
/rustc-1.62.0-src.tar.xz
/rustc-1.62.1-src.tar.xz
/rustc-1.63.0-src.tar.xz
/rustc-1.64.0-src.tar.xz
/rustc-1.65.0-src.tar.xz
/wasi-libc-wasi-sdk-16.tar.gz
/rustc-1.66.0-src.tar.xz
/wasi-libc-wasi-sdk-17.tar.gz
/rustc-1.66.1-src.tar.xz
/rustc-1.67.0-src.tar.xz
/rustc-1.67.1-src.tar.xz
/rustc-1.68.0-src.tar.xz
/wasi-libc-wasi-sdk-19.tar.gz
/rustc-1.68.1-src.tar.xz
/rustc-1.68.2-src.tar.xz
/rustc-1.69.0-src.tar.xz
/wasi-libc-1dfe5c302d1c5ab621f7abf04620fae92700fd22.tar.gz
/rustc-1.70.0-src.tar.xz
/wasi-libc-wasi-sdk-20.tar.gz

View File

@ -0,0 +1,102 @@
From eaf7ea1fc339e1ff348ed941ed2e8c4d66f3e458 Mon Sep 17 00:00:00 2001
From: Josh Stone <jistone@redhat.com>
Date: Thu, 18 Feb 2021 19:14:58 -0800
Subject: [PATCH] Revert "Auto merge of #79547 - erikdesjardins:byval,
r=nagisa"
This reverts commit a094ff9590b83c8f94d898f92c2964a5803ded06, reversing
changes made to d37afad0cc87bf709ad10c85319296ac53030f03.
---
compiler/rustc_middle/src/ty/layout.rs | 12 ++++++------
...return-value-in-reg.rs => return-value-in-reg.rs} | 4 ++--
src/test/codegen/union-abi.rs | 11 +++--------
3 files changed, 11 insertions(+), 16 deletions(-)
rename src/test/codegen/{arg-return-value-in-reg.rs => return-value-in-reg.rs} (74%)
diff --git a/compiler/rustc_middle/src/ty/layout.rs b/compiler/rustc_middle/src/ty/layout.rs
index b545b92c9252..545f6aee1a21 100644
--- a/compiler/rustc_middle/src/ty/layout.rs
+++ b/compiler/rustc_middle/src/ty/layout.rs
@@ -2849,7 +2849,7 @@ fn adjust_for_abi(&mut self, cx: &C, abi: SpecAbi) {
|| abi == SpecAbi::RustIntrinsic
|| abi == SpecAbi::PlatformIntrinsic
{
- let fixup = |arg: &mut ArgAbi<'tcx, Ty<'tcx>>| {
+ let fixup = |arg: &mut ArgAbi<'tcx, Ty<'tcx>>, is_ret: bool| {
if arg.is_ignore() {
return;
}
@@ -2887,9 +2887,9 @@ fn adjust_for_abi(&mut self, cx: &C, abi: SpecAbi) {
_ => return,
}
- // Pass and return structures up to 2 pointers in size by value, matching `ScalarPair`.
- // LLVM will usually pass these in 2 registers, which is more efficient than by-ref.
- let max_by_val_size = Pointer.size(cx) * 2;
+ // Return structures up to 2 pointers in size by value, matching `ScalarPair`. LLVM
+ // will usually return these in 2 registers, which is more efficient than by-ref.
+ let max_by_val_size = if is_ret { Pointer.size(cx) * 2 } else { Pointer.size(cx) };
let size = arg.layout.size;
if arg.layout.is_unsized() || size > max_by_val_size {
@@ -2901,9 +2901,9 @@ fn adjust_for_abi(&mut self, cx: &C, abi: SpecAbi) {
arg.cast_to(Reg { kind: RegKind::Integer, size });
}
};
- fixup(&mut self.ret);
+ fixup(&mut self.ret, true);
for arg in &mut self.args {
- fixup(arg);
+ fixup(arg, false);
}
return;
}
diff --git a/src/test/codegen/arg-return-value-in-reg.rs b/src/test/codegen/return-value-in-reg.rs
similarity index 74%
rename from src/test/codegen/arg-return-value-in-reg.rs
rename to src/test/codegen/return-value-in-reg.rs
index a69291d47821..4bc0136c5e32 100644
--- a/src/test/codegen/arg-return-value-in-reg.rs
+++ b/src/test/codegen/return-value-in-reg.rs
@@ -1,4 +1,4 @@
-//! Check that types of up to 128 bits are passed and returned by-value instead of via pointer.
+//! This test checks that types of up to 128 bits are returned by-value instead of via out-pointer.
// compile-flags: -C no-prepopulate-passes -O
// only-x86_64
@@ -11,7 +11,7 @@ pub struct S {
c: u32,
}
-// CHECK: define i128 @modify(i128{{( %0)?}})
+// CHECK: define i128 @modify(%S* noalias nocapture dereferenceable(16) %s)
#[no_mangle]
pub fn modify(s: S) -> S {
S { a: s.a + s.a, b: s.b + s.b, c: s.c + s.c }
diff --git a/src/test/codegen/union-abi.rs b/src/test/codegen/union-abi.rs
index f282fd237054..afea01e9a2d0 100644
--- a/src/test/codegen/union-abi.rs
+++ b/src/test/codegen/union-abi.rs
@@ -63,16 +63,11 @@ pub union UnionU128{a:u128}
#[no_mangle]
pub fn test_UnionU128(_: UnionU128) -> UnionU128 { loop {} }
-pub union UnionU128x2{a:(u128, u128)}
-// CHECK: define void @test_UnionU128x2(i128 %_1.0, i128 %_1.1)
-#[no_mangle]
-pub fn test_UnionU128x2(_: UnionU128x2) { loop {} }
-
#[repr(C)]
-pub union CUnionU128x2{a:(u128, u128)}
-// CHECK: define void @test_CUnionU128x2(%CUnionU128x2* {{.*}} %_1)
+pub union CUnionU128{a:u128}
+// CHECK: define void @test_CUnionU128(%CUnionU128* {{.*}} %_1)
#[no_mangle]
-pub fn test_CUnionU128x2(_: CUnionU128x2) { loop {} }
+pub fn test_CUnionU128(_: CUnionU128) { loop {} }
pub union UnionBool { b:bool }
// CHECK: define zeroext i1 @test_UnionBool(i8 %b)
--
2.29.2

View File

@ -1,26 +0,0 @@
From 37cb177eb53145103ae72b67562884782dde01c3 Mon Sep 17 00:00:00 2001
From: Ivan Mironov <mironov.ivan@gmail.com>
Date: Sun, 8 Dec 2019 17:23:08 +0500
Subject: [PATCH] Use lld provided by system for wasm
---
compiler/rustc_target/src/spec/wasm_base.rs | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/compiler/rustc_target/src/spec/wasm_base.rs b/compiler/rustc_target/src/spec/wasm_base.rs
index 528a84a8b37c..353d742161d1 100644
--- a/compiler/rustc_target/src/spec/wasm_base.rs
+++ b/compiler/rustc_target/src/spec/wasm_base.rs
@@ -89,8 +89,7 @@ macro_rules! args {
// arguments just yet
limit_rdylib_exports: false,
- // we use the LLD shipped with the Rust toolchain by default
- linker: Some("rust-lld".into()),
+ linker: Some("lld".into()),
linker_flavor: LinkerFlavor::WasmLld(Cc::No),
pre_link_args,
--
2.38.1

View File

@ -1,19 +0,0 @@
--- !Policy
product_versions:
- fedora-*
decision_context: bodhi_update_push_stable
subject_type: koji_build
rules:
- !PassingTestCaseRule {test_case_name: fedora-ci.koji-build.tier0.functional}
--- !Policy
product_versions:
- rhel-8
decision_context: osci_compose_gate
rules:
- !PassingTestCaseRule {test_case_name: baseos-ci.brew-build.tier1.functional}
--- !Policy
product_versions:
- rhel-9
decision_context: osci_compose_gate
rules:
- !PassingTestCaseRule {test_case_name: baseos-ci.brew-build.tier1.functional}

View File

@ -1,51 +0,0 @@
# Explicitly use bindir tools, in case others are in the PATH,
# like the rustup shims in a user's ~/.cargo/bin/.
#
# Since cargo 1.31, install only uses $CARGO_HOME/config, ignoring $PWD.
# https://github.com/rust-lang/cargo/issues/6397
# But we can set CARGO_HOME locally, which is a good idea anyway to make sure
# it never writes to ~/.cargo during rpmbuild.
%__cargo %{_bindir}/env CARGO_HOME=.cargo %{_bindir}/cargo
%__rustc %{_bindir}/rustc
%__rustdoc %{_bindir}/rustdoc
# Enable optimization, debuginfo, and link hardening.
%__global_rustflags -Copt-level=3 -Cdebuginfo=2 -Clink-arg=-Wl,-z,relro,-z,now
%__global_rustflags_toml [%{lua:
for arg in string.gmatch(rpm.expand("%{__global_rustflags}"), "%S+") do
print('"' .. arg .. '", ')
end}]
%cargo_prep(V:) (\
%{__mkdir} -p .cargo \
cat > .cargo/config << EOF \
[build]\
rustc = "%{__rustc}"\
rustdoc = "%{__rustdoc}"\
rustflags = %{__global_rustflags_toml}\
\
[install]\
root = "%{buildroot}%{_prefix}"\
\
[term]\
verbose = true\
EOF\
%if 0%{-V:1}\
%{__tar} -xoaf %{S:%{-V*}}\
cat >> .cargo/config << EOF \
\
[source.crates-io]\
replace-with = "vendored-sources"\
\
[source.vendored-sources]\
directory = "./vendor"\
EOF\
%endif\
)
%cargo_build %__cargo build --release %{?_smp_mflags}
%cargo_test %__cargo test --release %{?_smp_mflags} --no-fail-fast
%cargo_install %__cargo install --no-track --path .

View File

@ -1,5 +0,0 @@
summary: CI Gating Plan
discover:
how: fmf
execute:
how: tmt

View File

@ -1,8 +0,0 @@
---
debuginfo:
ignore:
# i686 has limited debuginfo. From rust.spec
# full debuginfo is exhausting memory; just do libstd for now
# https://github.com/rust-lang/rust/issues/45854
- /usr/lib/debug/usr/bin/rustc-*.i386.debug

955
rust.spec

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,42 @@
--- rustc-1.48.0-src/Cargo.lock.orig 2020-11-16 06:01:53.000000000 -0800
+++ rustc-1.48.0-src/Cargo.lock 2020-11-16 09:27:44.425104404 -0800
@@ -1676,7 +1676,6 @@
dependencies = [
"cc",
"libc",
- "libssh2-sys",
"libz-sys",
"openssl-sys",
"pkg-config",
@@ -1693,20 +1692,6 @@
]
[[package]]
-name = "libssh2-sys"
-version = "0.2.19"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "ca46220853ba1c512fc82826d0834d87b06bcd3c2a42241b7de72f3d2fe17056"
-dependencies = [
- "cc",
- "libc",
- "libz-sys",
- "openssl-sys",
- "pkg-config",
- "vcpkg",
-]
-
-[[package]]
name = "libz-sys"
version = "1.1.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
--- rustc-1.48.0-src/vendor/git2/Cargo.toml.orig 2020-11-16 06:27:49.000000000 -0800
+++ rustc-1.48.0-src/vendor/git2/Cargo.toml 2020-11-16 09:27:44.425104404 -0800
@@ -49,7 +49,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"]

View File

@ -0,0 +1,44 @@
From 40d3f2d7ef5835317fe9df9ecc01f4c363def4fd Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Sebastian=20Dr=C3=B6ge?= <sebastian@centricular.com>
Date: Thu, 4 Feb 2021 10:23:01 +0200
Subject: [PATCH] Increment `self.index` before calling
`Iterator::self.a.__iterator_get_unchecked` in `Zip` `TrustedRandomAccess`
specialization
Otherwise if `Iterator::self.a.__iterator_get_unchecked` panics the
index would not have been incremented yet and another call to
`Iterator::next` would read from the same index again, which is not
allowed according to the API contract of `TrustedRandomAccess` for
`!Clone`.
Fixes https://github.com/rust-lang/rust/issues/81740
(cherry picked from commit 86a4b27475aab52b998c15f5758540697cc9cff0)
---
library/core/src/iter/adapters/zip.rs | 7 ++++---
1 file changed, 4 insertions(+), 3 deletions(-)
diff --git a/library/core/src/iter/adapters/zip.rs b/library/core/src/iter/adapters/zip.rs
index 98b8dca96140..9f9835345200 100644
--- a/library/core/src/iter/adapters/zip.rs
+++ b/library/core/src/iter/adapters/zip.rs
@@ -198,12 +198,13 @@ fn next(&mut self) -> Option<(A::Item, B::Item)> {
Some((self.a.__iterator_get_unchecked(i), self.b.__iterator_get_unchecked(i)))
}
} else if A::may_have_side_effect() && self.index < self.a.size() {
+ let i = self.index;
+ self.index += 1;
// match the base implementation's potential side effects
- // SAFETY: we just checked that `self.index` < `self.a.len()`
+ // SAFETY: we just checked that `i` < `self.a.len()`
unsafe {
- self.a.__iterator_get_unchecked(self.index);
+ self.a.__iterator_get_unchecked(i);
}
- self.index += 1;
None
} else {
None
--
2.31.1

View File

@ -0,0 +1,48 @@
From 852684d306cee955ed751f1e8d8eec6adaecff3b Mon Sep 17 00:00:00 2001
From: Joshua Nelson <jyn514@gmail.com>
Date: Mon, 8 Feb 2021 22:51:21 -0500
Subject: [PATCH] Use format string in bootstrap panic instead of a string
directly
This fixes the following warning when compiling with nightly:
```
warning: panic message is not a string literal
--> src/bootstrap/builder.rs:1515:24
|
1515 | panic!(out);
| ^^^
|
= note: `#[warn(non_fmt_panic)]` on by default
= note: this is no longer accepted in Rust 2021
help: add a "{}" format string to Display the message
|
1515 | panic!("{}", out);
| ^^^^^
help: or use std::panic::panic_any instead
|
1515 | std::panic::panic_any(out);
| ^^^^^^^^^^^^^^^^^^^^^^
```
(cherry picked from commit 31c93397bde772764cda3058e16f9cef61895090)
---
src/bootstrap/builder.rs | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/bootstrap/builder.rs b/src/bootstrap/builder.rs
index f1a160250dbe..0f5fcb4af400 100644
--- a/src/bootstrap/builder.rs
+++ b/src/bootstrap/builder.rs
@@ -1490,7 +1490,7 @@ pub fn ensure<S: Step>(&'a self, step: S) -> S::Output {
for el in stack.iter().rev() {
out += &format!("\t{:?}\n", el);
}
- panic!(out);
+ panic!("{}", out);
}
if let Some(out) = self.cache.get(&step) {
self.verbose(&format!("{}c {:?}", " ".repeat(stack.len()), step));
--
2.31.1

View File

@ -0,0 +1,96 @@
From 5222e2ba2d97cd716a379b4ae6bc62c5f7c2dd36 Mon Sep 17 00:00:00 2001
From: Giacomo Stevanato <giaco.stevanato@gmail.com>
Date: Fri, 19 Feb 2021 12:15:37 +0100
Subject: [PATCH 1/3] Increment self.len in specialized ZipImpl to avoid
underflow in size_hint
(cherry picked from commit 66a260617a88ed1ad55a46f03c5a90d5ad3004d3)
---
library/core/src/iter/adapters/zip.rs | 1 +
1 file changed, 1 insertion(+)
diff --git a/library/core/src/iter/adapters/zip.rs b/library/core/src/iter/adapters/zip.rs
index 9f9835345200..f08bfac837fe 100644
--- a/library/core/src/iter/adapters/zip.rs
+++ b/library/core/src/iter/adapters/zip.rs
@@ -200,6 +200,7 @@ fn next(&mut self) -> Option<(A::Item, B::Item)> {
} else if A::may_have_side_effect() && self.index < self.a.size() {
let i = self.index;
self.index += 1;
+ self.len += 1;
// match the base implementation's potential side effects
// SAFETY: we just checked that `i` < `self.a.len()`
unsafe {
--
2.31.1
From d39669fc8282830a374d19d204f7b4ee8eb1e381 Mon Sep 17 00:00:00 2001
From: Giacomo Stevanato <giaco.stevanato@gmail.com>
Date: Fri, 19 Feb 2021 12:16:12 +0100
Subject: [PATCH 2/3] Add test for underflow in specialized Zip's size_hint
(cherry picked from commit 8b9ac4d4155c74db5b317046033ab9c05a09e351)
---
library/core/tests/iter/adapters/zip.rs | 20 ++++++++++++++++++++
1 file changed, 20 insertions(+)
diff --git a/library/core/tests/iter/adapters/zip.rs b/library/core/tests/iter/adapters/zip.rs
index 1fce0951e365..a59771039295 100644
--- a/library/core/tests/iter/adapters/zip.rs
+++ b/library/core/tests/iter/adapters/zip.rs
@@ -245,3 +245,23 @@ fn test_double_ended_zip() {
assert_eq!(it.next_back(), Some((3, 3)));
assert_eq!(it.next(), None);
}
+
+#[test]
+fn test_issue_82282() {
+ fn overflowed_zip(arr: &[i32]) -> impl Iterator<Item = (i32, &())> {
+ static UNIT_EMPTY_ARR: [(); 0] = [];
+
+ let mapped = arr.into_iter().map(|i| *i);
+ let mut zipped = mapped.zip(UNIT_EMPTY_ARR.iter());
+ zipped.next();
+ zipped
+ }
+
+ let arr = [1, 2, 3];
+ let zip = overflowed_zip(&arr).zip(overflowed_zip(&arr));
+
+ assert_eq!(zip.size_hint(), (0, Some(0)));
+ for _ in zip {
+ panic!();
+ }
+}
--
2.31.1
From 4b382167dd5ed5a6eac0cf314bfb86e3704b6e76 Mon Sep 17 00:00:00 2001
From: Giacomo Stevanato <giaco.stevanato@gmail.com>
Date: Fri, 19 Feb 2021 12:17:48 +0100
Subject: [PATCH 3/3] Remove useless comparison since now self.index <=
self.len is an invariant
(cherry picked from commit aeb4ea739efb70e0002a4a9c4c7b8027dd0620b3)
---
library/core/src/iter/adapters/zip.rs | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/library/core/src/iter/adapters/zip.rs b/library/core/src/iter/adapters/zip.rs
index f08bfac837fe..dcbcb1ce7200 100644
--- a/library/core/src/iter/adapters/zip.rs
+++ b/library/core/src/iter/adapters/zip.rs
@@ -261,7 +261,7 @@ fn next_back(&mut self) -> Option<(A::Item, B::Item)>
if sz_a != sz_b {
let sz_a = self.a.size();
if a_side_effect && sz_a > self.len {
- for _ in 0..sz_a - cmp::max(self.len, self.index) {
+ for _ in 0..sz_a - self.len {
self.a.next_back();
}
}
--
2.31.1

View File

@ -0,0 +1,120 @@
From 0babb88efc4d36f3defafc3c3c0343793fa05d52 Mon Sep 17 00:00:00 2001
From: Giacomo Stevanato <giaco.stevanato@gmail.com>
Date: Wed, 3 Mar 2021 21:09:01 +0100
Subject: [PATCH 1/2] Prevent Zip specialization from calling
__iterator_get_unchecked twice with the same index after calling next_back
(cherry picked from commit 2371914a05f8f2763dffe6e2511d0870bcd6b461)
---
library/core/src/iter/adapters/zip.rs | 13 +++++++++----
1 file changed, 9 insertions(+), 4 deletions(-)
diff --git a/library/core/src/iter/adapters/zip.rs b/library/core/src/iter/adapters/zip.rs
index dcbcb1ce7200..7dac0c63ca2d 100644
--- a/library/core/src/iter/adapters/zip.rs
+++ b/library/core/src/iter/adapters/zip.rs
@@ -13,9 +13,10 @@
pub struct Zip<A, B> {
a: A,
b: B,
- // index and len are only used by the specialized version of zip
+ // index, len and a_len are only used by the specialized version of zip
index: usize,
len: usize,
+ a_len: usize,
}
impl<A: Iterator, B: Iterator> Zip<A, B> {
pub(in crate::iter) fn new(a: A, b: B) -> Zip<A, B> {
@@ -110,6 +111,7 @@ impl<A, B> ZipImpl<A, B> for Zip<A, B>
b,
index: 0, // unused
len: 0, // unused
+ a_len: 0, // unused
}
}
@@ -184,8 +186,9 @@ impl<A, B> ZipImpl<A, B> for Zip<A, B>
B: TrustedRandomAccess + Iterator,
{
fn new(a: A, b: B) -> Self {
- let len = cmp::min(a.size(), b.size());
- Zip { a, b, index: 0, len }
+ let a_len = a.size();
+ let len = cmp::min(a_len, b.size());
+ Zip { a, b, index: 0, len, a_len }
}
#[inline]
@@ -197,7 +200,7 @@ fn next(&mut self) -> Option<(A::Item, B::Item)> {
unsafe {
Some((self.a.__iterator_get_unchecked(i), self.b.__iterator_get_unchecked(i)))
}
- } else if A::may_have_side_effect() && self.index < self.a.size() {
+ } else if A::may_have_side_effect() && self.index < self.a_len {
let i = self.index;
self.index += 1;
self.len += 1;
@@ -264,6 +267,7 @@ fn next_back(&mut self) -> Option<(A::Item, B::Item)>
for _ in 0..sz_a - self.len {
self.a.next_back();
}
+ self.a_len = self.len;
}
let sz_b = self.b.size();
if b_side_effect && sz_b > self.len {
@@ -275,6 +279,7 @@ fn next_back(&mut self) -> Option<(A::Item, B::Item)>
}
if self.index < self.len {
self.len -= 1;
+ self.a_len -= 1;
let i = self.len;
// SAFETY: `i` is smaller than the previous value of `self.len`,
// which is also smaller than or equal to `self.a.len()` and `self.b.len()`
--
2.31.1
From 19af66a6f3e2bbb4780bb9eae7eb53bd13e3dd0f Mon Sep 17 00:00:00 2001
From: Giacomo Stevanato <giaco.stevanato@gmail.com>
Date: Fri, 19 Feb 2021 15:25:09 +0100
Subject: [PATCH 2/2] Add relevant test
(cherry picked from commit c1bfb9a78db6d481be1d03355672712c766e20b0)
---
library/core/tests/iter/adapters/zip.rs | 23 +++++++++++++++++++++++
1 file changed, 23 insertions(+)
diff --git a/library/core/tests/iter/adapters/zip.rs b/library/core/tests/iter/adapters/zip.rs
index a59771039295..000c15f72c88 100644
--- a/library/core/tests/iter/adapters/zip.rs
+++ b/library/core/tests/iter/adapters/zip.rs
@@ -265,3 +265,26 @@ fn overflowed_zip(arr: &[i32]) -> impl Iterator<Item = (i32, &())> {
panic!();
}
}
+
+#[test]
+fn test_issue_82291() {
+ use std::cell::Cell;
+
+ let mut v1 = [()];
+ let v2 = [()];
+
+ let called = Cell::new(0);
+
+ let mut zip = v1
+ .iter_mut()
+ .map(|r| {
+ called.set(called.get() + 1);
+ r
+ })
+ .zip(&v2);
+
+ zip.next_back();
+ assert_eq!(called.get(), 1);
+ zip.next();
+ assert_eq!(called.get(), 1);
+}
--
2.31.1

View File

@ -0,0 +1,66 @@
--- rustc-beta-src/Cargo.lock.orig 2021-03-09 10:30:08.626424998 -0800
+++ rustc-beta-src/Cargo.lock 2021-03-09 10:32:38.096207704 -0800
@@ -899,7 +899,6 @@
dependencies = [
"cc",
"libc",
- "libnghttp2-sys",
"libz-sys",
"openssl-sys",
"pkg-config",
@@ -1860,16 +1859,6 @@
]
[[package]]
-name = "libnghttp2-sys"
-version = "0.1.4+1.41.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "03624ec6df166e79e139a2310ca213283d6b3c30810c54844f307086d4488df1"
-dependencies = [
- "cc",
- "libc",
-]
-
-[[package]]
name = "libz-sys"
version = "1.1.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
--- rustc-beta-src/src/tools/cargo/Cargo.toml.orig 2021-03-05 08:34:15.000000000 -0800
+++ rustc-beta-src/src/tools/cargo/Cargo.toml 2021-03-09 10:32:38.096207704 -0800
@@ -25,7 +25,7 @@
crates-io = { path = "crates/crates-io", version = "0.33.0" }
crossbeam-utils = "0.8"
crypto-hash = "0.3.1"
-curl = { version = "0.4.23", features = ["http2"] }
+curl = { version = "0.4.23", features = [] }
curl-sys = "0.4.22"
env_logger = "0.8.1"
pretty_env_logger = { version = "0.4", optional = true }
--- rustc-beta-src/src/tools/cargo/src/cargo/core/package.rs.orig 2021-03-05 08:34:15.000000000 -0800
+++ rustc-beta-src/src/tools/cargo/src/cargo/core/package.rs 2021-03-09 10:32:38.096207704 -0800
@@ -412,14 +412,8 @@
// Also note that pipelining is disabled as curl authors have indicated
// that it's buggy, and we've empirically seen that it's buggy with HTTP
// proxies.
- let mut multi = Multi::new();
- let multiplexing = config.http_config()?.multiplexing.unwrap_or(true);
- multi
- .pipelining(false, multiplexing)
- .chain_err(|| "failed to enable multiplexing/pipelining in curl")?;
-
- // let's not flood crates.io with connections
- multi.set_max_host_connections(2)?;
+ let multi = Multi::new();
+ let multiplexing = false;
Ok(PackageSet {
packages: package_ids
@@ -592,7 +586,7 @@
macro_rules! try_old_curl {
($e:expr, $msg:expr) => {
let result = $e;
- if cfg!(target_os = "macos") {
+ if cfg!(any(target_os = "linux", target_os = "macos")) {
if let Err(e) = result {
warn!("ignoring libcurl {} error: {}", $msg, e);
}

View File

@ -0,0 +1,19 @@
--- rustc-beta-src/compiler/rustc_codegen_ssa/src/back/link.rs.orig 2021-03-09 10:40:09.755485845 -0800
+++ rustc-beta-src/compiler/rustc_codegen_ssa/src/back/link.rs 2021-03-09 10:44:51.257426181 -0800
@@ -1279,11 +1279,13 @@
}
fn link_output_kind(sess: &Session, crate_type: CrateType) -> LinkOutputKind {
- let kind = match (crate_type, sess.crt_static(Some(crate_type)), sess.relocation_model()) {
+ // Only use PIE if explicity specified.
+ let explicit_pic = matches!(sess.opts.cg.relocation_model, Some(RelocModel::Pic));
+ let kind = match (crate_type, sess.crt_static(Some(crate_type)), explicit_pic) {
(CrateType::Executable, _, _) if sess.is_wasi_reactor() => LinkOutputKind::WasiReactorExe,
- (CrateType::Executable, false, RelocModel::Pic) => LinkOutputKind::DynamicPicExe,
+ (CrateType::Executable, false, true) => LinkOutputKind::DynamicPicExe,
(CrateType::Executable, false, _) => LinkOutputKind::DynamicNoPicExe,
- (CrateType::Executable, true, RelocModel::Pic) => LinkOutputKind::StaticPicExe,
+ (CrateType::Executable, true, true) => LinkOutputKind::StaticPicExe,
(CrateType::Executable, true, _) => LinkOutputKind::StaticNoPicExe,
(_, true, _) => LinkOutputKind::StaticDylib,
(_, false, _) => LinkOutputKind::DynamicDylib,

View File

@ -1,92 +0,0 @@
--- rustc-beta-src/Cargo.lock.orig 2023-05-24 16:49:05.242510531 -0700
+++ rustc-beta-src/Cargo.lock 2023-05-24 16:51:11.741865603 -0700
@@ -1197,7 +1197,6 @@ checksum = "14d05c10f541ae6f3bc5b3d923c2
dependencies = [
"cc",
"libc",
- "libnghttp2-sys",
"libz-sys",
"openssl-sys",
"pkg-config",
@@ -2989,16 +2988,6 @@ source = "registry+https://github.com/ru
checksum = "7fc7aa29613bd6a620df431842069224d8bc9011086b1db4c0e0cd47fa03ec9a"
[[package]]
-name = "libnghttp2-sys"
-version = "0.1.4+1.41.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "03624ec6df166e79e139a2310ca213283d6b3c30810c54844f307086d4488df1"
-dependencies = [
- "cc",
- "libc",
-]
-
-[[package]]
name = "libz-sys"
version = "1.1.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
--- rustc-beta-src/src/tools/cargo/Cargo.toml.orig 2023-05-24 16:49:05.244510489 -0700
+++ rustc-beta-src/src/tools/cargo/Cargo.toml 2023-05-24 16:51:04.683013189 -0700
@@ -23,7 +23,7 @@ cargo-platform = { path = "crates/cargo-
cargo-util = { path = "crates/cargo-util", version = "0.2.4" }
clap = "4.2.0"
crates-io = { path = "crates/crates-io", version = "0.36.0" }
-curl = { version = "0.4.44", features = ["http2"] }
+curl = { version = "0.4.44", features = [] }
curl-sys = "0.4.61"
env_logger = "0.10.0"
filetime = "0.2.9"
--- rustc-beta-src/src/tools/cargo/src/cargo/core/package.rs.orig 2023-05-19 19:05:42.000000000 -0700
+++ rustc-beta-src/src/tools/cargo/src/cargo/core/package.rs 2023-05-24 16:49:05.244510489 -0700
@@ -407,16 +407,9 @@ impl<'cfg> PackageSet<'cfg> {
sources: SourceMap<'cfg>,
config: &'cfg Config,
) -> CargoResult<PackageSet<'cfg>> {
- // We've enabled the `http2` feature of `curl` in Cargo, so treat
- // failures here as fatal as it would indicate a build-time problem.
- let mut multi = Multi::new();
- let multiplexing = config.http_config()?.multiplexing.unwrap_or(true);
- multi
- .pipelining(false, multiplexing)
- .with_context(|| "failed to enable multiplexing/pipelining in curl")?;
-
- // let's not flood crates.io with connections
- multi.set_max_host_connections(2)?;
+ // Multiplexing is disabled because the system libcurl doesn't support it.
+ let multi = Multi::new();
+ let multiplexing = false;
Ok(PackageSet {
packages: package_ids
--- rustc-beta-src/src/tools/cargo/src/cargo/sources/registry/http_remote.rs.orig 2023-05-24 16:49:05.245510468 -0700
+++ rustc-beta-src/src/tools/cargo/src/cargo/sources/registry/http_remote.rs 2023-05-24 16:51:57.916900146 -0700
@@ -229,16 +229,8 @@ impl<'cfg> HttpRegistry<'cfg> {
}
self.fetch_started = true;
- // We've enabled the `http2` feature of `curl` in Cargo, so treat
- // failures here as fatal as it would indicate a build-time problem.
- self.multiplexing = self.config.http_config()?.multiplexing.unwrap_or(true);
-
- self.multi
- .pipelining(false, self.multiplexing)
- .with_context(|| "failed to enable multiplexing/pipelining in curl")?;
-
- // let's not flood the server with connections
- self.multi.set_max_host_connections(2)?;
+ // Multiplexing is disabled because the system libcurl doesn't support it.
+ self.multiplexing = false;
if !self.quiet {
self.config
--- rustc-beta-src/src/tools/cargo/src/cargo/util/network/mod.rs.orig 2023-05-19 19:05:42.000000000 -0700
+++ rustc-beta-src/src/tools/cargo/src/cargo/util/network/mod.rs 2023-05-24 16:49:05.245510468 -0700
@@ -25,7 +25,7 @@ impl<T> PollExt<T> for Poll<T> {
macro_rules! try_old_curl {
($e:expr, $msg:expr) => {
let result = $e;
- if cfg!(target_os = "macos") {
+ if cfg!(any(target_os = "linux", target_os = "macos")) {
if let Err(e) = result {
warn!("ignoring libcurl {} error: {}", $msg, e);
}

View File

@ -1,43 +0,0 @@
--- rustc-beta-src/Cargo.lock.orig 2023-05-19 19:02:31.000000000 -0700
+++ rustc-beta-src/Cargo.lock 2023-05-24 16:36:33.312232441 -0700
@@ -2967,7 +2967,6 @@
dependencies = [
"cc",
"libc",
- "libssh2-sys",
"libz-sys",
"openssl-sys",
"pkg-config",
@@ -3000,20 +2999,6 @@
]
[[package]]
-name = "libssh2-sys"
-version = "0.3.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "2dc8a030b787e2119a731f1951d6a773e2280c660f8ec4b0f5e1505a386e71ee"
-dependencies = [
- "cc",
- "libc",
- "libz-sys",
- "openssl-sys",
- "pkg-config",
- "vcpkg",
-]
-
-[[package]]
name = "libz-sys"
version = "1.1.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
--- rustc-beta-src/vendor/git2/Cargo.toml.orig 2023-05-19 21:16:57.000000000 -0700
+++ rustc-beta-src/vendor/git2/Cargo.toml 2023-05-24 16:33:42.043813439 -0700
@@ -55,9 +55,7 @@
[features]
default = [
- "ssh",
"https",
- "ssh_key_from_memory",
]
https = [
"libgit2-sys/https",

View File

@ -1,21 +0,0 @@
diff --git a/src/etc/rust-gdb b/src/etc/rust-gdb
index 9abed30ea6f7..e4bf55df3688 100755
--- a/src/etc/rust-gdb
+++ b/src/etc/rust-gdb
@@ -13,8 +13,6 @@ fi
# Find out where the pretty printer Python module is
RUSTC_SYSROOT="$("$RUSTC" --print=sysroot)"
GDB_PYTHON_MODULE_DIRECTORY="$RUSTC_SYSROOT/lib/rustlib/etc"
-# Get the commit hash for path remapping
-RUSTC_COMMIT_HASH="$("$RUSTC" -vV | sed -n 's/commit-hash: \([a-zA-Z0-9_]*\)/\1/p')"
# Run GDB with the additional arguments that load the pretty printers
# Set the environment variable `RUST_GDB` to overwrite the call to a
@@ -23,6 +21,6 @@ RUST_GDB="${RUST_GDB:-gdb}"
PYTHONPATH="$PYTHONPATH:$GDB_PYTHON_MODULE_DIRECTORY" exec ${RUST_GDB} \
--directory="$GDB_PYTHON_MODULE_DIRECTORY" \
-iex "add-auto-load-safe-path $GDB_PYTHON_MODULE_DIRECTORY" \
- -iex "set substitute-path /rustc/$RUSTC_COMMIT_HASH $RUSTC_SYSROOT/lib/rustlib/src/rust" \
+ -iex "set substitute-path @BUILDDIR@ $RUSTC_SYSROOT/lib/rustlib/src/rust" \
"$@"

View File

@ -1,2 +1 @@
SHA512 (rustc-1.70.0-src.tar.xz) = 21b35185fdcc35a059ee5ef6dca2b68f5f1d199e97f425a571cfc318a852c36a57bccf68e7673b4cb7cd83128f30d0b3eb93009a978f3ba3909b7eee50d40631
SHA512 (wasi-libc-wasi-sdk-20.tar.gz) = e264240dc7dbcf6398c8ca09bc108298f4a8aa955af22de5a3015fbcde81cb09dd83cd48349090082d5de0e8a3dbcf746c7b14657c67657b3f2f1ab28bb9cf05
SHA512 (rustc-1.51.0-src.tar.xz) = ded91468ddf3e6627f00e7ec3d44452aa24eb727a183c0de9d90264f593119a54300d56b09251a88260db480b48554181ae195c538996a32d68d48b6587ac0df

7
sources-bootstrap Normal file
View File

@ -0,0 +1,7 @@
SHA512 (rustc-1.51.0-src.tar.xz) = ded91468ddf3e6627f00e7ec3d44452aa24eb727a183c0de9d90264f593119a54300d56b09251a88260db480b48554181ae195c538996a32d68d48b6587ac0df
SHA512 (rust-1.50.0-aarch64-unknown-linux-gnu.tar.xz) = e6b409afc8e85a88ecb9ff439a6eb9dcb93d5553e81549fb4f332b9e2d946dce0424319c5092e60aab9435944af70d0117d15c12d54d2059ef73c1fdf36d8273
SHA512 (rust-1.50.0-armv7-unknown-linux-gnueabihf.tar.xz) = c3314436afc4ebed697bf6828b9eacbc12f96838b156241331a3b71e99e1438f8ad82e701615ea302ebfc459464479442fe653232bd319cf824027362438970d
SHA512 (rust-1.50.0-i686-unknown-linux-gnu.tar.xz) = bff117733d11731f56e8659265d0b47327e2af3f7c46aca494747a92b4f634dd35fa9731a1be59dd69821042f88bded253e1d7b5693ca237c9a167408ca7f898
SHA512 (rust-1.50.0-powerpc64le-unknown-linux-gnu.tar.xz) = e3dc75ba7dff3a358042542afa398ec8771a23f5f699454a876ddc1f3583d399fe5350696a5da62d71ca97ea882c9ae1fcb60dc2e9fdf76bc7a9af892096371e
SHA512 (rust-1.50.0-s390x-unknown-linux-gnu.tar.xz) = 733513af2a7ef7a782a5ebfbd080071194ac47084022b54b4830de84facef9986d65525f8666a4c226e9878e43b00ebced26d6077e5fb1b7f775ac8f290fba97
SHA512 (rust-1.50.0-x86_64-unknown-linux-gnu.tar.xz) = ab49e3ecb14e4af8e48548845184e9ab3d564ab2341c1e5462b7847347c79d13324211b860988d219ccb646143bf142fb14c3ab03663b06cfe9ca275128d9fa0

View File

@ -1,63 +0,0 @@
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#
# Makefile of /tools/rust/Sanity/basic-smoke
# Description: basic-smoke
# Author: Martin Cermak <mcermak@redhat.com>
#
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#
# Copyright (c) 2017 Red Hat, Inc.
#
# This program is free software: you can redistribute it and/or
# modify it under the terms of the GNU General Public License as
# published by the Free Software Foundation, either version 2 of
# the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be
# useful, but WITHOUT ANY WARRANTY; without even the implied
# warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
# PURPOSE. See the GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see http://www.gnu.org/licenses/.
#
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
export TEST=/tools/rust/Sanity/basic-smoke
export TESTVERSION=1.0
BUILT_FILES=
FILES=$(METADATA) runtest.sh Makefile PURPOSE
.PHONY: all install download clean
run: $(FILES) build
./runtest.sh
build: $(BUILT_FILES)
test -x runtest.sh || chmod a+x runtest.sh
clean:
rm -f *~ $(BUILT_FILES)
include /usr/share/rhts/lib/rhts-make.include
$(METADATA): Makefile
@echo "Owner: Martin Cermak <mcermak@redhat.com>" > $(METADATA)
@echo "Name: $(TEST)" >> $(METADATA)
@echo "TestVersion: $(TESTVERSION)" >> $(METADATA)
@echo "Path: $(TEST_DIR)" >> $(METADATA)
@echo "Description: basic-smoke" >> $(METADATA)
@echo "Type: Sanity" >> $(METADATA)
@echo "TestTime: 10m" >> $(METADATA)
@echo "RunFor: rust" >> $(METADATA)
@echo "Requires: rust" >> $(METADATA)
@echo "Priority: Normal" >> $(METADATA)
@echo "License: GPLv2+" >> $(METADATA)
@echo "Confidential: no" >> $(METADATA)
@echo "Destructive: no" >> $(METADATA)
@echo "Releases: -RHEL4 -RHELClient5 -RHELServer5" >> $(METADATA)
rhts-lint $(METADATA)

View File

@ -1,3 +0,0 @@
PURPOSE of /tools/rust/Sanity/basic-smoke
Description: basic-smoke
Author: Martin Cermak <mcermak@redhat.com>

View File

@ -1,13 +0,0 @@
summary: basic-smoke
description: ''
contact:
- Jesus Checa Hidalgo <jcheca@redhat.com>
component:
- rust
test: ./runtest.sh
framework: beakerlib
recommend:
- rust
duration: 10m
extra-summary: /tools/rust/Sanity/basic-smoke
extra-task: /tools/rust/Sanity/basic-smoke

View File

@ -1,55 +0,0 @@
#!/bin/bash
# vim: dict+=/usr/share/beakerlib/dictionary.vim cpt=.,w,b,u,t,i,k
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#
# runtest.sh of /tools/rust/Sanity/basic-smoke
# Description: basic-smoke
# Author: Martin Cermak <mcermak@redhat.com>
#
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#
# Copyright (c) 2017 Red Hat, Inc.
#
# This program is free software: you can redistribute it and/or
# modify it under the terms of the GNU General Public License as
# published by the Free Software Foundation, either version 2 of
# the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be
# useful, but WITHOUT ANY WARRANTY; without even the implied
# warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
# PURPOSE. See the GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see http://www.gnu.org/licenses/.
#
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# Include Beaker environment
. /usr/share/beakerlib/beakerlib.sh || exit 1
PACKAGE="$(rpm -qf $(which rustc))"
rlJournalStart
rlPhaseStartSetup
rlAssertRpm $PACKAGE
rlRun "TmpDir=\$(mktemp -d)" 0 "Creating tmp directory"
rlRun "pushd $TmpDir"
rlPhaseEnd
rlPhaseStartTest
HELLO_SRC=$( mktemp )
HELLO_BIN=$( mktemp )
echo 'fn main() { println!("hello"); }' > $HELLO_SRC
rlRun "which rustc"
rlRun "rustc -V"
rlRun "rustc -o $HELLO_BIN $HELLO_SRC"
rlRun "$HELLO_BIN"
rlPhaseEnd
rlPhaseStartCleanup
rlRun "popd"
rlRun "rm -r $TmpDir" 0 "Removing tmp directory"
rlPhaseEnd
rlJournalPrintText
rlJournalEnd

View File

@ -1,63 +0,0 @@
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#
# Makefile of /tools/rust/Sanity/build-stratisd
# Description: rpmbuild stratisd
# Author: Edjunior Machado <emachado@redhat.com>
#
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#
# Copyright (c) 2018 Red Hat, Inc.
#
# This program is free software: you can redistribute it and/or
# modify it under the terms of the GNU General Public License as
# published by the Free Software Foundation, either version 2 of
# the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be
# useful, but WITHOUT ANY WARRANTY; without even the implied
# warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
# PURPOSE. See the GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see http://www.gnu.org/licenses/.
#
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
export TEST=/tools/rust/Sanity/build-stratisd
export TESTVERSION=1.0
BUILT_FILES=
FILES=$(METADATA) runtest.sh Makefile PURPOSE
.PHONY: all install download clean
run: $(FILES) build
./runtest.sh
build: $(BUILT_FILES)
test -x runtest.sh || chmod a+x runtest.sh
clean:
rm -f *~ $(BUILT_FILES)
include /usr/share/rhts/lib/rhts-make.include
$(METADATA): Makefile
@echo "Owner: Edjunior Machado <emachado@redhat.com>" > $(METADATA)
@echo "Name: $(TEST)" >> $(METADATA)
@echo "TestVersion: $(TESTVERSION)" >> $(METADATA)
@echo "Path: $(TEST_DIR)" >> $(METADATA)
@echo "Description: rpmbuild stratisd" >> $(METADATA)
@echo "Type: Sanity" >> $(METADATA)
@echo "TestTime: 1h" >> $(METADATA)
@echo "RunFor: rust" >> $(METADATA)
@echo "Requires: rust rpm-build yum-utils stratisd" >> $(METADATA)
@echo "Priority: Normal" >> $(METADATA)
@echo "License: GPLv2+" >> $(METADATA)
@echo "Confidential: no" >> $(METADATA)
@echo "Destructive: no" >> $(METADATA)
@echo "Releases: RHEL8 RHEL9" >> $(METADATA)
rhts-lint $(METADATA)

View File

@ -1,3 +0,0 @@
PURPOSE of /tools/rust/Sanity/build-stratisd
Description: rpmbuild stratisd
Author: Edjunior Machado <emachado@redhat.com>

View File

@ -1,17 +0,0 @@
summary: rpmbuild stratisd
description:
- 'Ensure that rust does not break stratisd rpmbuild'
contact:
- Jesus Checa Hidalgo <jcheca@redhat.com>
component:
- rust
test: ./runtest.sh
framework: beakerlib
recommend:
- rust
- rpm-build
- yum-utils
- stratisd
duration: 1h
extra-summary: /tools/rust/Sanity/build-stratisd
extra-task: /tools/rust/Sanity/build-stratisd

View File

@ -1,65 +0,0 @@
#!/bin/bash
# vim: dict+=/usr/share/beakerlib/dictionary.vim cpt=.,w,b,u,t,i,k
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#
# runtest.sh of /tools/rust/Sanity/build-stratisd
# Description: rpmbuild stratisd
# Author: Edjunior Machado <emachado@redhat.com>
#
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#
# Copyright (c) 2018 Red Hat, Inc.
#
# This program is free software: you can redistribute it and/or
# modify it under the terms of the GNU General Public License as
# published by the Free Software Foundation, either version 2 of
# the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be
# useful, but WITHOUT ANY WARRANTY; without even the implied
# warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
# PURPOSE. See the GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see http://www.gnu.org/licenses/.
#
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# Include Beaker environment
. /usr/share/beakerlib/beakerlib.sh || exit 1
PACKAGE="$(rpm -qf $(which rustc))"
rlJournalStart
rlPhaseStartSetup
rlAssertRpm $PACKAGE || rlDie "rustc not found. Aborting testcase..."
rlRun "TmpDir=\$(mktemp -d)" 0 "Creating tmp directory"
rlRun "pushd $TmpDir"
rlPhaseEnd
PKG_TO_BUILD=stratisd
rlPhaseStart FAIL ${PKG_TO_BUILD}FetchSrcAndInstallBuildDeps
if ! rlCheckRpm $PKG_TO_BUILD; then
rlRun "yum install -y $PKG_TO_BUILD"
rlAssertRpm $PKG_TO_BUILD
fi
rlFetchSrcForInstalled $PKG_TO_BUILD
rlRun SRPM=$(ls -1 ${PKG_TO_BUILD}*src.rpm)
rlRun "rpm -ivh $SRPM"
rlRun SPECDIR="$(rpm -E '%{_specdir}')"
rlRun "yum-builddep -y ${SRPM}"
rlPhaseEnd
rlPhaseStartTest
set -o pipefail
rlRun "rpmbuild -bb ${SPECDIR}/${PKG_TO_BUILD}.spec |& tee ${SRPM}_rpmbuild.log"
rlFileSubmit "${SRPM}_rpmbuild.log"
rlPhaseEnd
rlPhaseStartCleanup
rlRun "popd"
rlRun "rm -r $TmpDir" 0 "Removing tmp directory"
rlPhaseEnd
rlJournalPrintText
rlJournalEnd

View File

@ -1,65 +0,0 @@
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#
# Makefile of /tools/rust/Sanity/rpmbuild-librsvg2
# Description: rpmbuild librsvg2
# Author: Edjunior Machado <emachado@redhat.com>
#
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#
# Copyright (c) 2018 Red Hat, Inc.
#
# This program is free software: you can redistribute it and/or
# modify it under the terms of the GNU General Public License as
# published by the Free Software Foundation, either version 2 of
# the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be
# useful, but WITHOUT ANY WARRANTY; without even the implied
# warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
# PURPOSE. See the GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see http://www.gnu.org/licenses/.
#
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
export TEST=/tools/rust/Sanity/rpmbuild-librsvg2
export TESTVERSION=1.0
BUILT_FILES=
FILES=$(METADATA) runtest.sh Makefile PURPOSE
.PHONY: all install download clean
run: $(FILES) build
./runtest.sh
build: $(BUILT_FILES)
test -x runtest.sh || chmod a+x runtest.sh
clean:
rm -f *~ $(BUILT_FILES)
include /usr/share/rhts/lib/rhts-make.include
$(METADATA): Makefile
@echo "Owner: Edjunior Machado <emachado@redhat.com>" > $(METADATA)
@echo "Name: $(TEST)" >> $(METADATA)
@echo "TestVersion: $(TESTVERSION)" >> $(METADATA)
@echo "Path: $(TEST_DIR)" >> $(METADATA)
@echo "Description: rpmbuild librsvg2" >> $(METADATA)
@echo "Type: Sanity" >> $(METADATA)
@echo "TestTime: 1h" >> $(METADATA)
@echo "RunFor: rust" >> $(METADATA)
# Due to bz1980717 librsvg2 requires git to build the srpm, but it's missing
# from the BuildRequires
@echo "Requires: rust rpm-build yum-utils librsvg2 git" >> $(METADATA)
@echo "Priority: Normal" >> $(METADATA)
@echo "License: GPLv2+" >> $(METADATA)
@echo "Confidential: no" >> $(METADATA)
@echo "Destructive: no" >> $(METADATA)
@echo "Releases: RHEL8 RHEL9" >> $(METADATA)
rhts-lint $(METADATA)

View File

@ -1,3 +0,0 @@
PURPOSE of /tools/rust/Sanity/rpmbuild-librsvg2
Description: rpmbuild librsvg2
Author: Edjunior Machado <emachado@redhat.com>

View File

@ -1,18 +0,0 @@
summary: rpmbuild librsvg2
description:
- 'Ensure that rust does not break librsvg2 rpmbuild'
contact:
- Jesus Checa Hidalgo <jcheca@redhat.com>
component:
- rust
test: ./runtest.sh
framework: beakerlib
recommend:
- rust
- rpm-build
- yum-utils
- librsvg2
- git
duration: 1h
extra-summary: /tools/rust/Sanity/rpmbuild-librsvg2
extra-task: /tools/rust/Sanity/rpmbuild-librsvg2

View File

@ -1,68 +0,0 @@
#!/bin/bash
# vim: dict+=/usr/share/beakerlib/dictionary.vim cpt=.,w,b,u,t,i,k
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#
# runtest.sh of /tools/rust/Sanity/rpmbuild-librsvg2
# Description: rpmbuild librsvg2
# Author: Edjunior Machado <emachado@redhat.com>
#
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#
# Copyright (c) 2018 Red Hat, Inc.
#
# This program is free software: you can redistribute it and/or
# modify it under the terms of the GNU General Public License as
# published by the Free Software Foundation, either version 2 of
# the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be
# useful, but WITHOUT ANY WARRANTY; without even the implied
# warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
# PURPOSE. See the GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see http://www.gnu.org/licenses/.
#
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# Include Beaker environment
. /usr/share/beakerlib/beakerlib.sh || exit 1
PACKAGE="$(rpm -qf $(which rustc))"
rlJournalStart
rlPhaseStartSetup
rlAssertRpm $PACKAGE || rlDie "rustc not found. Aborting testcase..."
rlRun "TmpDir=\$(mktemp -d)" 0 "Creating tmp directory"
rlRun "pushd $TmpDir"
rlPhaseEnd
PKG_TO_BUILD=librsvg2
rlPhaseStart FAIL ${PKG_TO_BUILD}FetchSrcAndInstallBuildDeps
if ! rlCheckRpm $PKG_TO_BUILD; then
rlRun "yum install -y $PKG_TO_BUILD ${YUM_SWITCHES}"
rlAssertRpm $PKG_TO_BUILD
fi
rlFetchSrcForInstalled $PKG_TO_BUILD
rlRun SRPM=$(ls -1 ${PKG_TO_BUILD}*src.rpm)
rlRun "rpm -ivh $SRPM"
rlRun SPECDIR="$(rpm -E '%{_specdir}')"
# librsvg2 contains dynamic dependencies. builddep needs to be run
# from the srpm (not the spec file) to be able to generate them:
# https://fedoraproject.org/wiki/Changes/DynamicBuildRequires#rpmbuild
rlRun "yum-builddep -y ${SRPM} ${YUM_SWITCHES}"
rlPhaseEnd
rlPhaseStartTest
set -o pipefail
rlRun "rpmbuild -bb ${SPECDIR}/${PKG_TO_BUILD}.spec |& tee ${SRPM}_rpmbuild.log"
rlFileSubmit "${SRPM}_rpmbuild.log"
rlPhaseEnd
rlPhaseStartCleanup
rlRun "popd"
rlRun "rm -r $TmpDir" 0 "Removing tmp directory"
rlPhaseEnd
rlJournalPrintText
rlJournalEnd

View File

@ -1,64 +0,0 @@
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#
# Makefile of /tools/rust/Sanity/rust-wasm-smoke-test
# Description: Test that the rust wasm target is enabled and can compile correctly
# Author: Jesus Checa <jcheca@redhat.com>
#
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#
# Copyright (c) 2021 Red Hat, Inc.
#
# This program is free software: you can redistribute it and/or
# modify it under the terms of the GNU General Public License as
# published by the Free Software Foundation, either version 2 of
# the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be
# useful, but WITHOUT ANY WARRANTY; without even the implied
# warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
# PURPOSE. See the GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see http://www.gnu.org/licenses/.
#
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
export TEST=/tools/rust/Sanity/rust-wasm-smoke-test
export TESTVERSION=1.0
BUILT_FILES=
FILES=$(METADATA) runtest.sh Makefile PURPOSE lib.rs test.js
.PHONY: all install download clean
run: $(FILES) build
./runtest.sh
build: $(BUILT_FILES)
test -x runtest.sh || chmod a+x runtest.sh
clean:
rm -f *~ $(BUILT_FILES)
include /usr/share/rhts/lib/rhts-make.include
$(METADATA): Makefile
@echo "Owner: Jesus Checa <jcheca@redhat.com>" > $(METADATA)
@echo "Name: $(TEST)" >> $(METADATA)
@echo "TestVersion: $(TESTVERSION)" >> $(METADATA)
@echo "Path: $(TEST_DIR)" >> $(METADATA)
@echo "Description: Test that the rust wasm target is enabled and can compile correctly" >> $(METADATA)
@echo "Type: Sanity" >> $(METADATA)
@echo "TestTime: 5m" >> $(METADATA)
@echo "RunFor: rust" >> $(METADATA)
@echo "Requires: rust rust-std-static-wasm32-unknown-unknown nodejs" >> $(METADATA)
@echo "Priority: Normal" >> $(METADATA)
@echo "License: GPLv2+" >> $(METADATA)
@echo "Confidential: no" >> $(METADATA)
@echo "Destructive: no" >> $(METADATA)
@echo "Releases: -RHEL4 -RHELClient5 -RHELServer5 -RHEL7" >> $(METADATA)
@echo "Architectures: aarch64 ppc64le x86_64" >> $(METADATA)
rhts-lint $(METADATA)

View File

@ -1,3 +0,0 @@
PURPOSE of /tools/rust/Sanity/rust-wasm-smoke-test
Description: Test that the rust wasm target is enabled and can compile correctly
Author: Jesus Checa <jcheca@redhat.com>

View File

@ -1,12 +0,0 @@
#[no_mangle]
pub fn fib(index: u32) -> u32 {
let mut nminus2;
let mut nminus1 = 1;
let mut n = 0;
for _ in 0..index {
nminus2 = nminus1;
nminus1 = n;
n = nminus2 + nminus1;
}
n
}

View File

@ -1,15 +0,0 @@
summary: Test that the rust wasm target is enabled and can compile correctly
description: ''
contact:
- Jesus Checa <jcheca@redhat.com>
component:
- rust
test: ./runtest.sh
framework: beakerlib
recommend:
- rust
- rust-std-static-wasm32-unknown-unknown
- nodejs
duration: 5m
extra-summary: /tools/rust/Sanity/rust-wasm-smoke-test
extra-task: /tools/rust/Sanity/rust-wasm-smoke-test

View File

@ -1,53 +0,0 @@
#!/bin/bash
# vim: dict+=/usr/share/beakerlib/dictionary.vim cpt=.,w,b,u,t,i,k
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#
# runtest.sh of /tools/rust/Sanity/rust-wasm-smoke-test
# Description: Test that the rust wasm target is enabled and can compile correctly
# Author: Jesus Checa <jcheca@redhat.com>
#
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#
# Copyright (c) 2021 Red Hat, Inc.
#
# This program is free software: you can redistribute it and/or
# modify it under the terms of the GNU General Public License as
# published by the Free Software Foundation, either version 2 of
# the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be
# useful, but WITHOUT ANY WARRANTY; without even the implied
# warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
# PURPOSE. See the GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see http://www.gnu.org/licenses/.
#
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# Include Beaker environment
. /usr/share/beakerlib/beakerlib.sh || exit 1
PACKAGES="$(rpm -qf $(which rustc)) rust-std-static-wasm32-unknown-unknown"
rlJournalStart
rlPhaseStartSetup
rlAssertRpm --all
rlRun "TmpDir=\$(mktemp -d)" 0 "Creating tmp directory"
rlRun "cp lib.rs $TmpDir"
rlRun "cp test.js $TmpDir"
rlRun "pushd $TmpDir"
rlPhaseEnd
rlPhaseStartTest
rlRun "rustc --target wasm32-unknown-unknown --crate-type=cdylib lib.rs -o fib.wasm" 0 "Building WASM binary"
rlRun "node test.js" 0 "Testing WASM binary"
rlPhaseEnd
rlPhaseStartCleanup
rlRun "popd"
rlRun "rm -r $TmpDir" 0 "Removing tmp directory"
rlPhaseEnd
rlJournalPrintText
rlJournalEnd

View File

@ -1,28 +0,0 @@
function js_fibonacci(index) {
let nminus2 = 0;
let nminus1 = 1;
let n = 0;
for(let i = 0; i < index; ++i) {
nminus2 = nminus1;
nminus1 = n;
n = nminus1 + nminus2;
}
return n;
}
const fs = require('fs');
const buf = fs.readFileSync('./fib.wasm');
const lib = WebAssembly.instantiate(new Uint8Array(buf)).
then(res => {
var fib = res.instance.exports.fib;
for (var i=1; i<=10; i++) {
if(fib(i) != js_fibonacci(i)){
console.log("Mismatch between wasm and JS functions");
process.exit(1);
}
}
}).catch(e => {
console.log(e);
process.exit(1);
}
);