Skip to content

Commit d4caecc

Browse files
committed
Auto merge of #3035 - RalfJung:serde, r=RalfJung
bump serde bump to a version with the binary blob removed also, respect CARGO_EXTRA_FLAGS in more places
2 parents 4b8d7fd + c6ca2ad commit d4caecc

File tree

11 files changed

+51
-41
lines changed

11 files changed

+51
-41
lines changed

Cargo.lock

+10-10
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

+2-2
Original file line numberDiff line numberDiff line change
@@ -41,8 +41,8 @@ rustc_version = "0.4"
4141
# Features chosen to match those required by env_logger, to avoid rebuilds
4242
regex = { version = "1.5.5", default-features = false, features = ["perf", "std"] }
4343
lazy_static = "1.4.0"
44-
# Pin a version of serde without intransparent unreproducible binary blobs.
45-
serde = { version = "1.0, < 1.0.172", features = ["derive"] }
44+
# Require a version of serde without intransparent unreproducible binary blobs.
45+
serde = { version = "1.0.185", features = ["derive"] }
4646

4747
[package.metadata.rust-analyzer]
4848
# This crate uses #[feature(rustc_private)].

cargo-miri/Cargo.lock

+10-10
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

cargo-miri/Cargo.toml

+2-2
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,8 @@ rustc-build-sysroot = "0.4.1"
2222

2323
# Enable some feature flags that dev-dependencies need but dependencies
2424
# do not. This makes `./miri install` after `./miri build` faster.
25-
# Pin a version of serde without intransparent unreproducible binary blobs.
26-
serde = { version = "1.0, < 1.0.172", features = ["derive"] }
25+
# Require a version of serde without intransparent unreproducible binary blobs.
26+
serde = { version = "1.0.185", features = ["derive"] }
2727

2828
[build-dependencies]
2929
rustc_tools_util = "0.3"

ci.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ function run_tests {
5252

5353
# Also run some many-seeds tests. 64 seeds means this takes around a minute per test.
5454
for FILE in tests/many-seeds/*.rs; do
55-
MIRI_SEEDS=64 CARGO_EXTRA_FLAGS="$CARGO_EXTRA_FLAGS -q" ./miri many-seeds ./miri run "$FILE"
55+
MIRI_SEEDS=64 ./miri many-seeds ./miri run "$FILE"
5656
done
5757

5858
# Check that the benchmarks build and run, but without actually benchmarking.

miri

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,5 @@
22
set -e
33
# Instead of doing just `cargo run --manifest-path .. $@`, we invoke miri-script binary directly. Invoking `cargo run` goes through
44
# rustup (that sets it's own environmental variables), which is undesirable.
5-
cargo build -q --manifest-path "$(dirname "$0")"/miri-script/Cargo.toml
5+
cargo build $CARGO_EXTRA_FLAGS -q --manifest-path "$(dirname "$0")"/miri-script/Cargo.toml
66
"$(dirname "$0")"/miri-script/target/debug/miri-script "$@"

miri-script/src/commands.rs

+3-1
Original file line numberDiff line numberDiff line change
@@ -319,6 +319,8 @@ impl Command {
319319
let Some((program_name, args)) = hyperfine.split_first() else {
320320
bail!("expected HYPERFINE environment variable to be non-empty");
321321
};
322+
// Extra flags to pass to cargo.
323+
let cargo_extra_flags = std::env::var("CARGO_EXTRA_FLAGS").unwrap_or_default();
322324
// Make sure we have an up-to-date Miri installed and selected the right toolchain.
323325
Self::install(vec![])?;
324326

@@ -341,7 +343,7 @@ impl Command {
341343
// That seems to make Windows CI happy.
342344
cmd!(
343345
sh,
344-
"{program_name} {args...} 'cargo miri run --manifest-path \"'{current_bench}'\"'"
346+
"{program_name} {args...} 'cargo miri run '{cargo_extra_flags}' --manifest-path \"'{current_bench}'\"'"
345347
)
346348
.run()?;
347349
}

test-cargo-miri/Cargo.lock

+8-8
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

test-cargo-miri/Cargo.toml

+1-2
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,7 @@ issue_rust_86261 = { path = "issue-rust-86261" }
2121
[dev-dependencies]
2222
byteorder_2 = { package = "byteorder", version = "0.5" } # to test dev-dependencies behave as expected, with renaming
2323
# Not actually used, but exercises some unique code path (`--extern` .so file).
24-
# Pin a version without intransparent unreproducible binary blobs.
25-
serde_derive = "=1.0.152"
24+
serde_derive = "1.0.185"
2625

2726
[build-dependencies]
2827
autocfg = "1"

test-cargo-miri/run-test.py

+3-1
Original file line numberDiff line numberDiff line change
@@ -15,12 +15,14 @@
1515
CBOLD = '\33[1m'
1616
CEND = '\33[0m'
1717

18+
CARGO_EXTRA_FLAGS = os.environ.get("CARGO_EXTRA_FLAGS", "").split()
19+
1820
def fail(msg):
1921
print("\nTEST FAIL: {}".format(msg))
2022
sys.exit(1)
2123

2224
def cargo_miri(cmd, quiet = True):
23-
args = ["cargo", "miri", cmd]
25+
args = ["cargo", "miri", cmd] + CARGO_EXTRA_FLAGS
2426
if quiet:
2527
args += ["-q"]
2628
if 'MIRI_TEST_TARGET' in os.environ:

tests/compiletest.rs

+10-3
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,11 @@ fn get_host() -> String {
1616
.host
1717
}
1818

19+
pub fn flagsplit(flags: &str) -> Vec<String> {
20+
// This code is taken from `RUSTFLAGS` handling in cargo.
21+
flags.split(' ').map(str::trim).filter(|s| !s.is_empty()).map(str::to_string).collect()
22+
}
23+
1924
// Build the shared object file for testing external C function calls.
2025
fn build_so_for_c_ffi_tests() -> PathBuf {
2126
let cc = option_env!("CC").unwrap_or("cc");
@@ -100,14 +105,16 @@ fn test_config(target: &str, path: &str, mode: Mode, with_dependencies: bool) ->
100105
if with_dependencies && use_std {
101106
config.dependencies_crate_manifest_path =
102107
Some(Path::new("test_dependencies").join("Cargo.toml"));
103-
config.dependency_builder.args = vec![
104-
"run".into(),
108+
let mut builder_args = vec!["run".into()];
109+
builder_args.extend(flagsplit(&env::var("CARGO_EXTRA_FLAGS").unwrap_or_default()));
110+
builder_args.extend([
105111
"--manifest-path".into(),
106112
"cargo-miri/Cargo.toml".into(),
107113
"--".into(),
108114
"miri".into(),
109115
"run".into(), // There is no `cargo miri build` so we just use `cargo miri run`.
110-
];
116+
]);
117+
config.dependency_builder.args = builder_args.into_iter().map(Into::into).collect();
111118
}
112119
config
113120
}

0 commit comments

Comments
 (0)