Compare commits

..

18 Commits
rawhide ... f29

Author SHA1 Message Date
Josh Stone 090c10bfe6 Merge branch 'master' into f29 2019-11-07 11:11:11 -08:00
Josh Stone fe329cc742 Merge branch 'master' into f29 2019-09-27 20:41:21 -07:00
Josh Stone 283860d559 Merge branch 'master' into f29 2019-08-15 16:17:13 -07:00
Josh Stone a0df2edae6 Merge branch 'master' into f29 2019-07-04 15:47:34 -07:00
Josh Stone 24e68a68f8 Merge branch 'f30' into f29 2019-05-24 09:53:58 -07:00
Josh Stone f83e7bc948 Merge branch 'master' into f30 2019-05-24 09:52:38 -07:00
Josh Stone 0342509ae8 Merge branch 'f30' into f29 2019-05-14 09:37:37 -07:00
Josh Stone fc2a6e14a2 Merge branch 'master' into f30 2019-05-14 09:36:55 -07:00
Josh Stone 71235c52de Merge branch 'f30' into f29 2019-04-26 17:23:55 -07:00
Josh Stone 20dd9904db Merge branch 'master' into f30 2019-04-26 17:22:02 -07:00
Josh Stone 10e38d68be Merge branch 'master' into f29 2019-04-11 13:31:15 -07:00
Josh Stone 6699af7d3b Disable debuginfo on s390x (oom-kill) 2019-02-28 20:29:19 -08:00
Josh Stone 2f9aec1884 Merge branch 'master' into f29 2019-02-28 14:31:58 -08:00
Josh Stone d4c58ce71a Merge branch 'master' into f29 2019-01-17 15:34:07 -08:00
Josh Stone 8a250ef4a7 Merge branch 'master' into f29 2019-01-07 21:09:54 -08:00
Josh Stone 1f37d00917 Merge branch 'master' into f29 2018-12-06 13:10:20 -08:00
Josh Stone 47081d1b93 Merge branch 'master' into f29 2018-11-09 15:53:26 -08:00
Josh Stone b44be92887 Merge branch 'master' into f29 2018-10-25 16:19:08 -07:00
33 changed files with 738 additions and 1886 deletions

View File

@ -1 +0,0 @@
1

184
.gitignore vendored
View File

