Compare commits

...

47 Commits

Author SHA1 Message Date
David Abdurachmanov 6d774e1b7a
Skip panic_abort_doc_tests on riscv64
riscv64 is also affected by:
https://github.com/rust-lang/rust/issues/123733

Signed-off-by: David Abdurachmanov <davidlt@rivosinc.com>
2024-05-14 13:37:40 +03:00
David Abdurachmanov 9d877b0c10
Disable check section (leaky test)
There is a test that never finished and consumed all memory until the
build task gets restarted.

Signed-off-by: David Abdurachmanov <davidlt@rivosinc.com>
2024-05-13 19:29:15 +03:00
Josh Stone 110b2ab26e Update to 1.78.0 2024-05-02 10:01:52 -07:00
Josh Stone 3334ed315d Use bundled sqlite3 when the system version is too old. 2024-04-30 15:16:04 -07:00
Jesus Checa Hidalgo b12fe9f482 test: Move librsvg2 and stratisd rebuild tests into rpm-rebuild test 2024-04-25 05:46:50 +00:00
Jesus Checa Hidalgo 51570d63ec tests: Add rpmbuild tests
Created a virtual testcase for building any rpm with rust.
Added two specific cases: rpm-sequoia and ripgrep
2024-04-25 05:46:50 +00:00
Josh Stone 8fff280b59 Disable brp-strip-static-archive
We do want debuginfo for the standard library when built into other
programs, and this also avoids problems with strip on wasm and uefi.
2024-04-24 16:36:01 -07:00
Josh Stone 8e7d2666e4 Add fixes for several test cases 2024-04-16 17:15:17 -07:00
Josh Stone 230ae0c65c [rhel] Rename rust-srpm-macros to rust-toolset-srpm-macros
The upgrade path was broken because the Rust version compares less than
the rust2rpm-based package version that was in RHEL 8 and 9. With a new
name and appropriate Obsoletes and Provides, it should upgrade cleanly.

Ref: https://issues.redhat.com/browse/RHEL-30636
2024-04-16 10:54:39 -07:00
Josh Stone d04d391a82 Update to 1.77.2; Fixes RHBZ#2274248 CVE-2024-24576 2024-04-09 14:56:51 -07:00
Josh Stone 4db2e77269 Convert to %autorelease and %autochangelog
[skip changelog]
2024-04-09 10:10:47 -07:00
Nikita Popov f6ac4da7c5 Fix building against compat library
We also need to use the corresponding compiler-rt version and
use the llvm-profdata from the correct path.

The compat build is now enabled by defining llvm_compat_version.
2024-04-08 16:23:47 +09:00
Josh Stone 46e7352445 Ensure more consistency in PGO flags -- fixes Cargo tests 2024-04-05 17:11:37 -07:00
Davide Cavalca e0c61d2262 Add build target for aarch64-unknown-none-softfloat 2024-03-22 10:07:19 -07:00
Nikita Popov 15b7bb28e4 Add LLVM 18 compat patches 2024-03-21 15:18:16 +01:00
Nikita Popov 504e9e1d44 Update to 1.77.0 2024-03-21 15:18:10 +01:00
David Abdurachmanov 6b5e21282d Lower memory usage for riscv64
Signed-off-by: David Abdurachmanov <davidlt@rivosinc.com>
Signed-off-by: Richard W.M. Jones <rjones@redhat.com>
2024-02-19 16:59:34 +00:00
Josh Stone 89eacb88ce Update to 1.76.0. 2024-02-08 09:36:10 -08:00
Josh Stone d7cd45b9e4 Consolidate 32-bit build compromises. 2024-01-30 16:59:46 -08:00
Yaakov Selkowitz 6501920abb Sync rust-toolset macros to rust-packaging v25.2
This bring RHEL rust-toolset in sync with the latest Fedora
rust-packaging, most importantly:

