Skip to content

Commit a61ba4d

Browse files
committed
Auto merge of #150674 - matthiaskrgr:rollup-tnkgbcx, r=matthiaskrgr
Rollup of 5 pull requests Successful merges: - rust-lang/rust#150554 (test: add regression cases for valtree hashing ICE) - rust-lang/rust#150597 (make specialization of `Vec::extend` and `VecDeque::extend_front` work for vec::IntoIter with any `Allocator`, not just `Global`) - rust-lang/rust#150619 (alloc: Move Cow impl to existing ones) - rust-lang/rust#150660 (THIR pattern building: Pass HIR nodes instead of loose types/spans) - rust-lang/rust#150671 (miri subtree update) r? `@ghost` `@rustbot` modify labels: rollup
2 parents 32c0adf + ab14fcd commit a61ba4d

46 files changed

Lines changed: 736 additions & 369 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

Cargo.lock

Lines changed: 15 additions & 10 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,14 +32,14 @@ serde_json = { version = "1.0", optional = true }
3232
[target.'cfg(unix)'.dependencies]
3333
libc = "0.2"
3434
# native-lib dependencies
35-
libffi = { version = "5.0.0", optional = true }
35+
libffi = { version = "5.1.0", optional = true }
3636
libloading = { version = "0.9", optional = true }
3737
serde = { version = "1.0.219", features = ["derive"], optional = true }
3838

3939
[target.'cfg(target_os = "linux")'.dependencies]
4040
nix = { version = "0.30.1", features = ["mman", "ptrace", "signal"], optional = true }
4141
ipc-channel = { version = "0.20.0", optional = true }
42-
capstone = { version = "0.13", optional = true }
42+
capstone = { version = "0.14", optional = true }
4343

4444
[target.'cfg(all(target_os = "linux", target_pointer_width = "64", target_endian = "little"))'.dependencies]
4545
genmc-sys = { path = "./genmc-sys/", version = "0.1.0", optional = true }
@@ -68,6 +68,7 @@ expensive-consistency-checks = ["stack-cache"]
6868
tracing = ["serde_json"]
6969
native-lib = ["dep:libffi", "dep:libloading", "dep:capstone", "dep:ipc-channel", "dep:nix", "dep:serde"]
7070
jemalloc = []
71+
check_only = ["libffi?/check_only", "capstone?/check_only", "genmc-sys?/check_only"]
7172

7273
[lints.rust.unexpected_cfgs]
7374
level = "warn"

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -219,7 +219,7 @@ degree documented below):
219219
- We have unofficial support (not maintained by the Miri team itself) for some further operating systems.
220220
- `solaris` / `illumos`: maintained by @devnexen. Supports the entire test suite.
221221
- `freebsd`: maintained by @YohDeadfall and @LorrensP-2158466. Supports the entire test suite.
222-
- `android`: **maintainer wanted**. Basic OS APIs and concurrency work, but file system access is not supported.
222+
- `android`: **maintainer wanted**. Supports the entire test suite.
223223
- For targets on other operating systems, Miri might fail before even reaching the `main` function.
224224

225225
However, even for targets that we do support, the degree of support for accessing platform APIs

ci/ci.sh

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -30,14 +30,15 @@ export CARGO_INCREMENTAL=0
3030
export CARGO_EXTRA_FLAGS="--locked"
3131

3232
# Determine configuration for installed build (used by test-cargo-miri and `./miri bench`).
33+
# We use the default set of features for this.
3334
echo "Installing release version of Miri"
3435
time ./miri install
3536

3637
# Prepare debug build for direct `./miri` invocations.
37-
# We enable all features to make sure the Stacked Borrows consistency check runs.
38+
# Here we enable some more features and checks.
3839
echo "Building debug version of Miri"
39-
export CARGO_EXTRA_FLAGS="$CARGO_EXTRA_FLAGS --all-features"
40-
time ./miri build # the build that all the `./miri test` below will use
40+
export FEATURES="--features=expensive-consistency-checks,genmc"
41+
time ./miri build $FEATURES # the build that all the `./miri test` below will use
4142

4243
endgroup
4344