@ -236,187 +236,3 @@
/rust-1.38.0-powerpc64-unknown-linux-gnu.tar.xz
/rust-1.38.0-s390x-unknown-linux-gnu.tar.xz
/rust-1.38.0-x86_64-unknown-linux-gnu.tar.xz
/rustc-1.40.0-src.tar.xz
/rust-1.39.0-aarch64-unknown-linux-gnu.tar.xz
/rust-1.39.0-armv7-unknown-linux-gnueabihf.tar.xz
/rust-1.39.0-i686-unknown-linux-gnu.tar.xz
/rust-1.39.0-powerpc64le-unknown-linux-gnu.tar.xz
/rust-1.39.0-powerpc64-unknown-linux-gnu.tar.xz
/rust-1.39.0-s390x-unknown-linux-gnu.tar.xz
/rust-1.39.0-x86_64-unknown-linux-gnu.tar.xz
/rustc-1.41.0-src.tar.xz
/rust-1.40.0-aarch64-unknown-linux-gnu.tar.xz
/rust-1.40.0-armv7-unknown-linux-gnueabihf.tar.xz
/rust-1.40.0-i686-unknown-linux-gnu.tar.xz
/rust-1.40.0-powerpc64le-unknown-linux-gnu.tar.xz
/rust-1.40.0-powerpc64-unknown-linux-gnu.tar.xz
/rust-1.40.0-s390x-unknown-linux-gnu.tar.xz
/rust-1.40.0-x86_64-unknown-linux-gnu.tar.xz
/rustc-1.41.1-src.tar.xz
/rustc-1.42.0-src.tar.xz
/rust-1.41.1-aarch64-unknown-linux-gnu.tar.xz
/rust-1.41.1-armv7-unknown-linux-gnueabihf.tar.xz
/rust-1.41.1-i686-unknown-linux-gnu.tar.xz
/rust-1.41.1-powerpc64le-unknown-linux-gnu.tar.xz
/rust-1.41.1-powerpc64-unknown-linux-gnu.tar.xz
/rust-1.41.1-s390x-unknown-linux-gnu.tar.xz
/rust-1.41.1-x86_64-unknown-linux-gnu.tar.xz
/rustc-1.43.0-src.tar.xz
/rust-1.42.0-aarch64-unknown-linux-gnu.tar.xz
/rust-1.42.0-armv7-unknown-linux-gnueabihf.tar.xz
/rust-1.42.0-i686-unknown-linux-gnu.tar.xz
/rust-1.42.0-powerpc64le-unknown-linux-gnu.tar.xz
/rust-1.42.0-powerpc64-unknown-linux-gnu.tar.xz
/rust-1.42.0-s390x-unknown-linux-gnu.tar.xz
/rust-1.42.0-x86_64-unknown-linux-gnu.tar.xz
/rustc-1.43.1-src.tar.xz
/rustc-1.44.0-src.tar.xz
/rust-1.43.1-aarch64-unknown-linux-gnu.tar.xz
/rust-1.43.1-armv7-unknown-linux-gnueabihf.tar.xz
/rust-1.43.1-i686-unknown-linux-gnu.tar.xz
/rust-1.43.1-powerpc64le-unknown-linux-gnu.tar.xz
/rust-1.43.1-powerpc64-unknown-linux-gnu.tar.xz
/rust-1.43.1-s390x-unknown-linux-gnu.tar.xz
/rust-1.43.1-x86_64-unknown-linux-gnu.tar.xz
/rustc-1.44.1-src.tar.xz
/rustc-1.45.0-src.tar.xz
/rust-1.44.0-x86_64-unknown-linux-gnu.tar.xz
/rust-1.44.0-i686-unknown-linux-gnu.tar.xz
/rust-1.44.0-armv7-unknown-linux-gnueabihf.tar.xz
/rust-1.44.0-aarch64-unknown-linux-gnu.tar.xz
/rust-1.44.0-powerpc64-unknown-linux-gnu.tar.xz
/rust-1.44.0-powerpc64le-unknown-linux-gnu.tar.xz
/rust-1.44.0-s390x-unknown-linux-gnu.tar.xz
/rustc-1.45.1-src.tar.xz
/rustc-1.45.2-src.tar.xz
/rustc-1.46.0-src.tar.xz
/rust-1.45.2-aarch64-unknown-linux-gnu.tar.xz
/rust-1.45.2-armv7-unknown-linux-gnueabihf.tar.xz
/rust-1.45.2-i686-unknown-linux-gnu.tar.xz
/rust-1.45.2-powerpc64le-unknown-linux-gnu.tar.xz
/rust-1.45.2-powerpc64-unknown-linux-gnu.tar.xz
/rust-1.45.2-s390x-unknown-linux-gnu.tar.xz
/rust-1.45.2-x86_64-unknown-linux-gnu.tar.xz
/rustc-1.47.0-src.tar.xz
/rust-1.46.0-aarch64-unknown-linux-gnu.tar.xz
/rust-1.46.0-armv7-unknown-linux-gnueabihf.tar.xz
/rust-1.46.0-i686-unknown-linux-gnu.tar.xz
/rust-1.46.0-powerpc64le-unknown-linux-gnu.tar.xz
/rust-1.46.0-powerpc64-unknown-linux-gnu.tar.xz
/rust-1.46.0-s390x-unknown-linux-gnu.tar.xz
/rust-1.46.0-x86_64-unknown-linux-gnu.tar.xz
/rustc-1.48.0-src.tar.xz
/rust-1.47.0-aarch64-unknown-linux-gnu.tar.xz
/rust-1.47.0-armv7-unknown-linux-gnueabihf.tar.xz
/rust-1.47.0-i686-unknown-linux-gnu.tar.xz
/rust-1.47.0-powerpc64le-unknown-linux-gnu.tar.xz
/rust-1.47.0-powerpc64-unknown-linux-gnu.tar.xz
/rust-1.47.0-s390x-unknown-linux-gnu.tar.xz
/rust-1.47.0-x86_64-unknown-linux-gnu.tar.xz
/rustc-1.49.0-src.tar.xz
/rust-1.48.0-aarch64-unknown-linux-gnu.tar.xz
/rust-1.48.0-armv7-unknown-linux-gnueabihf.tar.xz
/rust-1.48.0-i686-unknown-linux-gnu.tar.xz
/rust-1.48.0-powerpc64le-unknown-linux-gnu.tar.xz
/rust-1.48.0-powerpc64-unknown-linux-gnu.tar.xz
/rust-1.48.0-s390x-unknown-linux-gnu.tar.xz
/rust-1.48.0-x86_64-unknown-linux-gnu.tar.xz
/rustc-1.50.0-src.tar.xz
/rust-1.49.0-aarch64-unknown-linux-gnu.tar.xz
/rust-1.49.0-armv7-unknown-linux-gnueabihf.tar.xz
/rust-1.49.0-i686-unknown-linux-gnu.tar.xz
/rust-1.49.0-powerpc64le-unknown-linux-gnu.tar.xz
/rust-1.49.0-s390x-unknown-linux-gnu.tar.xz
/rust-1.49.0-x86_64-unknown-linux-gnu.tar.xz
/rustc-1.51.0-src.tar.xz
/rust-1.50.0-aarch64-unknown-linux-gnu.tar.xz
/rust-1.50.0-armv7-unknown-linux-gnueabihf.tar.xz
/rust-1.50.0-i686-unknown-linux-gnu.tar.xz
/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