* Fedora's new style (-v vendor) vendoring is implemented. The old RHEL
style (-V #) vendoring is still supported, at least until we can convert
everything in ELN.

* Automatic generation of bundled provides using %cargo_vendor_manifest.
However, instead of depending on cargo2rpm, a very stripped-down version
of just its parse-vendor-manifest command is provided as a private
script, along with a fileattr to call it.

Other changes incorporated in this commit:

* -Cstrip=none added to %build_rustflags.

* --profile rpm is used instead of --release.

* Errors in spawned commands are now caught.

* Comments and whitespace are synced for easier comparison with Fedora.

* --target all is dropped from license and vendor macros, to avoid false
  alarms from windows crates.
2024-01-29 03:05:57 +00:00
Yaakov Selkowitz 8c1ae0e762 Provide rust-srpm-macros in RHEL
rust-srpm-macros is a dependency of redhat-rpm-config so that Rust-based
SRPMs can rely on these particular macros.  In RHEL 9 and earlier,
rust-srpm-macros was a separate source package which was included in
RHEL.  Since then, it became a subpackage of rust-packaging in Fedora.

In order to not pull in any part of rust-packaging into RHEL 10, thereby
allowing it to be maintained separately in EPEL, those macros are
provided here instead.
2024-01-29 03:05:57 +00:00
Fedora Release Engineering 6c6aaa4382 Rebuilt for https://fedoraproject.org/wiki/Fedora_40_Mass_Rebuild 2024-01-26 17:48:12 +00:00
Josh Stone 6f2eb1990e Rename x/xk macros for older rpm compat 2024-01-03 16:22:01 -08:00
Josh Stone 162f7919e2 Update to 1.75.0. 2023-12-31 11:00:36 -08:00
Josh Stone a057e85147 Update to 1.74.1. 2023-12-07 09:56:29 -08:00
Josh Stone 6a528e9169 Update to 1.74.0. 2023-11-16 08:50:29 -08:00
Josh Stone 69f0d33100 Detect non-stable channels from the version 2023-11-16 08:28:54 -08:00
Yaakov Selkowitz 6b33462485 Sync rust-toolset macros from rust-packaging
This updates the RHEL/ELN rust-toolset macros to the state of
macros.rust and macros.cargo from Fedora rust-packaging v24, with
the following exceptions:

* %__cargo_to_rpm, as cargo2rpm is not shipped in RHEL;

* %cargo_registry, %cargo_instdir, and %cargo_generate_buildrequires
which are for building and/or consuming "library" crates which are not
built in RHEL;

* %__cargo_is_{bin,lib} and the is-lib conditional section of
%cargo_install, as they use cargo2rpm, and only "binary" crates are
built in RHEL;

* Dropped RUSTC_BOOTSTRAP and -Z avoid-dev-deps, as they are overly
broad and should not be needed with vendored builds (rust-packaging#23);

* Dropped rustflags that are already set by default (rust-packaging#24).
2023-11-15 13:20:52 -05:00
Josh Stone 9746593522 Use thin-LTO and PGO for rustc itself. 2023-10-26 09:01:56 -07:00
Josh Stone 4740f18b01 Loosen the search for older libclang_rt.profile 2023-10-05 15:45:24 -07:00
Josh Stone 0b6ffb1d4a Update to 1.73.0.
Drop el7 conditionals from the spec.
2023-10-05 09:24:56 -07:00
Daniel P. Berrangé afbd2cf0c4 ensure rustfmt pulls in exact matching rust evr
/usr/bin/rustfmt is linking to an internal rust library and this
results in load errors if rustfmt and rust are at different evrs:

$ rustfmt
rustfmt: error while loading shared libraries: librustc_driver-69c69b1255476b63.so: cannot open shared object file: No such file or directory
$ rpm -q rust rustfmt
rust-1.72.0-1.fc38.x86_64
rustfmt-1.72.1-1.fc38.x86_64

Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
2023-10-04 10:50:58 +01:00
Josh Stone fbe7f8404b Switch to unbundled wasi-libc on Fedora
Also, use emmalloc instead of CC0 dlmalloc when bundling wasi-libc.
2023-09-29 14:56:44 -07:00
Josh Stone 938db5293e Fix the profiler runtime with compiler-rt-17 2023-09-27 12:05:39 -07:00
Josh Stone 68e85e4428 Simplify the target definitions 2023-09-27 12:05:39 -07:00
Josh Stone b2411fce72 Drop noarch from embedded x86_64 targets and use lld 2023-09-25 13:45:57 -07:00
Daniel P. Berrangé 9f66968c10 add 'x86_64-unknown-uefi' build target
This target will facilitate the use of Rust in the UEFI environment

Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
2023-09-25 11:36:55 -07:00
Daniel P. Berrangé 58662257c8 add 'x86_64-unknown-none' build target
The coconut-svsm project which provides a low level firmware for AMD
SEV-SNP virtual machines uses 'x86_64-unknown-none' as its build
target and has recently removed the requirement to use rust nightly[1].

Thus adding 'x86_64-unknown-none' as a build target will enable us to
build coconut-svsm in Fedora using the standard Rust toolchain packages.

[1] https://github.com/coconut-svsm/svsm/pull/81
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
2023-09-25 11:36:00 -07:00
Yaakov Selkowitz da52e5d316 Fix ELN build
ELN (RHEL 10) tracks rawhide and currently also has llvm-17.
2023-09-25 11:35:03 -07:00
Josh Stone b1db162b38 Update to 1.72.1.
Migrated to SPDX license
2023-09-19 10:09:40 -07:00
Josh Stone 0764fad18b Update to 1.72.0. 2023-08-24 11:15:39 -07:00
Josh Stone 1265039e13 Disable profiler_builtins for EPEL7
We don't have compiler-rt available there.
2023-08-07 16:39:57 -07:00
Josh Stone cd2d5f3610 Update to 1.71.1.
Security fix for CVE-2023-38497
2023-08-07 14:57:21 -07:00
Josh Stone 8cfe070190 Relax the suspicious_double_ref_op lint
Enable the profiler runtime for native hosts
2023-07-25 17:53:22 -07:00
Fedora Release Engineering 2f56a4c918 Rebuilt for https://fedoraproject.org/wiki/Fedora_39_Mass_Rebuild
Signed-off-by: Fedora Release Engineering <releng@fedoraproject.org>
2023-07-21 18:41:30 +00:00
Josh Stone 386b9914c9 Update to 1.71.0. 2023-07-17 09:24:25 -07:00
Josh Stone 356401c7f1 Override default target CPUs to match distro settings 2023-06-23 15:31:28 -07:00
40 changed files with 3165 additions and 1375 deletions

15
.gitignore vendored
View File

@ -420,3 +420,18 @@
/wasi-libc-1dfe5c302d1c5ab621f7abf04620fae92700fd22.tar.gz
/rustc-1.70.0-src.tar.xz
/wasi-libc-wasi-sdk-20.tar.gz
/rustc-1.71.0-src.tar.xz
/rustc-1.71.1-src.tar.xz
/rustc-1.72.0-src.tar.xz
/wasi-libc-7018e24d8fe248596819d2e884761676f3542a04.tar.gz
/rustc-1.72.1-src.tar.xz
/wasi-libc-bd950eb128bff337153de217b11270f948d04bb4.tar.gz
/rustc-1.73.0-src.tar.xz
/rustc-1.74.0-src.tar.xz
/rustc-1.74.1-src.tar.xz
/rustc-1.75.0-src.tar.xz
/rustc-1.76.0-src.tar.xz
/wasi-libc-03b228e46bb02fcc5927253e1b8ad715072b1ae4.tar.gz
/rustc-1.77.0-src.tar.xz
/rustc-1.77.2-src.tar.xz
/rustc-1.78.0-src.tar.xz

View File

@ -0,0 +1,59 @@
From 6dda4e006b0d6d7519ac4a9f540566c81e406a8b Mon Sep 17 00:00:00 2001
From: Josh Stone <jistone@redhat.com>
Date: Mon, 22 Apr 2024 16:19:17 -0700
Subject: [PATCH] Fix 2 tests for offline execution
In `alt_registry::warn_for_unused_fields`, the second part of the test
runs on `--registry crates-io`, so it needs a local replacement url.
In `install::install_global_cargo_config`, it was adding to the "config"
file, but the `pkg` before it configured the dummy registry replacement
in "config.toml". So that replacement wasn't actually used, and if you
ran tests online it was trying to install `bar v0.1.1` from the real
registry! The filename is now fixed, and the test double-checks that
we're only trying to install the local `bar v0.0.1`.
---
tests/testsuite/alt_registry.rs | 4 ++++
tests/testsuite/install.rs | 3 ++-
2 files changed, 6 insertions(+), 1 deletion(-)
diff --git a/tests/testsuite/alt_registry.rs b/tests/testsuite/alt_registry.rs
index e95f2cbaabbd..1fef04e3ae42 100644
--- a/tests/testsuite/alt_registry.rs
+++ b/tests/testsuite/alt_registry.rs
@@ -1572,7 +1572,11 @@ or use environment variable CARGO_REGISTRIES_ALTERNATIVE_TOKEN",
)
.run();
+ let crates_io = registry::RegistryBuilder::new()
+ .no_configure_token()
+ .build();
p.cargo("publish --registry crates-io")
+ .replace_crates_io(crates_io.index_url())
.with_status(101)
.with_stderr(
"\
diff --git a/tests/testsuite/install.rs b/tests/testsuite/install.rs
index 89d40ada9543..ef3f4f3ae604 100644
--- a/tests/testsuite/install.rs
+++ b/tests/testsuite/install.rs
@@ -1981,7 +1981,7 @@ fn install_ignores_unstable_table_in_local_cargo_config() {
fn install_global_cargo_config() {
pkg("bar", "0.0.1");
- let config = cargo_home().join("config");
+ let config = cargo_home().join("config.toml");
let mut toml = fs::read_to_string(&config).unwrap_or_default();
toml.push_str(
@@ -1994,6 +1994,7 @@ fn install_global_cargo_config() {
cargo_process("install bar")
.with_status(101)
+ .with_stderr_contains("[INSTALLING] bar v0.0.1")
.with_stderr_contains("[..]--target nonexistent[..]")
.run();
}
--
2.44.0

View File

@ -0,0 +1,49 @@
From f7b2e37f7232540d9f2b2dc6e33597fbb74f4f63 Mon Sep 17 00:00:00 2001
From: Josh Stone <jistone@redhat.com>
Date: Mon, 8 Apr 2024 15:04:44 -0700
Subject: [PATCH] Fix UI tests with dist-vendored dependencies
There is already a workaround in `compiletest` to deal with custom
`CARGO_HOME` using `-Zignore-directory-in-diagnostics-source-blocks={}`.
A similar need exists when dependencies come from the local `vendor`
directory, which distro builds often use, so now we ignore that too.
Also, `issue-21763.rs` was normalizing `hashbrown-` paths, presumably
expecting a version suffix, but the vendored path doesn't include the
version. Now that matches `[\\/]hashbrown` instead.
---
src/tools/compiletest/src/runtest.rs | 5 +++++
tests/ui/issues/issue-21763.rs | 2 +-
2 files changed, 6 insertions(+), 1 deletion(-)
diff --git a/src/tools/compiletest/src/runtest.rs b/src/tools/compiletest/src/runtest.rs
index bb8509fe4137..770496289e2e 100644
--- a/src/tools/compiletest/src/runtest.rs
+++ b/src/tools/compiletest/src/runtest.rs
@@ -2354,6 +2354,11 @@ fn make_compile_args(
"ignore-directory-in-diagnostics-source-blocks={}",
home::cargo_home().expect("failed to find cargo home").to_str().unwrap()
));
+ // Similarly, vendored sources shouldn't be shown when running from a dist tarball.
+ rustc.arg("-Z").arg(format!(
+ "ignore-directory-in-diagnostics-source-blocks={}",
+ self.config.find_rust_src_root().unwrap().join("vendor").display(),
+ ));
// Optionally prevent default --sysroot if specified in test compile-flags.
if !self.props.compile_flags.iter().any(|flag| flag.starts_with("--sysroot"))
diff --git a/tests/ui/issues/issue-21763.rs b/tests/ui/issues/issue-21763.rs
index a349253063c0..1d0a0705cbbd 100644
--- a/tests/ui/issues/issue-21763.rs
+++ b/tests/ui/issues/issue-21763.rs
@@ -1,6 +1,6 @@
// Regression test for HashMap only impl'ing Send/Sync if its contents do
-//@ normalize-stderr-test: "\S+hashbrown-\S+" -> "$$HASHBROWN_SRC_LOCATION"
+//@ normalize-stderr-test: "\S+[\\/]hashbrown\S+" -> "$$HASHBROWN_SRC_LOCATION"
use std::collections::HashMap;
use std::rc::Rc;
--
2.44.0

View File

@ -0,0 +1,53 @@
From 184d61d2c12aa2db01de9a14ccb2be0cfae5039b Mon Sep 17 00:00:00 2001
From: Josh Stone <jistone@redhat.com>
Date: Fri, 9 Jun 2023 15:23:08 -0700
Subject: [PATCH] Let environment variables override some default CPUs
---
.../src/spec/targets/powerpc64le_unknown_linux_gnu.rs | 2 +-
.../rustc_target/src/spec/targets/s390x_unknown_linux_gnu.rs | 2 +-
.../rustc_target/src/spec/targets/x86_64_unknown_linux_gnu.rs | 2 +-
3 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/compiler/rustc_target/src/spec/targets/powerpc64le_unknown_linux_gnu.rs b/compiler/rustc_target/src/spec/targets/powerpc64le_unknown_linux_gnu.rs
index 194c3170e683..9806ca78297c 100644
--- a/compiler/rustc_target/src/spec/targets/powerpc64le_unknown_linux_gnu.rs
+++ b/compiler/rustc_target/src/spec/targets/powerpc64le_unknown_linux_gnu.rs
@@ -2,7 +2,7 @@
pub fn target() -> Target {
let mut base = base::linux_gnu::opts();
- base.cpu = "ppc64le".into();
+ base.cpu = option_env!("RUSTC_TARGET_CPU_PPC64LE").unwrap_or("ppc64le").into();
base.add_pre_link_args(LinkerFlavor::Gnu(Cc::Yes, Lld::No), &["-m64"]);
base.max_atomic_width = Some(64);
base.stack_probes = StackProbeType::Inline;
diff --git a/compiler/rustc_target/src/spec/targets/s390x_unknown_linux_gnu.rs b/compiler/rustc_target/src/spec/targets/s390x_unknown_linux_gnu.rs
index 6fc410eb2235..c8f84edb9715 100644
--- a/compiler/rustc_target/src/spec/targets/s390x_unknown_linux_gnu.rs
+++ b/compiler/rustc_target/src/spec/targets/s390x_unknown_linux_gnu.rs
@@ -5,7 +5,7 @@ pub fn target() -> Target {
let mut base = base::linux_gnu::opts();
base.endian = Endian::Big;
// z10 is the oldest CPU supported by LLVM
- base.cpu = "z10".into();
+ base.cpu = option_env!("RUSTC_TARGET_CPU_S390X").unwrap_or("z10").into();
// FIXME: The ABI implementation in cabi_s390x.rs is for now hard-coded to assume the no-vector
// ABI. Pass the -vector feature string to LLVM to respect this assumption. On LLVM < 16, we
// also strip v128 from the data_layout below to match the older LLVM's expectation.
diff --git a/compiler/rustc_target/src/spec/targets/x86_64_unknown_linux_gnu.rs b/compiler/rustc_target/src/spec/targets/x86_64_unknown_linux_gnu.rs
index 80e267c163fa..8436a00e66d5 100644
--- a/compiler/rustc_target/src/spec/targets/x86_64_unknown_linux_gnu.rs
+++ b/compiler/rustc_target/src/spec/targets/x86_64_unknown_linux_gnu.rs
@@ -2,7 +2,7 @@
pub fn target() -> Target {
let mut base = base::linux_gnu::opts();
- base.cpu = "x86-64".into();
+ base.cpu = option_env!("RUSTC_TARGET_CPU_X86_64").unwrap_or("x86-64").into();
base.plt_by_default = false;
base.max_atomic_width = Some(64);
base.add_pre_link_args(LinkerFlavor::Gnu(Cc::Yes, Lld::No), &["-m64"]);
--
2.41.0

View File

@ -0,0 +1,79 @@
From 27593a7ad3796cf3afaf4145275ff20d5aff333f Mon Sep 17 00:00:00 2001
From: Josh Stone <jistone@redhat.com>
Date: Wed, 10 Apr 2024 17:25:10 -0700
Subject: [PATCH 1/2] Set the host library path in run-make v2
When the build is configured with `[rust] rpath = false`, we need to set
`LD_LIBRARY_PATH` (or equivalent) to what would have been the `RPATH`,
so the compiler can find its own libraries. The old `tools.mk` code has
this environment prefixed in the `$(BARE_RUSTC)` variable, so we just
need to wire up something similar for run-make v2.
This is now set while building each `rmake.rs` itself, as well as in the
`rust-make-support` helpers for `rustc` and `rustdoc` commands. This is
also available in a `set_host_rpath` function for manual commands, like
in the `compiler-builtins` test.
(cherry picked from commit 8a5409bbdbadb522f25e7e5e3d54b967cb5eee56)
---
src/tools/compiletest/src/runtest.rs | 6 ++++++
src/tools/run-make-support/src/lib.rs | 15 +++++++++++++++
2 files changed, 21 insertions(+)
diff --git a/src/tools/compiletest/src/runtest.rs b/src/tools/compiletest/src/runtest.rs
index 7be0571b1111..3c775ea0651c 100644
--- a/src/tools/compiletest/src/runtest.rs
+++ b/src/tools/compiletest/src/runtest.rs
@@ -3767,6 +3767,11 @@ fn run_rmake_v2_test(&self) {
debug!(?support_lib_deps);
debug!(?support_lib_deps_deps);
+ let mut host_dylib_env_paths = String::new();
+ host_dylib_env_paths.push_str(&cwd.join(&self.config.compile_lib_path).to_string_lossy());
+ host_dylib_env_paths.push(':');
+ host_dylib_env_paths.push_str(&env::var(dylib_env_var()).unwrap());
+
let res = self.cmd2procres(
Command::new(&self.config.rustc_path)
.arg("-o")
@@ -3787,6 +3792,7 @@ fn run_rmake_v2_test(&self) {
.env("RUSTC", cwd.join(&self.config.rustc_path))
.env("TMPDIR", &tmpdir)
.env("LD_LIB_PATH_ENVVAR", dylib_env_var())
+ .env(dylib_env_var(), &host_dylib_env_paths)
.env("HOST_RPATH_DIR", cwd.join(&self.config.compile_lib_path))
.env("TARGET_RPATH_DIR", cwd.join(&self.config.run_lib_path))
.env("LLVM_COMPONENTS", &self.config.llvm_components)
diff --git a/src/tools/run-make-support/src/lib.rs b/src/tools/run-make-support/src/lib.rs
index 674860f8413b..da3efd292b3f 100644
--- a/src/tools/run-make-support/src/lib.rs
+++ b/src/tools/run-make-support/src/lib.rs
@@ -11,6 +11,7 @@ pub fn out_dir() -> PathBuf {
fn setup_common_build_cmd() -> Command {
let rustc = env::var("RUSTC").unwrap();
let mut cmd = Command::new(rustc);
+ set_host_rpath(&mut cmd);
cmd.arg("--out-dir").arg(out_dir()).arg("-L").arg(out_dir());
cmd
}
@@ -157,3 +158,17 @@ pub fn run_fail(bin_name: &str) -> Output {
}
output
}
+
+/// Set the runtime library path as needed for running the host rustc/rustdoc/etc.
+pub fn set_host_rpath(cmd: &mut Command) {
+ let ld_lib_path_envvar = env::var("LD_LIB_PATH_ENVVAR").unwrap();
+ cmd.env(&ld_lib_path_envvar, {
+ let mut paths = vec![];
+ paths.push(PathBuf::from(env::var("TMPDIR").unwrap()));
+ paths.push(PathBuf::from(env::var("HOST_RPATH_DIR").unwrap()));
+ for p in env::split_paths(&env::var(&ld_lib_path_envvar).unwrap()) {
+ paths.push(p.to_path_buf());
+ }
+ env::join_paths(paths.iter()).unwrap()
+ });
+}
--
2.44.0

View File

@ -0,0 +1,232 @@
From 245fbeef49c2395471498d20e67f4edf4222c865 Mon Sep 17 00:00:00 2001
From: Josh Stone <cuviper@gmail.com>
Date: Tue, 16 Apr 2024 16:45:59 -0700
Subject: [PATCH] The `multiple_unsafe_ops_per_block` test needs `asm!`
---
tests/ui/multiple_unsafe_ops_per_block.rs | 1 +
tests/ui/multiple_unsafe_ops_per_block.stderr | 58 +++++++++----------
2 files changed, 30 insertions(+), 29 deletions(-)
diff --git a/tests/ui/multiple_unsafe_ops_per_block.rs b/tests/ui/multiple_unsafe_ops_per_block.rs
index 8afb4df20af4..6b8a103d4a94 100644
--- a/tests/ui/multiple_unsafe_ops_per_block.rs
+++ b/tests/ui/multiple_unsafe_ops_per_block.rs
@@ -1,3 +1,4 @@
+//@needs-asm-support
//@aux-build:proc_macros.rs
#![allow(unused)]
#![allow(deref_nullptr)]
diff --git a/tests/ui/multiple_unsafe_ops_per_block.stderr b/tests/ui/multiple_unsafe_ops_per_block.stderr
index cff85ae115e0..e732bde0707e 100644
--- a/tests/ui/multiple_unsafe_ops_per_block.stderr
+++ b/tests/ui/multiple_unsafe_ops_per_block.stderr
@@ -1,5 +1,5 @@
error: this `unsafe` block contains 2 unsafe operations, expected only one
- --> tests/ui/multiple_unsafe_ops_per_block.rs:36:5
+ --> tests/ui/multiple_unsafe_ops_per_block.rs:37:5
|
LL | / unsafe {
LL | | STATIC += 1;
@@ -8,12 +8,12 @@ LL | | }
| |_____^
|
note: modification of a mutable static occurs here
- --> tests/ui/multiple_unsafe_ops_per_block.rs:37:9
+ --> tests/ui/multiple_unsafe_ops_per_block.rs:38:9
|
LL | STATIC += 1;
| ^^^^^^^^^^^
note: unsafe function call occurs here
- --> tests/ui/multiple_unsafe_ops_per_block.rs:38:9
+ --> tests/ui/multiple_unsafe_ops_per_block.rs:39:9
|
LL | not_very_safe();
| ^^^^^^^^^^^^^^^
@@ -21,7 +21,7 @@ LL | not_very_safe();
= help: to override `-D warnings` add `#[allow(clippy::multiple_unsafe_ops_per_block)]`
error: this `unsafe` block contains 2 unsafe operations, expected only one
- --> tests/ui/multiple_unsafe_ops_per_block.rs:45:5
+ --> tests/ui/multiple_unsafe_ops_per_block.rs:46:5
|
LL | / unsafe {
LL | | drop(u.u);
@@ -30,18 +30,18 @@ LL | | }
| |_____^
|
note: union field access occurs here
- --> tests/ui/multiple_unsafe_ops_per_block.rs:46:14
+ --> tests/ui/multiple_unsafe_ops_per_block.rs:47:14
|
LL | drop(u.u);
| ^^^
note: raw pointer dereference occurs here
- --> tests/ui/multiple_unsafe_ops_per_block.rs:47:9
+ --> tests/ui/multiple_unsafe_ops_per_block.rs:48:9
|
LL | *raw_ptr();
| ^^^^^^^^^^
error: this `unsafe` block contains 3 unsafe operations, expected only one
- --> tests/ui/multiple_unsafe_ops_per_block.rs:52:5
+ --> tests/ui/multiple_unsafe_ops_per_block.rs:53:5
|
LL | / unsafe {
LL | | asm!("nop");
@@ -51,23 +51,23 @@ LL | | }
| |_____^
|
note: inline assembly used here
- --> tests/ui/multiple_unsafe_ops_per_block.rs:53:9
+ --> tests/ui/multiple_unsafe_ops_per_block.rs:54:9
|
LL | asm!("nop");
| ^^^^^^^^^^^
note: unsafe method call occurs here
- --> tests/ui/multiple_unsafe_ops_per_block.rs:54:9
+ --> tests/ui/multiple_unsafe_ops_per_block.rs:55:9
|
LL | sample.not_very_safe();
| ^^^^^^^^^^^^^^^^^^^^^^
note: modification of a mutable static occurs here
- --> tests/ui/multiple_unsafe_ops_per_block.rs:55:9
+ --> tests/ui/multiple_unsafe_ops_per_block.rs:56:9
|
LL | STATIC = 0;
| ^^^^^^^^^^
error: this `unsafe` block contains 6 unsafe operations, expected only one
- --> tests/ui/multiple_unsafe_ops_per_block.rs:61:5
+ --> tests/ui/multiple_unsafe_ops_per_block.rs:62:5
|
LL | / unsafe {
LL | | drop(u.u);
@@ -79,55 +79,55 @@ LL | | }
| |_____^
|
note: union field access occurs here
- --> tests/ui/multiple_unsafe_ops_per_block.rs:62:14
+ --> tests/ui/multiple_unsafe_ops_per_block.rs:63:14
|
LL | drop(u.u);
| ^^^
note: access of a mutable static occurs here
- --> tests/ui/multiple_unsafe_ops_per_block.rs:63:14
+ --> tests/ui/multiple_unsafe_ops_per_block.rs:64:14
|
LL | drop(STATIC);
| ^^^^^^
note: unsafe method call occurs here
- --> tests/ui/multiple_unsafe_ops_per_block.rs:64:9
+ --> tests/ui/multiple_unsafe_ops_per_block.rs:65:9
|
LL | sample.not_very_safe();
| ^^^^^^^^^^^^^^^^^^^^^^
note: unsafe function call occurs here
- --> tests/ui/multiple_unsafe_ops_per_block.rs:65:9
+ --> tests/ui/multiple_unsafe_ops_per_block.rs:66:9
|
LL | not_very_safe();
| ^^^^^^^^^^^^^^^
note: raw pointer dereference occurs here
- --> tests/ui/multiple_unsafe_ops_per_block.rs:66:9
+ --> tests/ui/multiple_unsafe_ops_per_block.rs:67:9
|
LL | *raw_ptr();
| ^^^^^^^^^^
note: inline assembly used here
- --> tests/ui/multiple_unsafe_ops_per_block.rs:67:9
+ --> tests/ui/multiple_unsafe_ops_per_block.rs:68:9
|
LL | asm!("nop");
| ^^^^^^^^^^^
error: this `unsafe` block contains 2 unsafe operations, expected only one
- --> tests/ui/multiple_unsafe_ops_per_block.rs:105:5
+ --> tests/ui/multiple_unsafe_ops_per_block.rs:106:5
|
LL | unsafe { char::from_u32_unchecked(*ptr.cast::<u32>()) }
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
note: unsafe function call occurs here
- --> tests/ui/multiple_unsafe_ops_per_block.rs:105:14
+ --> tests/ui/multiple_unsafe_ops_per_block.rs:106:14
|
LL | unsafe { char::from_u32_unchecked(*ptr.cast::<u32>()) }
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
note: raw pointer dereference occurs here
- --> tests/ui/multiple_unsafe_ops_per_block.rs:105:39
+ --> tests/ui/multiple_unsafe_ops_per_block.rs:106:39
|
LL | unsafe { char::from_u32_unchecked(*ptr.cast::<u32>()) }
| ^^^^^^^^^^^^^^^^^^
error: this `unsafe` block contains 2 unsafe operations, expected only one
- --> tests/ui/multiple_unsafe_ops_per_block.rs:123:5
+ --> tests/ui/multiple_unsafe_ops_per_block.rs:124:5
|
LL | / unsafe {
LL | | x();
@@ -136,18 +136,18 @@ LL | | }
| |_____^
|
note: unsafe function call occurs here
- --> tests/ui/multiple_unsafe_ops_per_block.rs:124:9
+ --> tests/ui/multiple_unsafe_ops_per_block.rs:125:9
|
LL | x();
| ^^^
note: unsafe function call occurs here
- --> tests/ui/multiple_unsafe_ops_per_block.rs:125:9
+ --> tests/ui/multiple_unsafe_ops_per_block.rs:126:9
|
LL | x();
| ^^^
error: this `unsafe` block contains 2 unsafe operations, expected only one
- --> tests/ui/multiple_unsafe_ops_per_block.rs:134:9
+ --> tests/ui/multiple_unsafe_ops_per_block.rs:135:9
|
LL | / unsafe {
LL | | T::X();
@@ -156,18 +156,18 @@ LL | | }
| |_________^
|
note: unsafe function call occurs here
- --> tests/ui/multiple_unsafe_ops_per_block.rs:135:13
+ --> tests/ui/multiple_unsafe_ops_per_block.rs:136:13
|
LL | T::X();
| ^^^^^^
note: unsafe function call occurs here
- --> tests/ui/multiple_unsafe_ops_per_block.rs:136:13
+ --> tests/ui/multiple_unsafe_ops_per_block.rs:137:13
|
LL | T::X();
| ^^^^^^
error: this `unsafe` block contains 2 unsafe operations, expected only one
- --> tests/ui/multiple_unsafe_ops_per_block.rs:144:5
+ --> tests/ui/multiple_unsafe_ops_per_block.rs:145:5
|
LL | / unsafe {
LL | | x.0();
@@ -176,12 +176,12 @@ LL | | }
| |_____^
|
note: unsafe function call occurs here
- --> tests/ui/multiple_unsafe_ops_per_block.rs:145:9
+ --> tests/ui/multiple_unsafe_ops_per_block.rs:146:9
|
LL | x.0();
| ^^^^^
note: unsafe function call occurs here
- --> tests/ui/multiple_unsafe_ops_per_block.rs:146:9
+ --> tests/ui/multiple_unsafe_ops_per_block.rs:147:9
|
LL | x.0();
| ^^^^^
--
2.44.0

View File

@ -0,0 +1,264 @@
From 706f06c39a9e08a4708a53722429d13ae4069c2f Mon Sep 17 00:00:00 2001
From: Josh Stone <jistone@redhat.com>
Date: Wed, 1 May 2024 15:25:26 -0700
Subject: [PATCH] Use an explicit x86-64 cpu in tests that are sensitive to it
There are a few tests that depend on some target features **not** being
enabled by default, and usually they are correct with the default x86-64
target CPU. However, in downstream builds we have modified the default
to fit our distros -- `x86-64-v2` in RHEL 9 and `x86-64-v3` in RHEL 10
-- and the latter especially trips tests that expect not to have AVX.
These cases are few enough that we can just set them back explicitly.
---
tests/assembly/simd-intrinsic-mask-reduce.rs | 1 +
tests/assembly/x86_64-floating-point-clamp.rs | 2 +-
.../codegen/target-feature-inline-closure.rs | 2 +-
tests/ui/asm/x86_64/target-feature-attr.rs | 1 +
.../ui/asm/x86_64/target-feature-attr.stderr | 8 +++---
.../const-eval/const_fn_target_feature.rs | 2 +-
.../rfc-2396-target_feature-11/safe-calls.rs | 1 +
.../safe-calls.stderr | 28 +++++++++----------
tests/ui/sse2.rs | 4 +--
9 files changed, 26 insertions(+), 23 deletions(-)
diff --git a/tests/assembly/simd-intrinsic-mask-reduce.rs b/tests/assembly/simd-intrinsic-mask-reduce.rs
index 763401755fad..0d77fc410511 100644
--- a/tests/assembly/simd-intrinsic-mask-reduce.rs
+++ b/tests/assembly/simd-intrinsic-mask-reduce.rs
@@ -1,6 +1,7 @@
// verify that simd mask reductions do not introduce additional bit shift operations
//@ revisions: x86 aarch64
//@ [x86] compile-flags: --target=x86_64-unknown-linux-gnu -C llvm-args=-x86-asm-syntax=intel
+//@ [x86] compile-flags: -C target-cpu=x86-64
//@ [x86] needs-llvm-components: x86
//@ [aarch64] compile-flags: --target=aarch64-unknown-linux-gnu
//@ [aarch64] needs-llvm-components: aarch64
diff --git a/tests/assembly/x86_64-floating-point-clamp.rs b/tests/assembly/x86_64-floating-point-clamp.rs
index 4a72a7f44fa0..b963aee35590 100644
--- a/tests/assembly/x86_64-floating-point-clamp.rs
+++ b/tests/assembly/x86_64-floating-point-clamp.rs
@@ -2,7 +2,7 @@
// so check to make sure that's what it's actually emitting.
//@ assembly-output: emit-asm
-//@ compile-flags: --crate-type=lib -O -C llvm-args=-x86-asm-syntax=intel
+//@ compile-flags: --crate-type=lib -O -C llvm-args=-x86-asm-syntax=intel -C target-cpu=x86-64
//@ only-x86_64
//@ ignore-sgx
diff --git a/tests/codegen/target-feature-inline-closure.rs b/tests/codegen/target-feature-inline-closure.rs
index 88bd413a8707..20bb4e66ff21 100644
--- a/tests/codegen/target-feature-inline-closure.rs
+++ b/tests/codegen/target-feature-inline-closure.rs
@@ -1,5 +1,5 @@
//@ only-x86_64
-//@ compile-flags: -Copt-level=3
+//@ compile-flags: -Copt-level=3 -Ctarget-cpu=x86-64
#![crate_type = "lib"]
#![feature(target_feature_11)]
diff --git a/tests/ui/asm/x86_64/target-feature-attr.rs b/tests/ui/asm/x86_64/target-feature-attr.rs
index 820be132ef79..51829be15065 100644
--- a/tests/ui/asm/x86_64/target-feature-attr.rs
+++ b/tests/ui/asm/x86_64/target-feature-attr.rs
@@ -1,4 +1,5 @@
//@ only-x86_64
+//@ compile-flags: -C target-cpu=x86-64
#![feature(avx512_target_feature)]
diff --git a/tests/ui/asm/x86_64/target-feature-attr.stderr b/tests/ui/asm/x86_64/target-feature-attr.stderr
index c852726ee7ff..1a9962732cfb 100644
--- a/tests/ui/asm/x86_64/target-feature-attr.stderr
+++ b/tests/ui/asm/x86_64/target-feature-attr.stderr
@@ -1,23 +1,23 @@
error: register class `ymm_reg` requires the `avx` target feature
- --> $DIR/target-feature-attr.rs:18:40
+ --> $DIR/target-feature-attr.rs:19:40
|
LL | asm!("vaddps {2:y}, {0:y}, {1:y}", in(ymm_reg) x, in(ymm_reg) y, lateout(ymm_reg) x);
| ^^^^^^^^^^^^^
error: register class `ymm_reg` requires the `avx` target feature
- --> $DIR/target-feature-attr.rs:18:55
+ --> $DIR/target-feature-attr.rs:19:55
|
LL | asm!("vaddps {2:y}, {0:y}, {1:y}", in(ymm_reg) x, in(ymm_reg) y, lateout(ymm_reg) x);
| ^^^^^^^^^^^^^
error: register class `ymm_reg` requires the `avx` target feature
- --> $DIR/target-feature-attr.rs:18:70
+ --> $DIR/target-feature-attr.rs:19:70
|
LL | asm!("vaddps {2:y}, {0:y}, {1:y}", in(ymm_reg) x, in(ymm_reg) y, lateout(ymm_reg) x);
| ^^^^^^^^^^^^^^^^^^
error: register class `kreg` requires at least one of the following target features: avx512bw, avx512f
- --> $DIR/target-feature-attr.rs:33:23
+ --> $DIR/target-feature-attr.rs:34:23
|
LL | asm!("/* {0} */", in(kreg) x);
| ^^^^^^^^^^
diff --git a/tests/ui/consts/const-eval/const_fn_target_feature.rs b/tests/ui/consts/const-eval/const_fn_target_feature.rs
index b56b68a57958..d0de9d8d7a34 100644
--- a/tests/ui/consts/const-eval/const_fn_target_feature.rs
+++ b/tests/ui/consts/const-eval/const_fn_target_feature.rs
@@ -1,5 +1,5 @@
//@ only-x86_64
-//@ compile-flags:-C target-feature=+ssse3
+//@ compile-flags: -C target-cpu=x86-64 -C target-feature=+ssse3
#![crate_type = "lib"]
diff --git a/tests/ui/rfcs/rfc-2396-target_feature-11/safe-calls.rs b/tests/ui/rfcs/rfc-2396-target_feature-11/safe-calls.rs
index c73b8d7e4d29..6fb0688008e6 100644
--- a/tests/ui/rfcs/rfc-2396-target_feature-11/safe-calls.rs
+++ b/tests/ui/rfcs/rfc-2396-target_feature-11/safe-calls.rs
@@ -1,4 +1,5 @@
//@ only-x86_64
+//@ compile-flags: -C target-cpu=x86-64
#![feature(target_feature_11)]
diff --git a/tests/ui/rfcs/rfc-2396-target_feature-11/safe-calls.stderr b/tests/ui/rfcs/rfc-2396-target_feature-11/safe-calls.stderr
index d9d7e297f8e9..fed3da6594cb 100644
--- a/tests/ui/rfcs/rfc-2396-target_feature-11/safe-calls.stderr
+++ b/tests/ui/rfcs/rfc-2396-target_feature-11/safe-calls.stderr
@@ -1,5 +1,5 @@
error[E0133]: call to function `sse2` with `#[target_feature]` is unsafe and requires unsafe function or block
- --> $DIR/safe-calls.rs:25:5
+ --> $DIR/safe-calls.rs:26:5
|
LL | sse2();
| ^^^^^^ call to function with `#[target_feature]`
@@ -8,7 +8,7 @@ LL | sse2();
= note: the sse2 target feature being enabled in the build configuration does not remove the requirement to list it in `#[target_feature]`
error[E0133]: call to function `avx_bmi2` with `#[target_feature]` is unsafe and requires unsafe function or block
- --> $DIR/safe-calls.rs:27:5
+ --> $DIR/safe-calls.rs:28:5
|
LL | avx_bmi2();
| ^^^^^^^^^^ call to function with `#[target_feature]`
@@ -16,7 +16,7 @@ LL | avx_bmi2();
= help: in order for the call to be safe, the context requires the following additional target features: avx and bmi2
error[E0133]: call to function `Quux::avx_bmi2` with `#[target_feature]` is unsafe and requires unsafe function or block
- --> $DIR/safe-calls.rs:29:5
+ --> $DIR/safe-calls.rs:30:5
|
LL | Quux.avx_bmi2();
| ^^^^^^^^^^^^^^^ call to function with `#[target_feature]`
@@ -24,7 +24,7 @@ LL | Quux.avx_bmi2();
= help: in order for the call to be safe, the context requires the following additional target features: avx and bmi2
error[E0133]: call to function `avx_bmi2` with `#[target_feature]` is unsafe and requires unsafe function or block
- --> $DIR/safe-calls.rs:35:5
+ --> $DIR/safe-calls.rs:36:5
|
LL | avx_bmi2();
| ^^^^^^^^^^ call to function with `#[target_feature]`
@@ -32,7 +32,7 @@ LL | avx_bmi2();
= help: in order for the call to be safe, the context requires the following additional target features: avx and bmi2
error[E0133]: call to function `Quux::avx_bmi2` with `#[target_feature]` is unsafe and requires unsafe function or block
- --> $DIR/safe-calls.rs:37:5
+ --> $DIR/safe-calls.rs:38:5
|
LL | Quux.avx_bmi2();
| ^^^^^^^^^^^^^^^ call to function with `#[target_feature]`
@@ -40,7 +40,7 @@ LL | Quux.avx_bmi2();
= help: in order for the call to be safe, the context requires the following additional target features: avx and bmi2
error[E0133]: call to function `sse2` with `#[target_feature]` is unsafe and requires unsafe function or block
- --> $DIR/safe-calls.rs:43:5
+ --> $DIR/safe-calls.rs:44:5
|
LL | sse2();
| ^^^^^^ call to function with `#[target_feature]`
@@ -49,7 +49,7 @@ LL | sse2();
= note: the sse2 target feature being enabled in the build configuration does not remove the requirement to list it in `#[target_feature]`
error[E0133]: call to function `avx_bmi2` with `#[target_feature]` is unsafe and requires unsafe function or block
- --> $DIR/safe-calls.rs:45:5
+ --> $DIR/safe-calls.rs:46:5
|
LL | avx_bmi2();
| ^^^^^^^^^^ call to function with `#[target_feature]`
@@ -57,7 +57,7 @@ LL | avx_bmi2();
= help: in order for the call to be safe, the context requires the following additional target feature: bmi2
error[E0133]: call to function `Quux::avx_bmi2` with `#[target_feature]` is unsafe and requires unsafe function or block
- --> $DIR/safe-calls.rs:47:5
+ --> $DIR/safe-calls.rs:48:5
|
LL | Quux.avx_bmi2();
| ^^^^^^^^^^^^^^^ call to function with `#[target_feature]`
@@ -65,7 +65,7 @@ LL | Quux.avx_bmi2();
= help: in order for the call to be safe, the context requires the following additional target feature: bmi2
error[E0133]: call to function `sse2` with `#[target_feature]` is unsafe and requires unsafe function or block
- --> $DIR/safe-calls.rs:54:5
+ --> $DIR/safe-calls.rs:55:5
|
LL | sse2();
| ^^^^^^ call to function with `#[target_feature]`
@@ -74,7 +74,7 @@ LL | sse2();
= note: the sse2 target feature being enabled in the build configuration does not remove the requirement to list it in `#[target_feature]`
error[E0133]: call to function `sse2` with `#[target_feature]` is unsafe and requires unsafe function or block
- --> $DIR/safe-calls.rs:58:15
+ --> $DIR/safe-calls.rs:59:15
|
LL | const _: () = sse2();
| ^^^^^^ call to function with `#[target_feature]`
@@ -83,7 +83,7 @@ LL | const _: () = sse2();
= note: the sse2 target feature being enabled in the build configuration does not remove the requirement to list it in `#[target_feature]`
error[E0133]: call to function `sse2_and_fxsr` with `#[target_feature]` is unsafe and requires unsafe function or block
- --> $DIR/safe-calls.rs:61:15
+ --> $DIR/safe-calls.rs:62:15
|
LL | const _: () = sse2_and_fxsr();
| ^^^^^^^^^^^^^^^ call to function with `#[target_feature]`
@@ -92,7 +92,7 @@ LL | const _: () = sse2_and_fxsr();
= note: the fxsr and sse2 target features being enabled in the build configuration does not remove the requirement to list them in `#[target_feature]`
error: call to function `sse2` with `#[target_feature]` is unsafe and requires unsafe block (error E0133)
- --> $DIR/safe-calls.rs:68:5
+ --> $DIR/safe-calls.rs:69:5
|
LL | sse2();
| ^^^^^^ call to function with `#[target_feature]`
@@ -101,12 +101,12 @@ LL | sse2();
= help: in order for the call to be safe, the context requires the following additional target feature: sse2
= note: the sse2 target feature being enabled in the build configuration does not remove the requirement to list it in `#[target_feature]`
note: an unsafe function restricts its caller, but its body is safe by default
- --> $DIR/safe-calls.rs:67:1
+ --> $DIR/safe-calls.rs:68:1
|
LL | unsafe fn needs_unsafe_block() {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
note: the lint level is defined here
- --> $DIR/safe-calls.rs:64:8
+ --> $DIR/safe-calls.rs:65:8
|
LL | #[deny(unsafe_op_in_unsafe_fn)]
| ^^^^^^^^^^^^^^^^^^^^^^
diff --git a/tests/ui/sse2.rs b/tests/ui/sse2.rs
index fa6d79713b4b..c203ca2716ff 100644
--- a/tests/ui/sse2.rs
+++ b/tests/ui/sse2.rs
@@ -20,6 +20,6 @@ fn main() {
"SSE2 was not detected as available on an x86 platform");
}
// check a negative case too -- allowed on x86, but not enabled by default
- assert!(cfg!(not(target_feature = "avx2")),
- "AVX2 shouldn't be detected as available by default on any platform");
+ assert!(cfg!(not(target_feature = "avx512f")),
+ "AVX512 shouldn't be detected as available by default on any platform");
}
--
2.44.0

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

@ -0,0 +1,65 @@
From 61b5cc96337da2121221dd1bcdb63fd36551d065 Mon Sep 17 00:00:00 2001
From: Josh Stone <jistone@redhat.com>
Date: Wed, 1 Nov 2023 15:21:15 -0700
Subject: [PATCH] Use lld provided by system
---
compiler/rustc_target/src/spec/base/wasm.rs | 3 +--
compiler/rustc_target/src/spec/targets/x86_64_unknown_none.rs | 2 +-
compiler/rustc_target/src/spec/targets/x86_64_unknown_uefi.rs | 1 +
3 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/compiler/rustc_target/src/spec/base/wasm.rs b/compiler/rustc_target/src/spec/base/wasm.rs
index 87ade9e58cf4..2ddff95febab 100644
--- a/compiler/rustc_target/src/spec/base/wasm.rs
+++ b/compiler/rustc_target/src/spec/base/wasm.rs
@@ -91,8 +91,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,
diff --git a/compiler/rustc_target/src/spec/targets/x86_64_unknown_none.rs b/compiler/rustc_target/src/spec/targets/x86_64_unknown_none.rs
index 9aa95a35f8e5..a9172f9441b7 100644
--- a/compiler/rustc_target/src/spec/targets/x86_64_unknown_none.rs
+++ b/compiler/rustc_target/src/spec/targets/x86_64_unknown_none.rs
@@ -17,7 +17,7 @@ pub fn target() -> Target {
static_position_independent_executables: true,
relro_level: RelroLevel::Full,
linker_flavor: LinkerFlavor::Gnu(Cc::No, Lld::Yes),
- linker: Some("rust-lld".into()),
+ linker: Some("lld".into()),
features:
"-mmx,-sse,-sse2,-sse3,-ssse3,-sse4.1,-sse4.2,-3dnow,-3dnowa,-avx,-avx2,+soft-float"
.into(),
diff --git a/compiler/rustc_target/src/spec/targets/x86_64_unknown_uefi.rs b/compiler/rustc_target/src/spec/targets/x86_64_unknown_uefi.rs
index 5abfb8162f70..13cb43bda1a4 100644
--- a/compiler/rustc_target/src/spec/targets/x86_64_unknown_uefi.rs
+++ b/compiler/rustc_target/src/spec/targets/x86_64_unknown_uefi.rs
@@ -16,6 +16,7 @@ pub fn target() -> Target {
base.plt_by_default = false;
base.max_atomic_width = Some(64);
base.entry_abi = Conv::X86_64Win64;
+ base.linker = Some("lld".into());
// We disable MMX and SSE for now, even though UEFI allows using them. Problem is, you have to
// enable these CPU features explicitly before their first use, otherwise their instructions
diff -Naur a/compiler/rustc_target/src/spec/targets/aarch64_unknown_none_softfloat.rs b/compiler/rustc_target/src/spec/targets/aarch64_unknown_none_softfloat.rs
--- a/compiler/rustc_target/src/spec/targets/aarch64_unknown_none_softfloat.rs 2024-03-17 12:03:00.000000000 -0700
+++ b/compiler/rustc_target/src/spec/targets/aarch64_unknown_none_softfloat.rs 2024-03-22 10:02:17.742806274 -0700
@@ -14,7 +14,7 @@
let opts = TargetOptions {
abi: "softfloat".into(),
linker_flavor: LinkerFlavor::Gnu(Cc::No, Lld::Yes),
- linker: Some("rust-lld".into()),
+ linker: Some("lld".into()),
features: "+v8a,+strict-align,-neon,-fp-armv8".into(),
relocation_model: RelocModel::Static,
disable_redzone: true,
--
2.41.0

View File

@ -0,0 +1,102 @@
From 2b99134e2884fa56bcab6d360885ec5421048e66 Mon Sep 17 00:00:00 2001
From: Josh Stone <jistone@redhat.com>
Date: Thu, 28 Sep 2023 18:14:28 -0700
Subject: [PATCH 1/2] bootstrap: allow disabling target self-contained
---
config.example.toml | 5 +++++
src/bootstrap/src/core/build_steps/compile.rs | 4 ++++
src/bootstrap/src/core/config/config.rs | 8 ++++++++
src/bootstrap/src/lib.rs | 5 +++++
4 files changed, 22 insertions(+)
diff --git a/config.example.toml b/config.example.toml
index f94553dd63f7..5ec969c80a37 100644
--- a/config.example.toml
+++ b/config.example.toml
@@ -869,6 +869,11 @@
# argument as the test binary.
#runner = <none> (string)
+# Copy libc and CRT objects into the target lib/self-contained/ directory.
+# Enabled by default on `musl`, `wasi`, and `windows-gnu` targets. Other
+# targets may ignore this setting if they have nothing to be contained.
+#self-contained = <platform-specific> (bool)
+
# =============================================================================
# Distribution options
#
diff --git a/src/bootstrap/src/core/build_steps/compile.rs b/src/bootstrap/src/core/build_steps/compile.rs
index e927b491c71e..69a80d01d6b9 100644
--- a/src/bootstrap/src/core/build_steps/compile.rs
+++ b/src/bootstrap/src/core/build_steps/compile.rs
@@ -356,6 +356,10 @@ fn copy_self_contained_objects(
compiler: &Compiler,
target: TargetSelection,
) -> Vec<(PathBuf, DependencyType)> {
+ if builder.self_contained(target) != Some(true) {
+ return vec![];
+ }
+
let libdir_self_contained = builder.sysroot_libdir(*compiler, target).join("self-contained");
t!(fs::create_dir_all(&libdir_self_contained));
let mut target_deps = vec![];
diff --git a/src/bootstrap/src/core/config/config.rs b/src/bootstrap/src/core/config/config.rs
index 3e1bc9a9acdd..5e24a9cc4f60 100644
--- a/src/bootstrap/src/core/config/config.rs
+++ b/src/bootstrap/src/core/config/config.rs
@@ -586,6 +586,7 @@ pub struct Target {
pub runner: Option<String>,
pub no_std: bool,
pub codegen_backends: Option<Vec<String>>,
+ pub self_contained: bool,
}
impl Target {
@@ -594,6 +595,9 @@ pub fn from_triple(triple: &str) -> Self {
if triple.contains("-none") || triple.contains("nvptx") || triple.contains("switch") {
target.no_std = true;
}
+ if triple.contains("-musl") || triple.contains("-wasi") || triple.contains("-windows-gnu") {
+ target.self_contained = true;
+ }
target
}
}
@@ -1150,6 +1154,7 @@ struct TomlTarget {
no_std: Option<bool> = "no-std",
codegen_backends: Option<Vec<String>> = "codegen-backends",
runner: Option<String> = "runner",
+ self_contained: Option<bool> = "self-contained",
}
}
@@ -1870,6 +1875,9 @@ fn get_table(option: &str) -> Result<TomlConfig, toml::de::Error> {
if let Some(s) = cfg.no_std {
target.no_std = s;
}
+ if let Some(s) = cfg.self_contained {
+ target.self_contained = s;
+ }
target.cc = cfg.cc.map(PathBuf::from);
target.cxx = cfg.cxx.map(PathBuf::from);
target.ar = cfg.ar.map(PathBuf::from);
diff --git a/src/bootstrap/src/lib.rs b/src/bootstrap/src/lib.rs
index 5ed6b357e20a..c23b21d65713 100644
--- a/src/bootstrap/src/lib.rs
+++ b/src/bootstrap/src/lib.rs
@@ -1348,6 +1348,11 @@ fn no_std(&self, target: TargetSelection) -> Option<bool> {
self.config.target_config.get(&target).map(|t| t.no_std)
}
+ /// Returns `true` if this is a self-contained `target`, if defined
+ fn self_contained(&self, target: TargetSelection) -> Option<bool> {
+ self.config.target_config.get(&target).map(|t| t.self_contained)
+ }
+
/// Returns `true` if the target will be tested using the `remote-test-client`
/// and `remote-test-server` binaries.
fn remote_tested(&self, target: TargetSelection) -> bool {
--
2.44.0

View File

@ -0,0 +1,198 @@
From e8fb8c36ca0de817b3d30f603d6d6b3c56e8b0be Mon Sep 17 00:00:00 2001
From: Josh Stone <jistone@redhat.com>
Date: Fri, 5 Apr 2024 15:07:58 -0700
Subject: [PATCH] bootstrap: move all of rustc's flags to `rustc_cargo`
This ensures that `RUSTFLAGS` will be consistent between all modes of
building the compiler, so they won't trigger a rebuild by cargo. This
kind of fix was started in #119414 just for LTO flags, but it's
applicable to all kinds of flags that might be configured.
---
src/bootstrap/src/core/build_steps/check.rs | 2 +-
src/bootstrap/src/core/build_steps/compile.rs | 107 +++++++++---------
src/bootstrap/src/core/build_steps/doc.rs | 2 +-
src/bootstrap/src/core/build_steps/test.rs | 2 +-
4 files changed, 59 insertions(+), 54 deletions(-)
diff --git a/src/bootstrap/src/core/build_steps/check.rs b/src/bootstrap/src/core/build_steps/check.rs
index 55180a82885b..37d91b14ca1b 100644
--- a/src/bootstrap/src/core/build_steps/check.rs
+++ b/src/bootstrap/src/core/build_steps/check.rs
@@ -296,7 +296,7 @@ fn run(self, builder: &Builder<'_>) {
cargo_subcommand(builder.kind),
);
- rustc_cargo(builder, &mut cargo, target, compiler.stage);
+ rustc_cargo(builder, &mut cargo, target, &compiler);
// For ./x.py clippy, don't run with --all-targets because
// linting tests and benchmarks can produce very noisy results
diff --git a/src/bootstrap/src/core/build_steps/compile.rs b/src/bootstrap/src/core/build_steps/compile.rs
index e03997181ee5..9420e40d6c2b 100644
--- a/src/bootstrap/src/core/build_steps/compile.rs
+++ b/src/bootstrap/src/core/build_steps/compile.rs
@@ -945,55 +945,10 @@ fn run(self, builder: &Builder<'_>) -> u32 {
"build",
);
- rustc_cargo(builder, &mut cargo, target, compiler.stage);
+ rustc_cargo(builder, &mut cargo, target, &compiler);
- if builder.config.rust_profile_use.is_some()
- && builder.config.rust_profile_generate.is_some()
- {
- panic!("Cannot use and generate PGO profiles at the same time");
- }
-
- // With LLD, we can use ICF (identical code folding) to reduce the executable size
- // of librustc_driver/rustc and to improve i-cache utilization.
- //
- // -Wl,[link options] doesn't work on MSVC. However, /OPT:ICF (technically /OPT:REF,ICF)
- // is already on by default in MSVC optimized builds, which is interpreted as --icf=all:
- // https://github.com/llvm/llvm-project/blob/3329cec2f79185bafd678f310fafadba2a8c76d2/lld/COFF/Driver.cpp#L1746
- // https://github.com/rust-lang/rust/blob/f22819bcce4abaff7d1246a56eec493418f9f4ee/compiler/rustc_codegen_ssa/src/back/linker.rs#L827
- if builder.config.lld_mode.is_used() && !compiler.host.is_msvc() {
- cargo.rustflag("-Clink-args=-Wl,--icf=all");
- }
-
- let is_collecting = if let Some(path) = &builder.config.rust_profile_generate {
- if compiler.stage == 1 {
- cargo.rustflag(&format!("-Cprofile-generate={path}"));
- // Apparently necessary to avoid overflowing the counters during
- // a Cargo build profile
- cargo.rustflag("-Cllvm-args=-vp-counters-per-site=4");
- true
- } else {
- false
- }
- } else if let Some(path) = &builder.config.rust_profile_use {
- if compiler.stage == 1 {
- cargo.rustflag(&format!("-Cprofile-use={path}"));
- if builder.is_verbose() {
- cargo.rustflag("-Cllvm-args=-pgo-warn-missing-function");
- }
- true
- } else {
- false
- }
- } else {
- false
- };
- if is_collecting {
- // Ensure paths to Rust sources are relative, not absolute.
- cargo.rustflag(&format!(
- "-Cllvm-args=-static-func-strip-dirname-prefix={}",
- builder.config.src.components().count()
- ));
- }
+ // NB: all RUSTFLAGS should be added to `rustc_cargo()` so they will be
+ // consistently applied by check/doc/test modes too.
for krate in &*self.crates {
cargo.arg("-p").arg(krate);
@@ -1044,7 +999,12 @@ fn run(self, builder: &Builder<'_>) -> u32 {
}
}
-pub fn rustc_cargo(builder: &Builder<'_>, cargo: &mut Cargo, target: TargetSelection, stage: u32) {
+pub fn rustc_cargo(
+ builder: &Builder<'_>,
+ cargo: &mut Cargo,
+ target: TargetSelection,
+ compiler: &Compiler,
+) {
cargo
.arg("--features")
.arg(builder.rustc_features(builder.kind, target))
@@ -1055,7 +1015,7 @@ pub fn rustc_cargo(builder: &Builder<'_>, cargo: &mut Cargo, target: TargetSelec
// We currently don't support cross-crate LTO in stage0. This also isn't hugely necessary
// and may just be a time sink.
- if stage != 0 {
+ if compiler.stage != 0 {
match builder.config.rust_lto {
RustcLto::Thin | RustcLto::Fat => {
// Since using LTO for optimizing dylibs is currently experimental,
@@ -1081,7 +1041,52 @@ pub fn rustc_cargo(builder: &Builder<'_>, cargo: &mut Cargo, target: TargetSelec
cargo.rustflag("-Clto=off");
}
- rustc_cargo_env(builder, cargo, target, stage);
+ // With LLD, we can use ICF (identical code folding) to reduce the executable size
+ // of librustc_driver/rustc and to improve i-cache utilization.
+ //
+ // -Wl,[link options] doesn't work on MSVC. However, /OPT:ICF (technically /OPT:REF,ICF)
+ // is already on by default in MSVC optimized builds, which is interpreted as --icf=all:
+ // https://github.com/llvm/llvm-project/blob/3329cec2f79185bafd678f310fafadba2a8c76d2/lld/COFF/Driver.cpp#L1746
+ // https://github.com/rust-lang/rust/blob/f22819bcce4abaff7d1246a56eec493418f9f4ee/compiler/rustc_codegen_ssa/src/back/linker.rs#L827
+ if builder.config.lld_mode.is_used() && !compiler.host.is_msvc() {
+ cargo.rustflag("-Clink-args=-Wl,--icf=all");
+ }
+
+ if builder.config.rust_profile_use.is_some() && builder.config.rust_profile_generate.is_some() {
+ panic!("Cannot use and generate PGO profiles at the same time");
+ }
+ let is_collecting = if let Some(path) = &builder.config.rust_profile_generate {
+ if compiler.stage == 1 {
+ cargo.rustflag(&format!("-Cprofile-generate={path}"));
+ // Apparently necessary to avoid overflowing the counters during
+ // a Cargo build profile
+ cargo.rustflag("-Cllvm-args=-vp-counters-per-site=4");
+ true
+ } else {
+ false
+ }
+ } else if let Some(path) = &builder.config.rust_profile_use {
+ if compiler.stage == 1 {
+ cargo.rustflag(&format!("-Cprofile-use={path}"));
+ if builder.is_verbose() {
+ cargo.rustflag("-Cllvm-args=-pgo-warn-missing-function");
+ }
+ true
+ } else {
+ false
+ }
+ } else {
+ false
+ };
+ if is_collecting {
+ // Ensure paths to Rust sources are relative, not absolute.
+ cargo.rustflag(&format!(
+ "-Cllvm-args=-static-func-strip-dirname-prefix={}",
+ builder.config.src.components().count()
+ ));
+ }
+
+ rustc_cargo_env(builder, cargo, target, compiler.stage);
}
pub fn rustc_cargo_env(
diff --git a/src/bootstrap/src/core/build_steps/doc.rs b/src/bootstrap/src/core/build_steps/doc.rs
index 51b5cdc05657..a22cbeacf016 100644
--- a/src/bootstrap/src/core/build_steps/doc.rs
+++ b/src/bootstrap/src/core/build_steps/doc.rs
@@ -804,7 +804,7 @@ fn run(self, builder: &Builder<'_>) {
// see https://github.com/rust-lang/rust/pull/122066#issuecomment-1983049222
// cargo.rustdocflag("--generate-link-to-definition");
- compile::rustc_cargo(builder, &mut cargo, target, compiler.stage);
+ compile::rustc_cargo(builder, &mut cargo, target, &compiler);
cargo.arg("-Zunstable-options");
cargo.arg("-Zskip-rustdoc-fingerprint");
diff --git a/src/bootstrap/src/core/build_steps/test.rs b/src/bootstrap/src/core/build_steps/test.rs
index bacf5f0d33ce..5277c38a4ad0 100644
--- a/src/bootstrap/src/core/build_steps/test.rs
+++ b/src/bootstrap/src/core/build_steps/test.rs
@@ -2671,7 +2671,7 @@ fn run(self, builder: &Builder<'_>) {
}
}
Mode::Rustc => {
- compile::rustc_cargo(builder, &mut cargo, target, compiler.stage);
+ compile::rustc_cargo(builder, &mut cargo, target, &compiler);
}
_ => panic!("can only test libraries"),
};
--
2.44.0

View File

@ -0,0 +1,27 @@
From f25809d2d33e1141d73487e55fe155f41762aef3 Mon Sep 17 00:00:00 2001
From: onur-ozkan <work@onurozkan.dev>
Date: Sun, 10 Mar 2024 09:16:24 +0300
Subject: [PATCH] fix `long-linker-command-lines` failure caused by
`rust.rpath=false`
Signed-off-by: onur-ozkan <work@onurozkan.dev>
---
tests/run-make/long-linker-command-lines/Makefile | 2 ++
1 file changed, 2 insertions(+)
diff --git a/tests/run-make/long-linker-command-lines/Makefile b/tests/run-make/long-linker-command-lines/Makefile
index f864ea74f4a9..b573038e344a 100644
--- a/tests/run-make/long-linker-command-lines/Makefile
+++ b/tests/run-make/long-linker-command-lines/Makefile
@@ -1,6 +1,8 @@
# ignore-cross-compile
include ../tools.mk
+export LD_LIBRARY_PATH := $(HOST_RPATH_DIR)
+
all:
$(RUSTC) foo.rs -g -O
RUSTC="$(RUSTC_ORIGINAL)" $(call RUN,foo)
--
2.44.0

View File

@ -0,0 +1,183 @@
From a70f23c50b61c1a3335f2943375a04ae7abf2fa4 Mon Sep 17 00:00:00 2001
From: Josh Stone <jistone@redhat.com>
Date: Thu, 11 Apr 2024 14:58:42 -0700
Subject: [PATCH] test: don't compress test registry crates
They are still nominally gzipped, but using `Compression::none()` makes
them consistent even across zlib and zlib-ng, and this fixes checksum
differences in the testsuite. There is a one-time update of all those
checksums to catch up with this change though.
---
crates/cargo-test-support/src/registry.rs | 2 +-
tests/testsuite/alt_registry.rs | 2 +-
.../cargo_add/locked_unchanged/in/Cargo.lock | 2 +-
.../cargo_add/lockfile_updated/in/Cargo.lock | 2 +-
.../cargo_add/lockfile_updated/out/Cargo.lock | 4 ++--
.../cargo_remove/update_lock_file/in/Cargo.lock | 16 ++++++++--------
.../cargo_remove/update_lock_file/out/Cargo.lock | 12 ++++++------
7 files changed, 20 insertions(+), 20 deletions(-)
diff --git a/crates/cargo-test-support/src/registry.rs b/crates/cargo-test-support/src/registry.rs
index e65baeab17d7..f8b4b1447822 100644
--- a/crates/cargo-test-support/src/registry.rs
+++ b/crates/cargo-test-support/src/registry.rs
@@ -1469,7 +1469,7 @@ impl Package {
let dst = self.archive_dst();
t!(fs::create_dir_all(dst.parent().unwrap()));
let f = t!(File::create(&dst));
- let mut a = Builder::new(GzEncoder::new(f, Compression::default()));
+ let mut a = Builder::new(GzEncoder::new(f, Compression::none()));
if !self
.files
diff --git a/tests/testsuite/alt_registry.rs b/tests/testsuite/alt_registry.rs
index e122199baa41..fb88105374a2 100644
--- a/tests/testsuite/alt_registry.rs
+++ b/tests/testsuite/alt_registry.rs
@@ -1493,7 +1493,7 @@ dependencies = [
name = "foo"
version = "0.1.0"
source = "sparse+http://[..]/"
-checksum = "f6a200a9339fef960979d94d5c99cbbfd899b6f5a396a55d9775089119050203""#,
+checksum = "458c1addb23fde7dfbca0410afdbcc0086f96197281ec304d9e0e10def3cb899""#,
);
}
diff --git a/tests/testsuite/cargo_add/locked_unchanged/in/Cargo.lock b/tests/testsuite/cargo_add/locked_unchanged/in/Cargo.lock
index 011b335926ee..b88709a9e9be 100644
--- a/tests/testsuite/cargo_add/locked_unchanged/in/Cargo.lock
+++ b/tests/testsuite/cargo_add/locked_unchanged/in/Cargo.lock
@@ -13,4 +13,4 @@ dependencies = [
name = "my-package"
version = "99999.0.0+my-package"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "62c45acf9e11d2f97f5b318143219c0b4102eafef1c22a4b545b47104691d915"
+checksum = "73cfa03cf28feb001362b377a837910c5a6ec1cc5cceaa562b97fc14d15edec8"
diff --git a/tests/testsuite/cargo_add/lockfile_updated/in/Cargo.lock b/tests/testsuite/cargo_add/lockfile_updated/in/Cargo.lock
index d9bcc988d3f2..d8fa962f3069 100644
--- a/tests/testsuite/cargo_add/lockfile_updated/in/Cargo.lock
+++ b/tests/testsuite/cargo_add/lockfile_updated/in/Cargo.lock
@@ -14,4 +14,4 @@ dependencies = [
name = "unrelateed-crate"
version = "0.2.0+my-package"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "266de4849a570b5dfda5e8e082a2aff885e9d2d4965dae8f8b6c8535e1ec731f"
+checksum = "b16af1a8ba7e4331ca62d945483a3028c2afbbe06a7f2ffaa0a3538ef0a7d63e"
diff --git a/tests/testsuite/cargo_add/lockfile_updated/out/Cargo.lock b/tests/testsuite/cargo_add/lockfile_updated/out/Cargo.lock
index 4b5fb465f104..e423b3d1f8b7 100644
--- a/tests/testsuite/cargo_add/lockfile_updated/out/Cargo.lock
+++ b/tests/testsuite/cargo_add/lockfile_updated/out/Cargo.lock
@@ -14,10 +14,10 @@ dependencies = [
name = "my-package"
version = "99999.0.0+my-package"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "62c45acf9e11d2f97f5b318143219c0b4102eafef1c22a4b545b47104691d915"
+checksum = "73cfa03cf28feb001362b377a837910c5a6ec1cc5cceaa562b97fc14d15edec8"
[[package]]
name = "unrelateed-crate"
version = "0.2.0+my-package"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "266de4849a570b5dfda5e8e082a2aff885e9d2d4965dae8f8b6c8535e1ec731f"
+checksum = "b16af1a8ba7e4331ca62d945483a3028c2afbbe06a7f2ffaa0a3538ef0a7d63e"
diff --git a/tests/testsuite/cargo_remove/update_lock_file/in/Cargo.lock b/tests/testsuite/cargo_remove/update_lock_file/in/Cargo.lock
index 2302220f2fb7..a4018e70eb47 100644
--- a/tests/testsuite/cargo_remove/update_lock_file/in/Cargo.lock
+++ b/tests/testsuite/cargo_remove/update_lock_file/in/Cargo.lock
@@ -19,40 +19,40 @@ dependencies = [
name = "clippy"
version = "0.4.1+my-package"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "47ced0eda54e9ddc6063f0e1d0164493cd16c84c6b6a0329a536967c44e205f7"
+checksum = "e95568c5ce98de9c470c1d9b387466f4d5efa9687d3af7998e7c9c1da5e399fb"
[[package]]
name = "docopt"
version = "0.6.2+my-package"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "b600540c4fafb27bf6e6961f0f1e6f547c9d6126ce581ab3a92f878c8e2c9a2c"
+checksum = "d4414d2705e6b42fe10772b4ab4e3260f362669e45606eb562dc4c0023e911f6"
[[package]]
name = "regex"
version = "0.1.1+my-package"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "84949cb53285a6c481d0133065a7b669871acfd9e20f273f4ce1283c309775d5"
+checksum = "bc4552a1d503f3a436bb18d1efff62eb95bd97f724d06466c55ef151ea2de9e0"
[[package]]
name = "rustc-serialize"
-version = "0.4.1+my-package"
+version = "0.4.0+my-package"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "31162e7d23a085553c42dee375787b451a481275473f7779c4a63bcc267a24fd"
+checksum = "48c3645ec42f69a343fbe9734a477ae59448192e779206dbcb1a9c3397563fd8"
[[package]]
name = "semver"
version = "0.1.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "106bee742e3199d9e59f4269e458dfc825c1b4648c483b1c2b7a45cd2610a308"
+checksum = "20070289360e74dcdc28f437b08dda0c0c861c2328d749bb0d6e1a428013af83"
[[package]]
name = "serde"
version = "1.0.90"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "be7d269f612a60e3c2c4a4a120e2d878a3f3298a5285eda6e95453905a107d9a"
+checksum = "ba76b226746eabf28375d5ad184926bbb9cd727425c8d027ea10f6c508895c6c"
[[package]]
name = "toml"
version = "0.1.1+my-package"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "a0f6c7804525ce0a968ef270e55a516cf4bdcf1fea0b09d130e0aa34a66745b3"
+checksum = "a9ea5fa6eaed7d7e6d9fb4571bb9d915b577e19bf2a95321ebb70fd3d894ce49"
diff --git a/tests/testsuite/cargo_remove/update_lock_file/out/Cargo.lock b/tests/testsuite/cargo_remove/update_lock_file/out/Cargo.lock
index 0946cee47717..af60414ddad2 100644
--- a/tests/testsuite/cargo_remove/update_lock_file/out/Cargo.lock
+++ b/tests/testsuite/cargo_remove/update_lock_file/out/Cargo.lock
@@ -18,34 +18,34 @@ dependencies = [
name = "clippy"
version = "0.4.1+my-package"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "47ced0eda54e9ddc6063f0e1d0164493cd16c84c6b6a0329a536967c44e205f7"
+checksum = "e95568c5ce98de9c470c1d9b387466f4d5efa9687d3af7998e7c9c1da5e399fb"
[[package]]
name = "docopt"
version = "0.6.2+my-package"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "b600540c4fafb27bf6e6961f0f1e6f547c9d6126ce581ab3a92f878c8e2c9a2c"
+checksum = "d4414d2705e6b42fe10772b4ab4e3260f362669e45606eb562dc4c0023e911f6"
[[package]]
name = "regex"
version = "0.1.1+my-package"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "84949cb53285a6c481d0133065a7b669871acfd9e20f273f4ce1283c309775d5"
+checksum = "bc4552a1d503f3a436bb18d1efff62eb95bd97f724d06466c55ef151ea2de9e0"
[[package]]
name = "semver"
version = "0.1.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "106bee742e3199d9e59f4269e458dfc825c1b4648c483b1c2b7a45cd2610a308"
+checksum = "20070289360e74dcdc28f437b08dda0c0c861c2328d749bb0d6e1a428013af83"
[[package]]
name = "serde"
version = "1.0.90"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "be7d269f612a60e3c2c4a4a120e2d878a3f3298a5285eda6e95453905a107d9a"
+checksum = "ba76b226746eabf28375d5ad184926bbb9cd727425c8d027ea10f6c508895c6c"
[[package]]
name = "toml"
version = "0.1.1+my-package"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "a0f6c7804525ce0a968ef270e55a516cf4bdcf1fea0b09d130e0aa34a66745b3"
+checksum = "a9ea5fa6eaed7d7e6d9fb4571bb9d915b577e19bf2a95321ebb70fd3d894ce49"
--
2.44.0

View File

@ -0,0 +1,63 @@
From 642e12326055268c7605b31e7f91edf8f58e54d4 Mon Sep 17 00:00:00 2001
From: Josh Stone <jistone@redhat.com>
Date: Thu, 11 Apr 2024 15:33:44 -0700
Subject: [PATCH 2/2] Use `env::split_paths`/`join_paths` in runtest
(cherry picked from commit 7e171c72cbddb0636fa8ce71a0e862486ae72625)
---
src/tools/compiletest/src/runtest.rs | 31 ++++++++++++++--------------
1 file changed, 15 insertions(+), 16 deletions(-)
diff --git a/src/tools/compiletest/src/runtest.rs b/src/tools/compiletest/src/runtest.rs
index 3c775ea0651c..852ffa0a62a8 100644
--- a/src/tools/compiletest/src/runtest.rs
+++ b/src/tools/compiletest/src/runtest.rs
@@ -3767,10 +3767,13 @@ fn run_rmake_v2_test(&self) {
debug!(?support_lib_deps);
debug!(?support_lib_deps_deps);
- let mut host_dylib_env_paths = String::new();
- host_dylib_env_paths.push_str(&cwd.join(&self.config.compile_lib_path).to_string_lossy());
- host_dylib_env_paths.push(':');
- host_dylib_env_paths.push_str(&env::var(dylib_env_var()).unwrap());
+ let orig_dylib_env_paths =
+ Vec::from_iter(env::split_paths(&env::var(dylib_env_var()).unwrap()));
+
+ let mut host_dylib_env_paths = Vec::new();
+ host_dylib_env_paths.push(cwd.join(&self.config.compile_lib_path));
+ host_dylib_env_paths.extend(orig_dylib_env_paths.iter().cloned());
+ let host_dylib_env_paths = env::join_paths(host_dylib_env_paths).unwrap();
let res = self.cmd2procres(
Command::new(&self.config.rustc_path)
@@ -3810,19 +3813,15 @@ fn run_rmake_v2_test(&self) {
// Finally, we need to run the recipe binary to build and run the actual tests.
debug!(?recipe_bin);
- let mut dylib_env_paths = String::new();
- dylib_env_paths.push_str(&env::var(dylib_env_var()).unwrap());
- dylib_env_paths.push(':');
- dylib_env_paths.push_str(&support_lib_path.parent().unwrap().to_string_lossy());
- dylib_env_paths.push(':');
- dylib_env_paths.push_str(
- &stage_std_path.join("rustlib").join(&self.config.host).join("lib").to_string_lossy(),
- );
+ let mut dylib_env_paths = orig_dylib_env_paths.clone();
+ dylib_env_paths.push(support_lib_path.parent().unwrap().to_path_buf());
+ dylib_env_paths.push(stage_std_path.join("rustlib").join(&self.config.host).join("lib"));
+ let dylib_env_paths = env::join_paths(dylib_env_paths).unwrap();
- let mut target_rpath_env_path = String::new();
- target_rpath_env_path.push_str(&tmpdir.to_string_lossy());
- target_rpath_env_path.push(':');
- target_rpath_env_path.push_str(&dylib_env_paths);
+ let mut target_rpath_env_path = Vec::new();
+ target_rpath_env_path.push(&tmpdir);
+ target_rpath_env_path.extend(&orig_dylib_env_paths);
+ let target_rpath_env_path = env::join_paths(target_rpath_env_path).unwrap();
let mut cmd = Command::new(&recipe_bin);
cmd.current_dir(&self.testpaths.file)
--
2.44.0

View File

@ -0,0 +1,97 @@
From e3b7d2e3d3b4fcbc6591de606957c0fd59b5e547 Mon Sep 17 00:00:00 2001
From: Josh Stone <jistone@redhat.com>
Date: Thu, 28 Sep 2023 18:18:16 -0700
Subject: [PATCH 2/2] set an external library path for wasm32-wasi
---
compiler/rustc_codegen_ssa/src/back/link.rs | 9 +++++++++
compiler/rustc_target/src/spec/mod.rs | 4 ++++
compiler/rustc_target/src/spec/targets/wasm32_wasip1.rs | 7 ++++---
3 files changed, 17 insertions(+), 3 deletions(-)
diff --git a/compiler/rustc_codegen_ssa/src/back/link.rs b/compiler/rustc_codegen_ssa/src/back/link.rs
index f5e8d5fc92a9..f4ad3f725427 100644
--- a/compiler/rustc_codegen_ssa/src/back/link.rs
+++ b/compiler/rustc_codegen_ssa/src/back/link.rs
@@ -1563,6 +1563,12 @@ fn get_object_file_path(sess: &Session, name: &str, self_contained: bool) -> Pat
return file_path;
}
}
+ if let Some(lib_path) = &sess.target.options.external_lib_path {
+ let file_path = Path::new(lib_path.as_ref()).join(name);
+ if file_path.exists() {
+ return file_path;
+ }
+ }
for search_path in fs.search_paths() {
let file_path = search_path.dir.join(name);
if file_path.exists() {
@@ -2049,6 +2055,9 @@ fn add_library_search_dirs(cmd: &mut dyn Linker, sess: &Session, self_contained:
let lib_path = sess.target_filesearch(PathKind::All).get_self_contained_lib_path();
cmd.include_path(&fix_windows_verbatim_for_gcc(&lib_path));
}
+ if let Some(lib_path) = &sess.target.options.external_lib_path {
+ cmd.include_path(Path::new(lib_path.as_ref()));
+ }
}
/// Add options making relocation sections in the produced ELF files read-only
diff --git a/compiler/rustc_target/src/spec/mod.rs b/compiler/rustc_target/src/spec/mod.rs
index 941d767b850d..cd0a2ce51989 100644
--- a/compiler/rustc_target/src/spec/mod.rs
+++ b/compiler/rustc_target/src/spec/mod.rs
@@ -1881,6 +1881,7 @@ pub struct TargetOptions {
/// Objects to link before and after all other object code.
pub pre_link_objects: CrtObjects,
pub post_link_objects: CrtObjects,
+ pub external_lib_path: Option<StaticCow<str>>,
/// Same as `(pre|post)_link_objects`, but when self-contained linking mode is enabled.
pub pre_link_objects_self_contained: CrtObjects,
pub post_link_objects_self_contained: CrtObjects,
@@ -2368,6 +2369,7 @@ fn default() -> TargetOptions {
relro_level: RelroLevel::None,
pre_link_objects: Default::default(),
post_link_objects: Default::default(),
+ external_lib_path: None,
pre_link_objects_self_contained: Default::default(),
post_link_objects_self_contained: Default::default(),
link_self_contained: LinkSelfContainedDefault::False,
@@ -3064,6 +3066,7 @@ macro_rules! key {
key!(linker_is_gnu_json = "linker-is-gnu", bool);
key!(pre_link_objects = "pre-link-objects", link_objects);
key!(post_link_objects = "post-link-objects", link_objects);
+ key!(external_lib_path, optional);
key!(pre_link_objects_self_contained = "pre-link-objects-fallback", link_objects);
key!(post_link_objects_self_contained = "post-link-objects-fallback", link_objects);
// Deserializes the backwards-compatible variants of `-Clink-self-contained`
@@ -3327,6 +3330,7 @@ macro_rules! target_option_val {
target_option_val!(linker_is_gnu_json, "linker-is-gnu");
target_option_val!(pre_link_objects);
target_option_val!(post_link_objects);
+ target_option_val!(external_lib_path);
target_option_val!(pre_link_objects_self_contained, "pre-link-objects-fallback");
target_option_val!(post_link_objects_self_contained, "post-link-objects-fallback");
target_option_val!(link_args - pre_link_args_json, "pre-link-args");
diff --git a/compiler/rustc_target/src/spec/targets/wasm32_wasip1.rs b/compiler/rustc_target/src/spec/targets/wasm32_wasip1.rs
index 7cbe9f09e6ca..b524890c2ec5 100644
--- a/compiler/rustc_target/src/spec/targets/wasm32_wasip1.rs
+++ b/compiler/rustc_target/src/spec/targets/wasm32_wasip1.rs
@@ -20,11 +20,12 @@ pub fn target() -> Target {
options.os = "wasi".into();
options.add_pre_link_args(LinkerFlavor::WasmLld(Cc::Yes), &["--target=wasm32-wasi"]);
- options.pre_link_objects_self_contained = crt_objects::pre_wasi_self_contained();
- options.post_link_objects_self_contained = crt_objects::post_wasi_self_contained();
+ options.pre_link_objects = crt_objects::pre_wasi_self_contained();
+ options.post_link_objects = crt_objects::post_wasi_self_contained();
// FIXME: Figure out cases in which WASM needs to link with a native toolchain.
- options.link_self_contained = LinkSelfContainedDefault::True;
+ options.link_self_contained = LinkSelfContainedDefault::False;
+ options.external_lib_path = Some("/usr/wasm32-wasi/lib/wasm32-wasi".into());
// Right now this is a bit of a workaround but we're currently saying that
// the target by default has a static crt which we're taking as a signal
--
2.44.0

2
cargo_vendor.attr Normal file
View File

@ -0,0 +1,2 @@
%__cargo_vendor_path ^%{_defaultlicensedir}(/[^/]+)+/cargo-vendor.txt$
%__cargo_vendor_provides %{_rpmconfigdir}/cargo_vendor.prov

127
cargo_vendor.prov Executable file
View File

@ -0,0 +1,127 @@
#! /usr/bin/python3 -s
# Stripped down replacement for cargo2rpm parse-vendor-manifest
import re
import subprocess
import sys
from typing import Optional
VERSION_REGEX = re.compile(
r"""
^
(?P<major>0|[1-9]\d*)
\.(?P<minor>0|[1-9]\d*)
\.(?P<patch>0|[1-9]\d*)
(?:-(?P<pre>(?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*)(?:\.(?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*))*))?
(?:\+(?P<build>[0-9a-zA-Z-]+(?:\.[0-9a-zA-Z-]+)*))?$
""",
re.VERBOSE,
)
class Version:
"""
Version that adheres to the "semantic versioning" format.
"""
def __init__(self, major: int, minor: int, patch: int, pre: Optional[str] = None, build: Optional[str] = None):
self.major: int = major
self.minor: int = minor
self.patch: int = patch
self.pre: Optional[str] = pre
self.build: Optional[str] = build
@staticmethod
def parse(version: str) -> "Version":
"""
Parses a version string and return a `Version` object.
Raises a `ValueError` if the string does not match the expected format.
"""
match = VERSION_REGEX.match(version)
if not match:
raise ValueError(f"Invalid version: {version!r}")
matches = match.groupdict()
major_str = matches["major"]
minor_str = matches["minor"]
patch_str = matches["patch"]
pre = matches["pre"]
build = matches["build"]
major = int(major_str)
minor = int(minor_str)
patch = int(patch_str)
return Version(major, minor, patch, pre, build)
def to_rpm(self) -> str:
"""
Formats the `Version` object as an equivalent RPM version string.
Characters that are invalid in RPM versions are replaced ("-" -> "_")
Build metadata (the optional `Version.build` attribute) is dropped, so
the conversion is not lossless for versions where this attribute is not
`None`. However, build metadata is not intended to be part of the
version (and is not even considered when doing version comparison), so
dropping it when converting to the RPM version format is correct.
"""
s = f"{self.major}.{self.minor}.{self.patch}"
if self.pre:
s += f"~{self.pre.replace('-', '_')}"
return s
def break_the_build(error: str):
"""
This function writes a string that is an invalid RPM dependency specifier,
which causes dependency generators to fail and break the build. The
additional error message is printed to stderr.
"""
print("*** FATAL ERROR ***")
print(error, file=sys.stderr)
def get_cargo_vendor_txt_paths_from_stdin() -> set[str]: # pragma nocover
"""
Read lines from standard input and filter out lines that look like paths
to `cargo-vendor.txt` files. This is how RPM generators pass lists of files.
"""
lines = {line.rstrip("\n") for line in sys.stdin.readlines()}
return {line for line in lines if line.endswith("/cargo-vendor.txt")}
def action_parse_vendor_manifest():
paths = get_cargo_vendor_txt_paths_from_stdin()
for path in paths:
with open(path) as file:
manifest = file.read()
for line in manifest.strip().splitlines():
crate, version = line.split(" v")
print(f"bundled(crate({crate})) = {Version.parse(version).to_rpm()}")
def main():
try:
action_parse_vendor_manifest()
exit(0)
# print an error message that is not a valid RPM dependency
# to cause the generator to break the build
except (IOError, ValueError) as exc:
break_the_build(str(exc))
exit(1)
break_the_build("Uncaught exception: This should not happen, please report a bug.")
exit(1)
if __name__ == "__main__":
main()

607
changelog Normal file
View File

@ -0,0 +1,607 @@
* Fri Apr 05 2024 Josh Stone <jistone@redhat.com> - 1.77.0-3
- Ensure more consistency in PGO flags -- fixes Cargo tests
* Thu Mar 21 2024 Davide Cavalca <dcavalca@fedoraproject.org> - 1.77.0-2
- Add build target for aarch64-unknown-none-softfloat
* Thu Mar 21 2024 Nikita Popov <npopov@redhat.com> - 1.77.0-1
- Update to 1.77.0
* Thu Feb 08 2024 Josh Stone <jistone@redhat.com> - 1.76.0-1
- Update to 1.76.0.
* Tue Jan 30 2024 Josh Stone <jistone@redhat.com> - 1.75.0-3
- Consolidate 32-bit build compromises.
- Update rust-toolset and add rust-srpm-macros for ELN.
* Fri Jan 26 2024 Fedora Release Engineering <releng@fedoraproject.org> - 1.75.0-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_40_Mass_Rebuild
* Sun Dec 31 2023 Josh Stone <jistone@redhat.com> - 1.75.0-1
- Update to 1.75.0.
* Thu Dec 07 2023 Josh Stone <jistone@redhat.com> - 1.74.1-1
- Update to 1.74.1.
* Thu Nov 16 2023 Josh Stone <jistone@redhat.com> - 1.74.0-1
- Update to 1.74.0.
* Thu Oct 26 2023 Josh Stone <jistone@redhat.com> - 1.73.0-2
- Use thin-LTO and PGO for rustc itself.
* Thu Oct 05 2023 Josh Stone <jistone@redhat.com> - 1.73.0-1
- Update to 1.73.0.
- Drop el7 conditionals from the spec.
* Fri Sep 29 2023 Josh Stone <jistone@redhat.com> - 1.72.1-3
- Fix the profiler runtime with compiler-rt-17
- Switch to unbundled wasi-libc on Fedora
- Use emmalloc instead of CC0 dlmalloc when bundling wasi-libc
* Mon Sep 25 2023 Josh Stone <jistone@redhat.com> - 1.72.1-2
- Fix LLVM dependency for ELN
- Add build target for x86_64-unknown-none
- Add build target for x86_64-unknown-uefi
* Tue Sep 19 2023 Josh Stone <jistone@redhat.com> - 1.72.1-1
- Update to 1.72.1.
- Migrated to SPDX license
* Thu Aug 24 2023 Josh Stone <jistone@redhat.com> - 1.72.0-1
- Update to 1.72.0.
* Mon Aug 07 2023 Josh Stone <jistone@redhat.com> - 1.71.1-1
- Update to 1.71.1.
- Security fix for CVE-2023-38497
* Tue Jul 25 2023 Josh Stone <jistone@redhat.com> - 1.71.0-3
- Relax the suspicious_double_ref_op lint
- Enable the profiler runtime for native hosts
* Fri Jul 21 2023 Fedora Release Engineering <releng@fedoraproject.org> - 1.71.0-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_39_Mass_Rebuild
* Mon Jul 17 2023 Josh Stone <jistone@redhat.com> - 1.71.0-1
- Update to 1.71.0.
* Fri Jun 23 2023 Josh Stone <jistone@redhat.com> - 1.70.0-2
- Override default target CPUs to match distro settings
* Thu Jun 01 2023 Josh Stone <jistone@redhat.com> - 1.70.0-1
- Update to 1.70.0.
* Fri May 05 2023 Josh Stone <jistone@redhat.com> - 1.69.0-3
- Fix debuginfo with LLVM 16
* Mon May 01 2023 Josh Stone <jistone@redhat.com> - 1.69.0-2
- Build with LLVM 15 on Fedora 38+
* Thu Apr 20 2023 Josh Stone <jistone@redhat.com> - 1.69.0-1
- Update to 1.69.0.
- Obsolete rust-analysis.
* Tue Mar 28 2023 Josh Stone <jistone@redhat.com> - 1.68.2-1
- Update to 1.68.2.
* Thu Mar 23 2023 Josh Stone <jistone@redhat.com> - 1.68.1-1
- Update to 1.68.1.
* Thu Mar 09 2023 Josh Stone <jistone@redhat.com> - 1.68.0-1
- Update to 1.68.0.
* Tue Mar 07 2023 David Michael <fedora.dm0@gmail.com> - 1.67.1-3
- Add a virtual Provides to rust-std-static containing the target triple.
* Mon Feb 20 2023 Orion Poplawski <orion@nwra.com> - 1.67.1-2
- Ship rust-toolset for EPEL7
* Thu Feb 09 2023 Josh Stone <jistone@redhat.com> - 1.67.1-1
- Update to 1.67.1.
* Fri Feb 03 2023 Josh Stone <jistone@redhat.com> - 1.67.0-3
- Unbundle libgit2 on Fedora 38.
* Fri Jan 27 2023 Adam Williamson <awilliam@redhat.com> - 1.67.0-2
- Backport PR #107360 to fix build of mesa
- Backport 675fa0b3 to fix bootstrapping failure
* Thu Jan 26 2023 Josh Stone <jistone@redhat.com> - 1.67.0-1
- Update to 1.67.0.
* Fri Jan 20 2023 Fedora Release Engineering <releng@fedoraproject.org> - 1.66.1-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_38_Mass_Rebuild
* Tue Jan 10 2023 Josh Stone <jistone@redhat.com> - 1.66.1-1
- Update to 1.66.1.
- Security fix for CVE-2022-46176
* Thu Dec 15 2022 Josh Stone <jistone@redhat.com> - 1.66.0-1
- Update to 1.66.0.
* Thu Nov 03 2022 Josh Stone <jistone@redhat.com> - 1.65.0-1
- Update to 1.65.0.
- rust-analyzer now obsoletes rls.
* Thu Sep 22 2022 Josh Stone <jistone@redhat.com> - 1.64.0-1
- Update to 1.64.0.
- Add rust-analyzer.
* Thu Aug 11 2022 Josh Stone <jistone@redhat.com> - 1.63.0-1
- Update to 1.63.0.
* Sat Jul 23 2022 Fedora Release Engineering <releng@fedoraproject.org> - 1.62.1-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_37_Mass_Rebuild
* Tue Jul 19 2022 Josh Stone <jistone@redhat.com> - 1.62.1-1
- Update to 1.62.1.
* Wed Jul 13 2022 Josh Stone <jistone@redhat.com> - 1.62.0-2
- Prevent unsound coercions from functions with opaque return types.
* Thu Jun 30 2022 Josh Stone <jistone@redhat.com> - 1.62.0-1
- Update to 1.62.0.
* Mon May 23 2022 Josh Stone <jistone@redhat.com> - 1.61.0-2
- Add missing target_feature to the list of well known cfg names
* Thu May 19 2022 Josh Stone <jistone@redhat.com> - 1.61.0-1
- Update to 1.61.0.
- Add rust-toolset for ELN.
* Thu Apr 07 2022 Josh Stone <jistone@redhat.com> - 1.60.0-1
- Update to 1.60.0.
* Fri Mar 25 2022 Josh Stone <jistone@redhat.com> - 1.59.0-4
- Fix the archive index for wasm32-wasi's libc.a
* Fri Mar 04 2022 Stephen Gallagher <sgallagh@redhat.com> - 1.59.0-3
- Rebuild against the bootstrapped build
* Fri Mar 04 2022 Stephen Gallagher <sgallagh@redhat.com> - 1.59.0-2.1
- Bootstrapping for Fedora ELN
* Tue Mar 01 2022 Josh Stone <jistone@redhat.com> - 1.59.0-2
- Fix s390x hangs, rhbz#2058803
* Thu Feb 24 2022 Josh Stone <jistone@redhat.com> - 1.59.0-1
- Update to 1.59.0.
- Revert to libgit2 1.3.x
* Sun Feb 20 2022 Igor Raits <igor.raits@gmail.com> - 1.58.1-2
- Rebuild for libgit2 1.4.x
* Thu Jan 20 2022 Josh Stone <jistone@redhat.com> - 1.58.1-1
- Update to 1.58.1.
* Thu Jan 13 2022 Josh Stone <jistone@redhat.com> - 1.58.0-1
- Update to 1.58.0.
* Wed Jan 05 2022 Josh Stone <jistone@redhat.com> - 1.57.0-2
- Add rust-std-static-i686-pc-windows-gnu
- Add rust-std-static-x86_64-pc-windows-gnu
* Thu Dec 02 2021 Josh Stone <jistone@redhat.com> - 1.57.0-1
- Update to 1.57.0, fixes rhbz#2028675.
- Backport rust#91070, fixes rhbz#1990657
- Add rust-std-static-wasm32-wasi
* Sun Nov 28 2021 Igor Raits <ignatenkobrain@fedoraproject.org> - 1.56.1-3
- De-bootstrap (libgit2)
* Sun Nov 28 2021 Igor Raits <ignatenkobrain@fedoraproject.org> - 1.56.1-2
- Rebuild for libgit2 1.3.x
* Mon Nov 01 2021 Josh Stone <jistone@redhat.com> - 1.56.1-1
- Update to 1.56.1.
* Thu Oct 21 2021 Josh Stone <jistone@redhat.com> - 1.56.0-1
- Update to 1.56.0.
* Tue Sep 14 2021 Sahana Prasad <sahana@redhat.com> - 1.55.0-2
- Rebuilt with OpenSSL 3.0.0
* Thu Sep 09 2021 Josh Stone <jistone@redhat.com> - 1.55.0-1
- Update to 1.55.0.
- Use llvm-ranlib for wasm rlibs; Fixes rhbz#2002612
* Tue Aug 24 2021 Josh Stone <jistone@redhat.com> - 1.54.0-2
- Build with LLVM 12 on Fedora 35+
* Thu Jul 29 2021 Josh Stone <jistone@redhat.com> - 1.54.0-1
- Update to 1.54.0.
* Fri Jul 23 2021 Fedora Release Engineering <releng@fedoraproject.org> - 1.53.0-3
- Rebuilt for https://fedoraproject.org/wiki/Fedora_35_Mass_Rebuild
* Thu Jul 08 2021 Josh Stone <jistone@redhat.com> - 1.53.0-2
- Exclude wasm on s390x for lack of lld
* Thu Jun 17 2021 Josh Stone <jistone@redhat.com> - 1.53.0-1
- Update to 1.53.0.
* Wed Jun 02 2021 Josh Stone <jistone@redhat.com> - 1.52.1-2
- Set rust.codegen-units-std=1 for all targets again.
- Add rust-std-static-wasm32-unknown-unknown.
- Rebuild f34 with LLVM 12.
* Mon May 10 2021 Josh Stone <jistone@redhat.com> - 1.52.1-1
- Update to 1.52.1.
* Thu May 06 2021 Josh Stone <jistone@redhat.com> - 1.52.0-1
- Update to 1.52.0.
* Fri Apr 16 2021 Josh Stone <jistone@redhat.com> - 1.51.0-3
- Security fixes for CVE-2020-36323, CVE-2021-31162
* Wed Apr 14 2021 Josh Stone <jistone@redhat.com> - 1.51.0-2
- Security fixes for CVE-2021-28876, CVE-2021-28878, CVE-2021-28879
- Fix bootstrap for stage0 rust 1.51
* Thu Mar 25 2021 Josh Stone <jistone@redhat.com> - 1.51.0-1
- Update to 1.51.0.
* Thu Feb 11 2021 Josh Stone <jistone@redhat.com> - 1.50.0-1
- Update to 1.50.0.
* Wed Jan 27 2021 Fedora Release Engineering <releng@fedoraproject.org> - 1.49.0-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_34_Mass_Rebuild
* Tue Jan 05 2021 Josh Stone <jistone@redhat.com> - 1.49.0-1
- Update to 1.49.0.
* Tue Dec 29 2020 Igor Raits <ignatenkobrain@fedoraproject.org> - 1.48.0-3
- De-bootstrap
* Mon Dec 28 2020 Igor Raits <ignatenkobrain@fedoraproject.org> - 1.48.0-2
- Rebuild for libgit2 1.1.x
* Thu Nov 19 2020 Josh Stone <jistone@redhat.com> - 1.48.0-1
- Update to 1.48.0.
* Sat Oct 10 2020 Jeff Law <law@redhat.com> - 1.47.0-2
- Re-enable LTO
* Thu Oct 08 2020 Josh Stone <jistone@redhat.com> - 1.47.0-1
- Update to 1.47.0.
* Fri Aug 28 2020 Fabio Valentini <decathorpe@gmail.com> - 1.46.0-2
- Fix LTO with doctests (backported cargo PR#8657).
* Thu Aug 27 2020 Josh Stone <jistone@redhat.com> - 1.46.0-1
- Update to 1.46.0.
* Mon Aug 03 2020 Josh Stone <jistone@redhat.com> - 1.45.2-1
- Update to 1.45.2.
* Thu Jul 30 2020 Josh Stone <jistone@redhat.com> - 1.45.1-1
- Update to 1.45.1.
* Wed Jul 29 2020 Fedora Release Engineering <releng@fedoraproject.org> - 1.45.0-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_33_Mass_Rebuild
* Thu Jul 16 2020 Josh Stone <jistone@redhat.com> - 1.45.0-1
- Update to 1.45.0.
* Wed Jul 01 2020 Jeff Law <law@redhat.com> - 1.44.1-2
- Disable LTO
* Thu Jun 18 2020 Josh Stone <jistone@redhat.com> - 1.44.1-1
- Update to 1.44.1.
* Thu Jun 04 2020 Josh Stone <jistone@redhat.com> - 1.44.0-1
- Update to 1.44.0.
* Thu May 07 2020 Josh Stone <jistone@redhat.com> - 1.43.1-1
- Update to 1.43.1.
* Thu Apr 23 2020 Josh Stone <jistone@redhat.com> - 1.43.0-1
- Update to 1.43.0.
* Thu Mar 12 2020 Josh Stone <jistone@redhat.com> - 1.42.0-1
- Update to 1.42.0.
* Thu Feb 27 2020 Josh Stone <jistone@redhat.com> - 1.41.1-1
- Update to 1.41.1.
* Thu Feb 20 2020 Josh Stone <jistone@redhat.com> - 1.41.0-2
- Rebuild with llvm9.0
* Thu Jan 30 2020 Josh Stone <jistone@redhat.com> - 1.41.0-1
- Update to 1.41.0.
* Thu Jan 16 2020 Josh Stone <jistone@redhat.com> - 1.40.0-3
- Build compiletest with in-tree libtest
* Tue Jan 07 2020 Josh Stone <jistone@redhat.com> - 1.40.0-2
- Fix compiletest with newer (local-rebuild) libtest
- Fix ARM EHABI unwinding
* Thu Dec 19 2019 Josh Stone <jistone@redhat.com> - 1.40.0-1
- Update to 1.40.0.
* Tue Nov 12 2019 Josh Stone <jistone@redhat.com> - 1.39.0-2
- Fix a couple build and test issues with rustdoc.
* Thu Nov 07 2019 Josh Stone <jistone@redhat.com> - 1.39.0-1
- Update to 1.39.0.
* Fri Sep 27 2019 Josh Stone <jistone@redhat.com> - 1.38.0-2
- Filter the libraries included in rust-std (rhbz1756487)
* Thu Sep 26 2019 Josh Stone <jistone@redhat.com> - 1.38.0-1
- Update to 1.38.0.
* Thu Aug 15 2019 Josh Stone <jistone@redhat.com> - 1.37.0-1
- Update to 1.37.0.
* Fri Jul 26 2019 Fedora Release Engineering <releng@fedoraproject.org> - 1.36.0-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_31_Mass_Rebuild
* Thu Jul 04 2019 Josh Stone <jistone@redhat.com> - 1.36.0-1
- Update to 1.36.0.
* Wed May 29 2019 Josh Stone <jistone@redhat.com> - 1.35.0-2
- Fix compiletest for rebuild testing.
* Thu May 23 2019 Josh Stone <jistone@redhat.com> - 1.35.0-1
- Update to 1.35.0.
* Tue May 14 2019 Josh Stone <jistone@redhat.com> - 1.34.2-1
- Update to 1.34.2 -- fixes CVE-2019-12083.
* Tue Apr 30 2019 Josh Stone <jistone@redhat.com> - 1.34.1-3
- Set rust.codegen-units-std=1
* Fri Apr 26 2019 Josh Stone <jistone@redhat.com> - 1.34.1-2
- Remove the ThinLTO workaround.
* Thu Apr 25 2019 Josh Stone <jistone@redhat.com> - 1.34.1-1
- Update to 1.34.1.
- Add a ThinLTO fix for rhbz1701339.
* Thu Apr 11 2019 Josh Stone <jistone@redhat.com> - 1.34.0-1
- Update to 1.34.0.
* Fri Mar 01 2019 Josh Stone <jistone@redhat.com> - 1.33.0-2
- Fix deprecations for self-rebuild
* Thu Feb 28 2019 Josh Stone <jistone@redhat.com> - 1.33.0-1
- Update to 1.33.0.
* Sat Feb 02 2019 Fedora Release Engineering <releng@fedoraproject.org> - 1.32.0-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_30_Mass_Rebuild
* Thu Jan 17 2019 Josh Stone <jistone@redhat.com> - 1.32.0-1
- Update to 1.32.0.
* Mon Jan 07 2019 Josh Stone <jistone@redhat.com> - 1.31.1-9
- Update to 1.31.1 for RLS fixes.
* Thu Dec 06 2018 Josh Stone <jistone@redhat.com> - 1.31.0-8
- Update to 1.31.0 -- Rust 2018!
- clippy/rls/rustfmt are no longer -preview
* Thu Nov 08 2018 Josh Stone <jistone@redhat.com> - 1.30.1-7
- Update to 1.30.1.
* Thu Oct 25 2018 Josh Stone <jistone@redhat.com> - 1.30.0-6
- Update to 1.30.0.
* Mon Oct 22 2018 Josh Stone <jistone@redhat.com> - 1.29.2-5
- Rebuild without bootstrap binaries.
* Sat Oct 20 2018 Josh Stone <jistone@redhat.com> - 1.29.2-4
- Re-bootstrap armv7hl due to rhbz#1639485
* Fri Oct 12 2018 Josh Stone <jistone@redhat.com> - 1.29.2-3
- Update to 1.29.2.
* Tue Sep 25 2018 Josh Stone <jistone@redhat.com> - 1.29.1-2
- Update to 1.29.1.
- Security fix for str::repeat (pending CVE).
* Thu Sep 13 2018 Josh Stone <jistone@redhat.com> - 1.29.0-1
- Update to 1.29.0.
- Add a clippy-preview subpackage
* Mon Aug 13 2018 Josh Stone <jistone@redhat.com> - 1.28.0-3
- Use llvm6.0 instead of llvm-7 for now
* Tue Aug 07 2018 Josh Stone <jistone@redhat.com> - 1.28.0-2
- Rebuild for LLVM ppc64/s390x fixes
* Thu Aug 02 2018 Josh Stone <jistone@redhat.com> - 1.28.0-1
- Update to 1.28.0.
* Tue Jul 24 2018 Josh Stone <jistone@redhat.com> - 1.27.2-4
- Update to 1.27.2.
* Sat Jul 14 2018 Fedora Release Engineering <releng@fedoraproject.org> - 1.27.1-3
- Rebuilt for https://fedoraproject.org/wiki/Fedora_29_Mass_Rebuild
* Tue Jul 10 2018 Josh Stone <jistone@redhat.com> - 1.27.1-2
- Update to 1.27.1.
- Security fix for CVE-2018-1000622
* Thu Jun 21 2018 Josh Stone <jistone@redhat.com> - 1.27.0-1
- Update to 1.27.0.
* Tue Jun 05 2018 Josh Stone <jistone@redhat.com> - 1.26.2-4
- Rebuild without bootstrap binaries.
* Tue Jun 05 2018 Josh Stone <jistone@redhat.com> - 1.26.2-3
- Update to 1.26.2.
- Re-bootstrap to deal with LLVM symbol changes.
* Tue May 29 2018 Josh Stone <jistone@redhat.com> - 1.26.1-2
- Update to 1.26.1.
* Thu May 10 2018 Josh Stone <jistone@redhat.com> - 1.26.0-1
- Update to 1.26.0.
* Mon Apr 16 2018 Dan Callaghan <dcallagh@redhat.com> - 1.25.0-3
- Add cargo, rls, and analysis
* Tue Apr 10 2018 Josh Stone <jistone@redhat.com> - 1.25.0-2
- Filter codegen-backends from Provides too.
* Thu Mar 29 2018 Josh Stone <jistone@redhat.com> - 1.25.0-1
- Update to 1.25.0.
* Thu Mar 01 2018 Josh Stone <jistone@redhat.com> - 1.24.1-1
- Update to 1.24.1.
* Wed Feb 21 2018 Josh Stone <jistone@redhat.com> - 1.24.0-3
- Backport a rebuild fix for rust#48308.
* Mon Feb 19 2018 Josh Stone <jistone@redhat.com> - 1.24.0-2
- rhbz1546541: drop full-bootstrap; cmp libs before symlinking.
- Backport pr46592 to fix local_rebuild bootstrapping.
- Backport pr48362 to fix relative/absolute libdir.
* Thu Feb 15 2018 Josh Stone <jistone@redhat.com> - 1.24.0-1
- Update to 1.24.0.
* Mon Feb 12 2018 Iryna Shcherbina <ishcherb@redhat.com> - 1.23.0-4
- Update Python 2 dependency declarations to new packaging standards
(See https://fedoraproject.org/wiki/FinalizingFedoraSwitchtoPython3)
* Tue Feb 06 2018 Josh Stone <jistone@redhat.com> - 1.23.0-3
- Use full-bootstrap to work around a rebuild issue.
- Patch binaryen for GCC 8
* Thu Feb 01 2018 Igor Gnatenko <ignatenkobrain@fedoraproject.org> - 1.23.0-2
- Switch to %%ldconfig_scriptlets
* Mon Jan 08 2018 Josh Stone <jistone@redhat.com> - 1.23.0-1
- Update to 1.23.0.
* Thu Nov 23 2017 Josh Stone <jistone@redhat.com> - 1.22.1-1
- Update to 1.22.1.
* Thu Oct 12 2017 Josh Stone <jistone@redhat.com> - 1.21.0-1
- Update to 1.21.0.
* Mon Sep 11 2017 Josh Stone <jistone@redhat.com> - 1.20.0-2
- ABI fixes for ppc64 and s390x.
* Thu Aug 31 2017 Josh Stone <jistone@redhat.com> - 1.20.0-1
- Update to 1.20.0.
- Add a rust-src subpackage.
* Thu Aug 03 2017 Fedora Release Engineering <releng@fedoraproject.org> - 1.19.0-4
- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Binutils_Mass_Rebuild
* Thu Jul 27 2017 Fedora Release Engineering <releng@fedoraproject.org> - 1.19.0-3
- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Mass_Rebuild
* Mon Jul 24 2017 Josh Stone <jistone@redhat.com> - 1.19.0-2
- Use find-debuginfo.sh --keep-section .rustc
* Thu Jul 20 2017 Josh Stone <jistone@redhat.com> - 1.19.0-1
- Update to 1.19.0.
* Thu Jun 08 2017 Josh Stone <jistone@redhat.com> - 1.18.0-1
- Update to 1.18.0.
* Mon May 08 2017 Josh Stone <jistone@redhat.com> - 1.17.0-2
- Move shared libraries back to libdir and symlink in rustlib
* Thu Apr 27 2017 Josh Stone <jistone@redhat.com> - 1.17.0-1
- Update to 1.17.0.
* Mon Mar 20 2017 Josh Stone <jistone@redhat.com> - 1.16.0-3
- Make rust-lldb arch-specific to deal with lldb deps
* Fri Mar 17 2017 Josh Stone <jistone@redhat.com> - 1.16.0-2
- Limit rust-lldb arches
* Thu Mar 16 2017 Josh Stone <jistone@redhat.com> - 1.16.0-1
- Update to 1.16.0.
- Use rustbuild instead of the old makefiles.
- Update bootstrapping to include rust-std and cargo.
- Add a rust-lldb subpackage.
* Thu Feb 09 2017 Josh Stone <jistone@redhat.com> - 1.15.1-1
- Update to 1.15.1.
- Require rust-rpm-macros for new crate packaging.
- Keep shared libraries under rustlib/, only debug-stripped.
- Merge and clean up conditionals for epel7.
* Fri Dec 23 2016 Josh Stone <jistone@redhat.com> - 1.14.0-2
- Rebuild without bootstrap binaries.
* Thu Dec 22 2016 Josh Stone <jistone@redhat.com> - 1.14.0-1
- Update to 1.14.0.
- Rewrite bootstrap logic to target specific arches.
- Bootstrap ppc64, ppc64le, s390x. (thanks to Sinny Kumari for testing!)
* Thu Nov 10 2016 Josh Stone <jistone@redhat.com> - 1.13.0-1
- Update to 1.13.0.
- Use hardening flags for linking.
- Split the standard library into its own package
- Centralize rustlib/ under /usr/lib/ for multilib integration.
* Thu Oct 20 2016 Josh Stone <jistone@redhat.com> - 1.12.1-1
- Update to 1.12.1.
* Fri Oct 14 2016 Josh Stone <jistone@redhat.com> - 1.12.0-7
- Rebuild with LLVM 3.9.
- Add ncurses-devel for llvm-config's -ltinfo.
* Thu Oct 13 2016 Josh Stone <jistone@redhat.com> - 1.12.0-6
- Rebuild with llvm-static, preparing for 3.9
* Fri Oct 07 2016 Josh Stone <jistone@redhat.com> - 1.12.0-5
- Rebuild with fixed eu-strip (rhbz1380961)
* Fri Oct 07 2016 Josh Stone <jistone@redhat.com> - 1.12.0-4
- Rebuild without bootstrap binaries.
* Thu Oct 06 2016 Josh Stone <jistone@redhat.com> - 1.12.0-3
- Bootstrap aarch64.
- Use jemalloc's MALLOC_CONF to work around #36944.
- Apply pr36933 to really disable armv7hl NEON.
* Sat Oct 01 2016 Josh Stone <jistone@redhat.com> - 1.12.0-2
- Protect .rustc from rpm stripping.
* Fri Sep 30 2016 Josh Stone <jistone@redhat.com> - 1.12.0-1
- Update to 1.12.0.
- Always use --local-rust-root, even for bootstrap binaries.
- Remove the rebuild conditional - the build system now figures it out.
- Let minidebuginfo do its thing, since metadata is no longer a note.
- Let rust build its own compiler-rt builtins again.
* Sat Sep 03 2016 Josh Stone <jistone@redhat.com> - 1.11.0-3
- Rebuild without bootstrap binaries.
* Fri Sep 02 2016 Josh Stone <jistone@redhat.com> - 1.11.0-2
- Bootstrap armv7hl, with backported no-neon patch.
* Wed Aug 24 2016 Josh Stone <jistone@redhat.com> - 1.11.0-1
- Update to 1.11.0.
- Drop the backported patches.
- Patch get-stage0.py to trust existing bootstrap binaries.
- Use libclang_rt.builtins from compiler-rt, dodging llvm-static issues.
- Use --local-rust-root to make sure the right bootstrap is used.
* Sat Aug 13 2016 Josh Stone <jistone@redhat.com> 1.10.0-4
- Rebuild without bootstrap binaries.
* Fri Aug 12 2016 Josh Stone <jistone@redhat.com> - 1.10.0-3
- Initial import into Fedora (#1356907), bootstrapped
- Format license text as suggested in review.
- Note how the tests already run in parallel.
- Undefine _include_minidebuginfo, because it duplicates ".note.rustc".
- Don't let checks fail the whole build.
- Note that -doc can't be noarch, as rpmdiff doesn't allow variations.
* Tue Jul 26 2016 Josh Stone <jistone@redhat.com> - 1.10.0-2
- Update -doc directory ownership, and mark its licenses.
- Package and declare licenses for libbacktrace and hoedown.
- Set bootstrap_base as a global.
- Explicitly require python2.
* Thu Jul 14 2016 Josh Stone <jistone@fedoraproject.org> - 1.10.0-1
- Initial package, bootstrapped

62
macros.rust-srpm Normal file
View File

@ -0,0 +1,62 @@
# rust_arches: list of architectures where building Rust is supported
#
# Since RPM itself now depends on Rust code (via its GPG backend, rpm-sequoia),
# this list will probably always be a superset of all architectures that are
# supported by Fedora, which is why it is no longer required to set
# "ExclusiveArch: rust_arches" for Rust packages in Fedora.
%rust_arches x86_64 %{ix86} armv7hl aarch64 ppc64 ppc64le riscv64 s390x
# version_no_tilde: lua macro for reconstructing the original crate version
# from the RPM version (i.e. replace any "~" characters with "-")
%version_no_tilde() %{lua:
local sep = rpm.expand('%1')
local ver = rpm.expand('%2')
\
if sep == '%1' then
sep = '-'
end
\
if ver == '%2' then
ver = rpm.expand('%version')
end
ver = ver:gsub('~', sep)
\
print(ver)
}
# __crates_url: default API endpoint for downloading .crate files from crates.io
%__crates_url https://crates.io/api/v1/crates/
# crates_source: lua macro for constructing the Source URL for a crate
%crates_source() %{lua:
local crate = rpm.expand('%1')
local version = rpm.expand('%2')
local url = rpm.expand('%__crates_url')
\
-- first argument missing: fall back to %crate
if crate == '%1' then
crate = rpm.expand('%crate')
end
-- %crate macro not defined: fall back to %name
if crate == '%crate' then
crate = rpm.expand('%name')
end
\
-- second argument missing: fall back to %crate_version
if version == '%2' then
version = rpm.expand('%crate_version')
end
-- %crate_version macro not defined: fall back to %version
if version == '%crate_version' then
version = rpm.expand('%version')
end
-- replace '~' with '-' for backwards compatibility
-- can be removed in the future
version = version:gsub('~', '-')
\
print(url .. crate .. '/' .. version .. '/download#/' .. crate .. '-' .. version .. '.crate')
}
# __cargo_skip_build: unused macro, set to 0 for backwards compatibility
%__cargo_skip_build 0

View File

@ -1,29 +1,100 @@
# Explicitly use bindir tools, in case others are in the PATH,
# like the rustup shims in a user's ~/.cargo/bin/.
# __rustc: path to the default rustc executable
%__rustc /usr/bin/rustc
# __rustdoc: path to the default rustdoc executable
%__rustdoc /usr/bin/rustdoc
# rustflags_opt_level: default optimization level
#
# 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
# It corresponds to the "-Copt-level" rustc command line option.
%rustflags_opt_level 3
# Enable optimization, debuginfo, and link hardening.
%__global_rustflags -Copt-level=3 -Cdebuginfo=2 -Clink-arg=-Wl,-z,relro,-z,now
# rustflags_debuginfo: default verbosity of debug information
#
# It corresponds to the "-Cdebuginfo" rustc command line option.
# In some cases, it might be required to override this macro with "1" or even
# "0", if memory usage gets too high during builds on some resource-constrained
# architectures (most likely on 32-bit architectures), which will however
# reduce the quality of the produced debug symbols.
%rustflags_debuginfo 2
%__global_rustflags_toml [%{lua:
for arg in string.gmatch(rpm.expand("%{__global_rustflags}"), "%S+") do
print('"' .. arg .. '", ')
end}]
# rustflags_codegen_units: default number of parallel code generation units
#
# The default value of "1" results in generation of better code, but comes at
# the cost of longer build times.
%rustflags_codegen_units 1
%cargo_prep(V:) (\
%{__mkdir} -p .cargo \
cat > .cargo/config << EOF \
# build_rustflags: default compiler flags for rustc (RUSTFLAGS)
#
# -Copt-level: set optimization level (default: highest optimization level)
# -Cdebuginfo: set debuginfo verbosity (default: full debug information)
# -Ccodegen-units: set number of parallel code generation units (default: 1)
# -Cforce-frame-pointers: force inclusion of frame pointers (default: enabled
# on x86_64 and aarch64 on Fedora 37+)
#
# Additionally, some linker flags are set which correspond to the default
# Fedora compiler flags for hardening and for embedding package versions into
# compiled binaries.
#
# ref. https://doc.rust-lang.org/rustc/codegen-options/index.html
%build_rustflags %{shrink:
-Copt-level=%rustflags_opt_level
-Cdebuginfo=%rustflags_debuginfo
-Ccodegen-units=%rustflags_codegen_units
-Cstrip=none
%{expr:0%{?_include_frame_pointers} && ("%{_arch}" != "ppc64le" && "%{_arch}" != "s390x" && "%{_arch}" != "i386") ? "-Cforce-frame-pointers=yes" : ""}
%[0%{?_package_note_status} ? "-Clink-arg=%_package_note_flags" : ""]
}
# __cargo: cargo command with environment variables
#
# CARGO_HOME: This ensures cargo reads configuration file from .cargo/config,
# and prevents writing any files to $HOME during RPM builds.
%__cargo /usr/bin/env CARGO_HOME=.cargo RUSTFLAGS='%{build_rustflags}' /usr/bin/cargo
# __cargo_common_opts: common command line flags for cargo
#
# _smp_mflags: run builds and tests in parallel
%__cargo_common_opts %{?_smp_mflags}
# cargo_prep: macro to set up build environment for cargo projects
#
# This involves four steps:
# - create the ".cargo" directory if it doesn't exist yet
# - dump custom cargo configuration into ".cargo/config"
# - remove "Cargo.lock" if it exists (it breaks builds with custom cargo config)
# - remove "Cargo.toml.orig" if it exists (it breaks running "cargo package")
#
# Options:
# -V <number> - unpack and use vendored sources from Source<number> tarball
# (deprecated; use -v instead)
# -v <directory> - use vendored sources from <directory>
# -N - Don't set up any registry. Only set up the build configuration.
%cargo_prep(V:v:N)\
%{-v:%{-V:%{error:-v and -V are mutually exclusive!}}}\
%{-v:%{-N:%{error:-v and -N are mutually exclusive!}}}\
(\
set -euo pipefail\
%{__mkdir} -p target/rpm\
/usr/bin/ln -s rpm target/release\
%{__rm} -rf .cargo/\
%{__mkdir} -p .cargo\
cat > .cargo/config << EOF\
[build]\
rustc = "%{__rustc}"\
rustdoc = "%{__rustdoc}"\
rustflags = %{__global_rustflags_toml}\
\
[profile.rpm]\
inherits = "release"\
opt-level = %{rustflags_opt_level}\
codegen-units = %{rustflags_codegen_units}\
debug = %{rustflags_debuginfo}\
strip = "none"\
\
[env]\
CFLAGS = "%{build_cflags}"\
CXXFLAGS = "%{build_cxxflags}"\
LDFLAGS = "%{build_ldflags}"\
\
[install]\
root = "%{buildroot}%{_prefix}"\
@ -31,21 +102,155 @@ root = "%{buildroot}%{_prefix}"\
[term]\
verbose = true\
EOF\
%if 0%{-V:1}\
%{__tar} -xoaf %{S:%{-V*}}\
cat >> .cargo/config << EOF \
%{-V:%{__tar} -xoaf %{S:%{-V*}}}\
%{!?-N:\
cat >> .cargo/config << EOF\
[source.vendored-sources]\
directory = "%{-v*}%{-V:./vendor}"\
\
[source.crates-io]\
registry = "https://crates.io"\
replace-with = "vendored-sources"\
\
[source.vendored-sources]\
directory = "./vendor"\
EOF\
%endif\
EOF}\
%{__rm} -f Cargo.toml.orig\
)
%cargo_build %__cargo build --release %{?_smp_mflags}
# __cargo_parse_opts: function-like macro which parses common flags into the
# equivalent command-line flags for cargo
%__cargo_parse_opts(naf:) %{shrink:\
%{-n:%{-a:%{error:Can't specify both -n and -a}}} \
%{-f:%{-a:%{error:Can't specify both -f(%{-f*}) and -a}}} \
%{-n:--no-default-features} \
%{-a:--all-features} \
%{-f:--features %{-f*}} \
%{nil} \
}
%cargo_test %__cargo test --release %{?_smp_mflags} --no-fail-fast
# cargo_build: builds the crate with cargo with the specified feature flags
%cargo_build(naf:)\
%{shrink: \
%{__cargo} build \
%{__cargo_common_opts} \
--profile rpm \
%{__cargo_parse_opts %{-n} %{-a} %{-f:-f%{-f*}}} \
%* \
}
# cargo_test: runs the test suite with cargo with the specified feature flags
#
# To pass command-line arguments to the cargo test runners directly (for
# example, to skip certain tests during package builds), both the cargo_test
# macro argument parsing and "cargo test" argument parsing need to be bypassed,
# i.e. "%%cargo_test -- -- --skip foo" for skipping all tests with names that
# match "foo".
%cargo_test(naf:)\
%{shrink: \
%{__cargo} test \
%{__cargo_common_opts} \
--profile rpm \
--no-fail-fast \
%{__cargo_parse_opts %{-n} %{-a} %{-f:-f%{-f*}}} \
%* \
}
# cargo_install: install files into the buildroot
#
# For "binary" crates, this macro installs all "bin" build targets to _bindir
# inside the buildroot. The "--no-track" option prevents the creation of the
# "$CARGO_HOME/.crates.toml" file, which is used to keep track of which version
# of a specific binary has been installed, but which conflicts between builds
# of different Rust applications and is not needed when building RPM packages.
%cargo_install(t:naf:)\
(\
set -euo pipefail \
%{shrink: \
%{__cargo} install \
%{__cargo_common_opts} \
--profile rpm \
--no-track \
--path . \
%{__cargo_parse_opts %{-n} %{-a} %{-f:-f%{-f*}}} \
%* \
} \
)
# cargo_license: print license information for all crate dependencies
#
# The "no-build,no-dev,no-proc-macro" argument results in only crates which are
# linked into the final binary to be considered.
#
# Additionally, deprecated SPDX syntax ("/" instead of "OR") is normalized
# before sorting the results to ensure reproducible output of this macro.
#
# This macro must be called with the same feature flags as other cargo macros,
# in particular, "cargo_build", otherwise its output will be incomplete.
#
# The "cargo tree" command called by this macro will fail if there are missing
# (optional) dependencies.
%cargo_license(naf:)\
(\
set -euo pipefail\
%{shrink: \
%{__cargo} tree \
--workspace \
--offline \
--edges no-build,no-dev,no-proc-macro \
--no-dedupe \
%{__cargo_parse_opts %{-n} %{-a} %{-f:-f%{-f*}}} \
--prefix none \
--format "{l}: {p}" \
| sed -e "s: ($(pwd)[^)]*)::g" -e "s: / :/:g" -e "s:/: OR :g" \
| sort -u \
}\
)
# cargo_license_summary: print license summary for all crate dependencies
#
# This macro works in the same way as cargo_license, except that it only prints
# a list of licenses, and not the complete license information for every crate
# in the dependency tree. This is useful for determining the correct License
# tag for packages that contain compiled Rust binaries.
%cargo_license_summary(naf:)\
(\
set -euo pipefail\
%{shrink: \
%{__cargo} tree \
--workspace \
--offline \
--edges no-build,no-dev,no-proc-macro \
--no-dedupe \
%{__cargo_parse_opts %{-n} %{-a} %{-f:-f%{-f*}}} \
--prefix none \
--format "# {l}" \
| sed -e "s: / :/:g" -e "s:/: OR :g" \
| sort -u \
}\
)
# cargo_vendor_manifest: write list of vendored crates and their versions
#
# The arguments for the internal "cargo tree" call emulate the logic
# that determines which crates are included when running "cargo vendor".
# The results are written to "cargo-vendor.txt".
#
# TODO: --all-features may be overly broad; this should be modified to
# use %%__cargo_parse_opts to handle feature flags.
%cargo_vendor_manifest()\
(\
set -euo pipefail\
%{shrink: \
%{__cargo} tree \
--workspace \
--offline \
--edges normal,build \
--no-dedupe \
--all-features \
--prefix none \
--format "{p}" \
| grep -v "$(pwd)" \
| sed -e "s: (proc-macro)::" \
| sort -u \
> cargo-vendor.txt \
}\
)
%cargo_install %__cargo install --no-track --path .

1350
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

@ -0,0 +1,44 @@
diff -up rustc-beta-src/src/tools/cargo/Cargo.lock.orig rustc-beta-src/src/tools/cargo/Cargo.lock
--- rustc-beta-src/src/tools/cargo/Cargo.lock.orig 2024-04-04 15:01:24.003038403 -0700
+++ rustc-beta-src/src/tools/cargo/Cargo.lock 2024-04-04 15:01:24.005038377 -0700
@@ -2111,7 +2111,6 @@ checksum = "ee4126d8b4ee5c9d9ea891dd875c
dependencies = [
"cc",
"libc",
- "libssh2-sys",
"libz-sys",
"openssl-sys",
"pkg-config",
@@ -2152,20 +2151,6 @@ dependencies = [
"pkg-config",
"vcpkg",
]
-
-[[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"
diff -up rustc-beta-src/src/tools/cargo/Cargo.toml.orig rustc-beta-src/src/tools/cargo/Cargo.toml
--- rustc-beta-src/src/tools/cargo/Cargo.toml.orig 2024-04-04 15:01:24.005038377 -0700
+++ rustc-beta-src/src/tools/cargo/Cargo.toml 2024-04-04 15:02:15.816367069 -0700
@@ -44,7 +44,7 @@ curl = "0.4.46"
curl-sys = "0.4.72"
filetime = "0.2.23"
flate2 = { version = "1.0.28", default-features = false, features = ["zlib"] }
-git2 = "0.18.2"
+git2 = { version = "0.18.2", default-features = false, features = ["https"] }
git2-curl = "0.19.0"
gix = { version = "0.58.0", default-features = false, features = ["blocking-http-transport-curl", "progress-tree", "revision"] }
gix-features-for-configuration-only = { version = "0.38.0", package = "gix-features", features = [ "parallel" ] }

View File

@ -0,0 +1,23 @@
diff -up rustc-beta-src/src/tools/cargo/Cargo.lock.orig rustc-beta-src/src/tools/cargo/Cargo.lock
--- rustc-beta-src/src/tools/cargo/Cargo.lock.orig 2024-04-04 14:54:45.433205012 -0700
+++ rustc-beta-src/src/tools/cargo/Cargo.lock 2024-04-04 14:55:51.949342725 -0700
@@ -2149,7 +2149,6 @@ version = "0.28.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "0c10584274047cb335c23d3e61bcef8e323adae7c5c8c760540f73610177fc3f"
dependencies = [
- "cc",
"pkg-config",
"vcpkg",
]
diff -up rustc-beta-src/src/tools/cargo/Cargo.toml.orig rustc-beta-src/src/tools/cargo/Cargo.toml
--- rustc-beta-src/src/tools/cargo/Cargo.toml.orig 2024-04-04 14:54:45.433205012 -0700
+++ rustc-beta-src/src/tools/cargo/Cargo.toml 2024-04-04 14:55:35.823551771 -0700
@@ -77,7 +77,7 @@ proptest = "1.4.0"
pulldown-cmark = { version = "0.10.0", default-features = false, features = ["html"] }
rand = "0.8.5"
regex = "1.10.3"
-rusqlite = { version = "0.31.0", features = ["bundled"] }
+rusqlite = { version = "0.31.0", features = [] }
rustfix = { version = "0.8.2", path = "crates/rustfix" }
same-file = "1.0.6"
security-framework = "2.9.2"

View File

@ -1,2 +1,2 @@
SHA512 (rustc-1.70.0-src.tar.xz) = 21b35185fdcc35a059ee5ef6dca2b68f5f1d199e97f425a571cfc318a852c36a57bccf68e7673b4cb7cd83128f30d0b3eb93009a978f3ba3909b7eee50d40631
SHA512 (wasi-libc-wasi-sdk-20.tar.gz) = e264240dc7dbcf6398c8ca09bc108298f4a8aa955af22de5a3015fbcde81cb09dd83cd48349090082d5de0e8a3dbcf746c7b14657c67657b3f2f1ab28bb9cf05
SHA512 (rustc-1.78.0-src.tar.xz) = d2fb9881e28849d871fda71b1b51652be3839b3283f0d32163f258c5c707a9fb7b589da8dc03bca2fefee1abdd2b44a5f17e85d8c6df7bea119d1e8d22371941
SHA512 (wasi-libc-03b228e46bb02fcc5927253e1b8ad715072b1ae4.tar.gz) = 56306817a6d683aeaf61c3376700804f143b9be101729693c1c88666ea201f02a3e7a3b32150f688a784ac4aae30e46bdbe3fc79a1a9c62e7b460d11ad509045

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

@ -0,0 +1,11 @@
summary+: ": librsvg2"
require+:
- librsvg2
environment+:
PKG_TO_BUILD: "librsvg2"
duration: 20m
adjust+:
# building librsvg2 in Fedora is very flaky. Do not run it there
- when: distro == fedora
enabled: false

View File

@ -0,0 +1,13 @@
summary: rpmbuild package with rust
description: 'Ensure that rust does not break rpmbuild'
contact:
- Jesus Checa Hidalgo <jcheca@redhat.com>
component:
- rust
test: ./runtest.sh
framework: beakerlib
require+:
- rust
- rpm-build
- yum-utils
duration: 1h

View File

@ -0,0 +1,11 @@
summary+: ": ripgrep"
require+:
- ripgrep
environment+:
PKG_TO_BUILD: "ripgrep"
duration: 15m
adjust+:
# ripgrep is not part of RHEL
- when: distro != fedora
enabled: false

View File

@ -0,0 +1,11 @@
summary+: ": rpm-sequoia"
require+:
- rpm-sequoia
environment+:
PKG_TO_BUILD: "rpm-sequoia"
duration: 20m
adjust+:
- when: distro < rhel-10, centos-stream-10
enabled: false
because: "rpm-sequoia is available only in RHEL >= 10"

View File

@ -0,0 +1,55 @@
#!/bin/bash
# vim: dict+=/usr/share/beakerlib/dictionary.vim cpt=.,w,b,u,t,i,k
. /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"
if [[ "x" == "x${PKG_TO_BUILD}" ]]; then
rlLogError "No package was configured to build."
rlDie "The package must be passed over PKG_TO_BUILD environment variable."
fi
rlPhaseEnd
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 *.src.rpm)
rlRun "rpm -ivh $SRPM"
rlRun SPECDIR="$(rpm -E '%{_specdir}')"
# Note about the spec file name: When packaging rust crates, the package
# is named rust-<crate>, as well as the spec file, but the rpm package
# (the one we use in dnf to install and query) is named as the crate,
# (without the "rust-" prefix). We have to take that into account to
# find the spec:
# https://docs.fedoraproject.org/en-US/packaging-guidelines/Rust/#_package_naming
rlRun "SPECNAME=$(rpm -ql $SRPM | grep .spec)"
# Packages built with rust usually 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}/${SPECNAME} |& 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

@ -0,0 +1,6 @@
summary+: ": stratisd"
require+:
- stratisd
environment+:
PKG_TO_BUILD: "stratisd"
duration: 1h

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