@@ -63,7 +64,7 @@ function run_tests {
6364
if [ -n "${GC_STRESS-}" ]; then
6465
time MIRIFLAGS="${MIRIFLAGS-} -Zmiri-provenance-gc=1" ./miri test $TARGET_FLAG
6566
else
66-
time ./miri test $TARGET_FLAG
67+
time ./miri test $FEATURES $TARGET_FLAG
6768
fi
6869

6970
## advanced tests
@@ -74,20 +75,20 @@ function run_tests {
7475
# them. Also error locations change so we don't run the failing tests.
7576
# We explicitly enable debug-assertions here, they are disabled by -O but we have tests
7677
# which exist to check that we panic on debug assertion failures.
77-
time MIRIFLAGS="${MIRIFLAGS-} -O -Zmir-opt-level=4 -Cdebug-assertions=yes" MIRI_SKIP_UI_CHECKS=1 ./miri test $TARGET_FLAG tests/{pass,panic}
78+
time MIRIFLAGS="${MIRIFLAGS-} -O -Zmir-opt-level=4 -Cdebug-assertions=yes" MIRI_SKIP_UI_CHECKS=1 ./miri test $FEATURES $TARGET_FLAG tests/{pass,panic}
7879
fi
7980
if [ -n "${MANY_SEEDS-}" ]; then
8081
# Run many-seeds tests. (Also tests `./miri run`.)
8182
time for FILE in tests/many-seeds/*.rs; do
82-
./miri run "-Zmiri-many-seeds=0..$MANY_SEEDS" $TARGET_FLAG "$FILE"
83+
./miri run $FEATURES "-Zmiri-many-seeds=0..$MANY_SEEDS" $TARGET_FLAG "$FILE"
8384
done
85+
# Smoke-test `./miri run --dep`.
86+
./miri run $FEATURES $TARGET_FLAG --dep tests/pass-dep/getrandom.rs
8487
fi
8588
if [ -n "${TEST_BENCH-}" ]; then
8689
# Check that the benchmarks build and run, but only once.
8790
time HYPERFINE="hyperfine -w0 -r1 --show-output" ./miri bench $TARGET_FLAG --no-install
8891
fi
89-
# Smoke-test `./miri run --dep`.
90-
./miri run $TARGET_FLAG --dep tests/pass-dep/getrandom.rs
9192

9293
## test-cargo-miri
9394
# On Windows, there is always "python", not "python3" or "python2".
@@ -149,10 +150,11 @@ case $HOST_TARGET in
149150
i686-unknown-linux-gnu)
150151
# Host
151152
MIR_OPT=1 MANY_SEEDS=64 TEST_BENCH=1 CARGO_MIRI_ENV=1 run_tests
153+
# Fully, but not officially, supported tier 2
154+
MANY_SEEDS=16 TEST_TARGET=aarch64-linux-android run_tests
152155
# Partially supported targets (tier 2)
153156
BASIC="empty_main integer heap_alloc libc-mem vec string btreemap" # ensures we have the basics: pre-main code, system allocator
154157
UNIX="hello panic/panic panic/unwind concurrency/simple atomic libc-mem libc-misc libc-random env num_cpus" # the things that are very similar across all Unixes, and hence easily supported there
155-
TEST_TARGET=aarch64-linux-android run_tests_minimal $BASIC $UNIX time hashmap random thread sync concurrency epoll eventfd prctl
156158
TEST_TARGET=wasm32-unknown-unknown run_tests_minimal no_std empty_main wasm # this target doesn't really have std
157159
TEST_TARGET=thumbv7em-none-eabihf run_tests_minimal no_std
158160
;;

etc/rust_analyzer_helix.toml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,6 @@ invocationStrategy = "once"
2727
overrideCommand = [
2828
"./miri",
2929
"check",
30-
"--no-default-features",
3130
"-Zunstable-options",
3231
"--compile-time-deps",
3332
"--message-format=json",

etc/rust_analyzer_vscode.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@
2121
"rust-analyzer.cargo.buildScripts.overrideCommand": [
2222
"./miri",
2323
"check",
24-
"--no-default-features",
2524
"-Zunstable-options",
2625
"--compile-time-deps",
2726
"--message-format=json",

etc/rust_analyzer_zed.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,6 @@
3030
"overrideCommand": [
3131
"./miri",
3232
"check",
33-
"--no-default-features",
3433
"-Zunstable-options",
3534
"--compile-time-deps",
3635
"--message-format=json"

genmc-sys/Cargo.toml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,3 +13,6 @@ cc = "1.2.16"
1313
cmake = "0.1.54"
1414
git2 = { version = "0.20.2", default-features = false, features = ["https"] }
1515
cxx-build = { version = "1.0.173", features = ["parallel"] }
16+
17+
[features]
18+
check_only = []

genmc-sys/build.rs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -202,6 +202,11 @@ fn compile_cpp_dependencies(genmc_path: &Path, always_configure: bool) {
202202
}
203203

204204
fn main() {
205+
// For check-only builds, we don't need to do anything.
206+
if cfg!(feature = "check_only") {
207+
return;
208+
}
209+
205210
// Select which path to use for the GenMC repo:
206211
let (genmc_path, always_configure) = if let Some(genmc_src_path) = option_env!("GENMC_SRC_PATH")
207212
{

miri-script/src/commands.rs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -391,7 +391,8 @@ impl Command {
391391
Ok(())
392392
}
393393

394-
fn check(features: Vec<String>, flags: Vec<String>) -> Result<()> {
394+
fn check(mut features: Vec<String>, flags: Vec<String>) -> Result<()> {
395+
features.push("check_only".into());
395396
let e = MiriEnv::new()?;
396397
e.check(".", &features, &flags)?;
397398
e.check("cargo-miri", &[], &flags)?;
@@ -405,7 +406,8 @@ impl Command {
405406
Ok(())
406407
}
407408

408-
fn clippy(features: Vec<String>, flags: Vec<String>) -> Result<()> {
409+
fn clippy(mut features: Vec<String>, flags: Vec<String>) -> Result<()> {
410+
features.push("check_only".into());
409411
let e = MiriEnv::new()?;
410412
e.clippy(".", &features, &flags)?;
411413
e.clippy("cargo-miri", &[], &flags)?;

0 commit comments

Comments
 (0)