@ -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

View File

@ -0,0 +1,32 @@
commit ab998a2eeb2bcdc69ce70c814af97f0d1302a404 (from d17f62d857c70508efbf60be41135880bcd2e062)
Merge: d17f62d857c7 9452a8dfa3ba
Author: Mazdak Farrokhzad <twingoow@gmail.com>
Date: Thu Jan 24 00:20:00 2019 +0100
Rollup merge of #57840 - tromey:fix-issue-57762, r=nikic
Fix issue 57762
against a stock LLVM 7. LLVM 7 was released without a necessary fix
for a bug in the DWARF discriminant code.
This patch changes rustc to use the fallback mode on (non-Rust) LLVM 7.
Closes #57762
diff --git a/src/librustc_codegen_llvm/debuginfo/metadata.rs b/src/librustc_codegen_llvm/debuginfo/metadata.rs
index 6deedd0b5ea3..9f63038c3623 100644
--- a/src/librustc_codegen_llvm/debuginfo/metadata.rs
+++ b/src/librustc_codegen_llvm/debuginfo/metadata.rs
@@ -1164,7 +1164,10 @@ fn use_enum_fallback(cx: &CodegenCx) -> bool {
// On MSVC we have to use the fallback mode, because LLVM doesn't
// lower variant parts to PDB.
return cx.sess().target.target.options.is_like_msvc
- || llvm_util::get_major_version() < 7;
+ // LLVM version 7 did not release with an important bug fix;
+ // but the required patch is in the LLVM 8. Rust LLVM reports
+ // 8 as well.
+ || llvm_util::get_major_version() < 8;
}
// Describes the members of an enum value: An enum is described as a union of

View File

@ -0,0 +1,479 @@
From 8e0007f829661e57d008d2e908c95f6e84b04b25 Mon Sep 17 00:00:00 2001
From: bors <bors@rust-lang.org>
Date: Thu, 24 Oct 2019 07:27:00 +0000
Subject: [PATCH] Auto merge of #65474 - Mark-Simulacrum:rustc-dev-split,
r=pietroalbini
Split the rustc target libraries into separate rustc-dev component
This is re-applies a squashed version of #64823 as well as including #65337 to fix bugs noted after merging the first PR.
The second PR is confirmed as fixing windows-gnu, and presumably also fixes other platforms, such as musl (i.e. #65335 should be fixed); `RUSTUP_DIST_SERVER=https://dev-static.rust-lang.org rustup toolchain install nightly-2019-10-16` can be installed to confirm that this is indeed the case.
diff --git a/src/bootstrap/builder.rs b/src/bootstrap/builder.rs
index b8071b98f707..2748903f2d47 100644
--- a/src/bootstrap/builder.rs
+++ b/src/bootstrap/builder.rs
@@ -443,6 +443,7 @@ impl<'a> Builder<'a> {
dist::Rustc,
dist::DebuggerScripts,
dist::Std,
+ dist::RustcDev,
dist::Analysis,
dist::Src,
dist::PlainSourceTarball,
diff --git a/src/bootstrap/check.rs b/src/bootstrap/check.rs
index cadb9a7e441f..df1c72575846 100644
--- a/src/bootstrap/check.rs
+++ b/src/bootstrap/check.rs
@@ -55,6 +55,7 @@ impl Step for Std {
cargo,
args(builder.kind),
&libstd_stamp(builder, compiler, target),
+ vec![],
true);
let libdir = builder.sysroot_libdir(compiler, target);
@@ -103,6 +104,7 @@ impl Step for Rustc {
cargo,
args(builder.kind),
&librustc_stamp(builder, compiler, target),
+ vec![],
true);
let libdir = builder.sysroot_libdir(compiler, target);
@@ -155,6 +157,7 @@ impl Step for CodegenBackend {
cargo,
args(builder.kind),
&codegen_backend_stamp(builder, compiler, target, backend),
+ vec![],
true);
}
}
@@ -199,6 +202,7 @@ impl Step for Rustdoc {
cargo,
args(builder.kind),
&rustdoc_stamp(builder, compiler, target),
+ vec![],
true);
let libdir = builder.sysroot_libdir(compiler, target);
diff --git a/src/bootstrap/compile.rs b/src/bootstrap/compile.rs
index 5074b035789a..da8d43ed49b7 100644
--- a/src/bootstrap/compile.rs
+++ b/src/bootstrap/compile.rs
@@ -69,7 +69,7 @@ impl Step for Std {
return;
}
- builder.ensure(StartupObjects { compiler, target });
+ let mut target_deps = builder.ensure(StartupObjects { compiler, target });
let compiler_to_use = builder.compiler_for(compiler.stage, compiler.host, target);
if compiler_to_use != compiler {
@@ -91,7 +91,7 @@ impl Step for Std {
return;
}
- copy_third_party_objects(builder, &compiler, target);
+ target_deps.extend(copy_third_party_objects(builder, &compiler, target).into_iter());
let mut cargo = builder.cargo(compiler, Mode::Std, target, "build");
std_cargo(builder, &compiler, target, &mut cargo);
@@ -102,6 +102,7 @@ impl Step for Std {
cargo,
vec![],
&libstd_stamp(builder, compiler, target),
+ target_deps,
false);
builder.ensure(StdLink {
@@ -113,9 +114,22 @@ impl Step for Std {
}
/// Copies third pary objects needed by various targets.
-fn copy_third_party_objects(builder: &Builder<'_>, compiler: &Compiler, target: Interned<String>) {
+fn copy_third_party_objects(builder: &Builder<'_>, compiler: &Compiler, target: Interned<String>)
+ -> Vec<PathBuf>
+{
let libdir = builder.sysroot_libdir(*compiler, target);
+ let mut target_deps = vec![];
+
+ let mut copy_and_stamp = |sourcedir: &Path, name: &str| {
+ let target = libdir.join(name);
+ builder.copy(
+ &sourcedir.join(name),
+ &target,
+ );
+ target_deps.push(target);
+ };
+
// Copies the crt(1,i,n).o startup objects
//
// Since musl supports fully static linking, we can cross link for it even
@@ -123,19 +137,13 @@ fn copy_third_party_objects(builder: &Builder<'_>, compiler: &Compiler, target:
// files. As those shipped with glibc won't work, copy the ones provided by
// musl so we have them on linux-gnu hosts.
if target.contains("musl") {
+ let srcdir = builder.musl_root(target).unwrap().join("lib");
for &obj in &["crt1.o", "crti.o", "crtn.o"] {
- builder.copy(
- &builder.musl_root(target).unwrap().join("lib").join(obj),
- &libdir.join(obj),
- );
+ copy_and_stamp(&srcdir, obj);
}
} else if target.ends_with("-wasi") {
- for &obj in &["crt1.o"] {
- builder.copy(
- &builder.wasi_root(target).unwrap().join("lib/wasm32-wasi").join(obj),
- &libdir.join(obj),
- );
- }
+ let srcdir = builder.wasi_root(target).unwrap().join("lib/wasm32-wasi");
+ copy_and_stamp(&srcdir, "crt1.o");
}
// Copies libunwind.a compiled to be linked wit x86_64-fortanix-unknown-sgx.
@@ -145,11 +153,11 @@ fn copy_third_party_objects(builder: &Builder<'_>, compiler: &Compiler, target:
// which is provided by std for this target.
if target == "x86_64-fortanix-unknown-sgx" {
let src_path_env = "X86_FORTANIX_SGX_LIBS";
- let obj = "libunwind.a";
let src = env::var(src_path_env).expect(&format!("{} not found in env", src_path_env));
- let src = Path::new(&src).join(obj);
- builder.copy(&src, &libdir.join(obj));
+ copy_and_stamp(Path::new(&src), "libunwind.a");
}
+
+ target_deps
}
/// Configure cargo to compile the standard library, adding appropriate env vars
@@ -306,7 +314,7 @@ pub struct StartupObjects {
}
impl Step for StartupObjects {
- type Output = ();
+ type Output = Vec<PathBuf>;
fn should_run(run: ShouldRun<'_>) -> ShouldRun<'_> {
run.path("src/rtstartup")
@@ -325,13 +333,15 @@ impl Step for StartupObjects {
/// They don't require any library support as they're just plain old object
/// files, so we just use the nightly snapshot compiler to always build them (as
/// no other compilers are guaranteed to be available).
- fn run(self, builder: &Builder<'_>) {
+ fn run(self, builder: &Builder<'_>) -> Vec<PathBuf> {
let for_compiler = self.compiler;
let target = self.target;
if !target.contains("windows-gnu") {
- return
+ return vec![]
}
+ let mut target_deps = vec![];
+
let src_dir = &builder.src.join("src/rtstartup");
let dst_dir = &builder.native_dir(target).join("rtstartup");
let sysroot_dir = &builder.sysroot_libdir(for_compiler, target);
@@ -350,7 +360,9 @@ impl Step for StartupObjects {
.arg(src_file));
}
- builder.copy(dst_file, &sysroot_dir.join(file.to_string() + ".o"));
+ let target = sysroot_dir.join(file.to_string() + ".o");
+ builder.copy(dst_file, &target);
+ target_deps.push(target);
}
for obj in ["crt2.o", "dllcrt2.o"].iter() {
@@ -358,8 +370,12 @@ impl Step for StartupObjects {
builder.cc(target),
target,
obj);
- builder.copy(&src, &sysroot_dir.join(obj));
+ let target = sysroot_dir.join(obj);
+ builder.copy(&src, &target);
+ target_deps.push(target);
}
+
+ target_deps
}
}
@@ -437,6 +453,7 @@ impl Step for Rustc {
cargo,
vec![],
&librustc_stamp(builder, compiler, target),
+ vec![],
false);
builder.ensure(RustcLink {
@@ -585,7 +602,7 @@ impl Step for CodegenBackend {
let tmp_stamp = out_dir.join(".tmp.stamp");
- let files = run_cargo(builder, cargo, vec![], &tmp_stamp, false);
+ let files = run_cargo(builder, cargo, vec![], &tmp_stamp, vec![], false);
if builder.config.dry_run {
return;
}
@@ -941,6 +958,7 @@ pub fn run_cargo(builder: &Builder<'_>,
cargo: Cargo,
tail_args: Vec<String>,
stamp: &Path,
+ additional_target_deps: Vec<PathBuf>,
is_check: bool)
-> Vec<PathBuf>
{
@@ -1057,6 +1075,7 @@ pub fn run_cargo(builder: &Builder<'_>,
deps.push((path_to_add.into(), false));
}
+ deps.extend(additional_target_deps.into_iter().map(|d| (d, false)));
deps.sort();
let mut new_contents = Vec::new();
for (dep, proc_macro) in deps.iter() {
diff --git a/src/bootstrap/dist.rs b/src/bootstrap/dist.rs
index 514ad1144491..93143570b0fe 100644
--- a/src/bootstrap/dist.rs
+++ b/src/bootstrap/dist.rs
@@ -637,6 +637,28 @@ impl Step for DebuggerScripts {
}
}
+fn skip_host_target_lib(builder: &Builder<'_>, compiler: Compiler) -> bool {
+ // The only true set of target libraries came from the build triple, so
+ // let's reduce redundant work by only producing archives from that host.
+ if compiler.host != builder.config.build {
+ builder.info("\tskipping, not a build host");
+ true
+ } else {
+ false
+ }
+}
+
+/// Copy stamped files into an image's `target/lib` directory.
+fn copy_target_libs(builder: &Builder<'_>, target: &str, image: &Path, stamp: &Path) {
+ let dst = image.join("lib/rustlib").join(target).join("lib");
+ t!(fs::create_dir_all(&dst));
+ for (path, host) in builder.read_stamp_file(stamp) {
+ if !host || builder.config.build == target {
+ builder.copy(&path, &dst.join(path.file_name().unwrap()));
+ }
+ }
+}
+
#[derive(Debug, PartialOrd, Ord, Copy, Clone, Hash, PartialEq, Eq)]
pub struct Std {
pub compiler: Compiler,
@@ -667,44 +689,19 @@ impl Step for Std {
let target = self.target;
let name = pkgname(builder, "rust-std");
-
- // The only true set of target libraries came from the build triple, so
- // let's reduce redundant work by only producing archives from that host.
- if compiler.host != builder.config.build {
- builder.info("\tskipping, not a build host");
- return distdir(builder).join(format!("{}-{}.tar.gz", name, target));
+ let archive = distdir(builder).join(format!("{}-{}.tar.gz", name, target));
+ if skip_host_target_lib(builder, compiler) {
+ return archive;
}
- // We want to package up as many target libraries as possible
- // for the `rust-std` package, so if this is a host target we
- // depend on librustc and otherwise we just depend on libtest.
- if builder.hosts.iter().any(|t| t == target) {
- builder.ensure(compile::Rustc { compiler, target });
- } else {
- builder.ensure(compile::Std { compiler, target });
- }
+ builder.ensure(compile::Std { compiler, target });
let image = tmpdir(builder).join(format!("{}-{}-image", name, target));
let _ = fs::remove_dir_all(&image);
- let dst = image.join("lib/rustlib").join(target);
- t!(fs::create_dir_all(&dst));
- let mut src = builder.sysroot_libdir(compiler, target).to_path_buf();
- src.pop(); // Remove the trailing /lib folder from the sysroot_libdir
- builder.cp_filtered(&src, &dst, &|path| {
- if let Some(name) = path.file_name().and_then(|s| s.to_str()) {
- if name == builder.config.rust_codegen_backends_dir.as_str() {
- return false
- }
- if name == "bin" {
- return false
- }
- if name.contains("LLVM") {
- return false
- }
- }
- true
- });
+ let compiler_to_use = builder.compiler_for(compiler.stage, compiler.host, target);
+ let stamp = compile::libstd_stamp(builder, compiler_to_use, target);
+ copy_target_libs(builder, &target, &image, &stamp);
let mut cmd = rust_installer(builder);
cmd.arg("generate")
@@ -723,7 +720,73 @@ impl Step for Std {
let _time = timeit(builder);
builder.run(&mut cmd);
builder.remove_dir(&image);
- distdir(builder).join(format!("{}-{}.tar.gz", name, target))
+ archive
+ }
+}
+
+#[derive(Debug, PartialOrd, Ord, Copy, Clone, Hash, PartialEq, Eq)]
+pub struct RustcDev {
+ pub compiler: Compiler,
+ pub target: Interned<String>,
+}
+
+impl Step for RustcDev {
+ type Output = PathBuf;
+ const DEFAULT: bool = true;
+ const ONLY_HOSTS: bool = true;
+
+ fn should_run(run: ShouldRun<'_>) -> ShouldRun<'_> {
+ run.path("rustc-dev")
+ }
+
+ fn make_run(run: RunConfig<'_>) {
+ run.builder.ensure(RustcDev {
+ compiler: run.builder.compiler_for(
+ run.builder.top_stage,
+ run.builder.config.build,
+ run.target,
+ ),
+ target: run.target,
+ });
+ }
+
+ fn run(self, builder: &Builder<'_>) -> PathBuf {
+ let compiler = self.compiler;
+ let target = self.target;
+
+ let name = pkgname(builder, "rustc-dev");
+ let archive = distdir(builder).join(format!("{}-{}.tar.gz", name, target));
+ if skip_host_target_lib(builder, compiler) {
+ return archive;
+ }
+
+ builder.ensure(compile::Rustc { compiler, target });
+
+ let image = tmpdir(builder).join(format!("{}-{}-image", name, target));
+ let _ = fs::remove_dir_all(&image);
+
+ let compiler_to_use = builder.compiler_for(compiler.stage, compiler.host, target);
+ let stamp = compile::librustc_stamp(builder, compiler_to_use, target);
+ copy_target_libs(builder, &target, &image, &stamp);
+
+ let mut cmd = rust_installer(builder);
+ cmd.arg("generate")
+ .arg("--product-name=Rust")
+ .arg("--rel-manifest-dir=rustlib")
+ .arg("--success-message=Rust-is-ready-to-develop.")
+ .arg("--image-dir").arg(&image)
+ .arg("--work-dir").arg(&tmpdir(builder))
+ .arg("--output-dir").arg(&distdir(builder))
+ .arg(format!("--package-name={}-{}", name, target))
+ .arg(format!("--component-name=rustc-dev-{}", target))
+ .arg("--legacy-manifest-dirs=rustlib,cargo");
+
+ builder.info(&format!("Dist rustc-dev stage{} ({} -> {})",
+ compiler.stage, &compiler.host, target));
+ let _time = timeit(builder);
+ builder.run(&mut cmd);
+ builder.remove_dir(&image);
+ archive
}
}
diff --git a/src/bootstrap/lib.rs b/src/bootstrap/lib.rs
index a182405f3b2d..d1cf1cbca784 100644
--- a/src/bootstrap/lib.rs
+++ b/src/bootstrap/lib.rs
@@ -1137,6 +1137,7 @@ impl Build {
pub fn copy(&self, src: &Path, dst: &Path) {
if self.config.dry_run { return; }
self.verbose_than(1, &format!("Copy {:?} to {:?}", src, dst));
+ if src == dst { return; }
let _ = fs::remove_file(&dst);
let metadata = t!(src.symlink_metadata());
if metadata.file_type().is_symlink() {
diff --git a/src/tools/build-manifest/src/main.rs b/src/tools/build-manifest/src/main.rs
index f41e7dd17ede..c0d2deab2f8b 100644
--- a/src/tools/build-manifest/src/main.rs
+++ b/src/tools/build-manifest/src/main.rs
@@ -399,6 +399,7 @@ impl Builder {
fn add_packages_to(&mut self, manifest: &mut Manifest) {
let mut package = |name, targets| self.package(name, &mut manifest.pkg, targets);
package("rustc", HOSTS);
+ package("rustc-dev", HOSTS);
package("cargo", HOSTS);
package("rust-mingw", MINGW);
package("rust-std", TARGETS);
@@ -426,6 +427,13 @@ impl Builder {
"rls-preview", "rust-src", "llvm-tools-preview",
"lldb-preview", "rust-analysis", "miri-preview"
]);
+
+ // The compiler libraries are not stable for end users, but `rustc-dev` was only recently
+ // split out of `rust-std`. We'll include it by default as a transition for nightly users.
+ if self.rust_release == "nightly" {
+ self.extend_profile("default", &mut manifest.profiles, &["rustc-dev"]);
+ self.extend_profile("complete", &mut manifest.profiles, &["rustc-dev"]);
+ }
}
fn add_renames_to(&self, manifest: &mut Manifest) {
@@ -481,6 +489,15 @@ impl Builder {
components.push(host_component("rust-mingw"));
}
+ // The compiler libraries are not stable for end users, but `rustc-dev` was only recently
+ // split out of `rust-std`. We'll include it by default as a transition for nightly users,
+ // but ship it as an optional component on the beta and stable channels.
+ if self.rust_release == "nightly" {
+ components.push(host_component("rustc-dev"));
+ } else {
+ extensions.push(host_component("rustc-dev"));
+ }
+
// Tools are always present in the manifest,
// but might be marked as unavailable if they weren't built.
extensions.extend(vec![
@@ -498,6 +515,11 @@ impl Builder {
.filter(|&&target| target != host)
.map(|target| Component::from_str("rust-std", target))
);
+ extensions.extend(
+ HOSTS.iter()
+ .filter(|&&target| target != host)
+ .map(|target| Component::from_str("rustc-dev", target))
+ );
extensions.push(Component::from_str("rust-src", "*"));
// If the components/extensions don't actually exist for this
@@ -534,6 +556,14 @@ impl Builder {
dst.insert(profile_name.to_owned(), pkgs.iter().map(|s| (*s).to_owned()).collect());
}
+ fn extend_profile(&mut self,
+ profile_name: &str,
+ dst: &mut BTreeMap<String, Vec<String>>,
+ pkgs: &[&str]) {
+ dst.get_mut(profile_name).expect("existing profile")
+ .extend(pkgs.iter().map(|s| (*s).to_owned()));
+ }
+
fn package(&mut self,
pkgname: &str,
dst: &mut BTreeMap<String, Package>,

1041
rust.spec

File diff suppressed because it is too large Load Diff

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.39.0-src.tar.xz) = 8610b2ec77722087c572bd84ac562a5b7c5f1a644aea58c5d5daa07a9aed242703b7816e73e2eaa049f773d5907859e259744a0de700622df005584fd798dab0

8
sources-bootstrap Normal file
View File

@ -0,0 +1,8 @@
SHA512 (rustc-1.39.0-src.tar.xz) = 8610b2ec77722087c572bd84ac562a5b7c5f1a644aea58c5d5daa07a9aed242703b7816e73e2eaa049f773d5907859e259744a0de700622df005584fd798dab0
SHA512 (rust-1.38.0-aarch64-unknown-linux-gnu.tar.xz) = c9dea8907d05af938c1936139c1fb8673d0db90503552f53645d71637bb7248263fd20b1c16db140694b2d467a12c474015a2077d9b26c782b44e965a01544c6
SHA512 (rust-1.38.0-armv7-unknown-linux-gnueabihf.tar.xz) = ddbb2c8d2e7112c5871155890c8308080ac800795c685c4b4d06b9dd8c5abd28ee13961686c9be465d1bbd33d476c6478b90af8de0ca5a451f8b07eaff42f97d
SHA512 (rust-1.38.0-i686-unknown-linux-gnu.tar.xz) = ffdea264378510c6df687a173211427f4cb5930553c9d14e33c5776b0e15d435d1be719bba8a1db50f50a3171a38802e090451dc92a6ea764cc8fdca24651f24
SHA512 (rust-1.38.0-powerpc64le-unknown-linux-gnu.tar.xz) = 5f3e1dd233ef17d8a296dcb55738fa119e40c32b154a7575f149bf1475b64e34f7e805f206b9862dc6499be470f179290d8abb7ad8d2b5cb355cef03d95ae374
SHA512 (rust-1.38.0-powerpc64-unknown-linux-gnu.tar.xz) = 26240976834e510fa5a47c35b747b42db4651ea8decdb5498704432c9a21563e603046994fcc2b070d06361bf2c36fe02a15c7f02d88161b299a410f1995983a
SHA512 (rust-1.38.0-s390x-unknown-linux-gnu.tar.xz) = 7af64849236e0173d2aea723f3462682fde7d2e1e04d61c28d215163415e1b15cfb8cac57010ce55bdd928ea74076506ef50376d7550999e0fb00f9d20c4f5ff
SHA512 (rust-1.38.0-x86_64-unknown-linux-gnu.tar.xz) = 0b25c3049a7a213e9151c898979ec9b5b45e46a9072f9853d8f048cf401ef7ac343526d6919e68607a490e3e7bd0375b12ed9fb253caed26bb60f46473d3699b

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);
}
);