Skip to content

Commit 8e4455b

Browse files
committed
Auto merge of #146765 - Zalathar:rollup-ewh4s9o, r=Zalathar
Rollup of 10 pull requests Successful merges: - rust-lang/rust#146229 (Automatically switch to lto-fat when flag RUSTFLAGS="- Zautodiff=Enable" is set) - rust-lang/rust#146484 (rustdoc-search: JavaScript optimization based on Firefox Profiler output) - rust-lang/rust#146541 (std: simplify host lookup) - rust-lang/rust#146615 (rustc_codegen_llvm: Feature Conversion Tidying) - rust-lang/rust#146638 (`rustc_next_trait_solver`: canonical out of `EvalCtxt`) - rust-lang/rust#146663 (Allow windows resource compiler to be overridden) - rust-lang/rust#146691 (std: Fix WASI implementation of `remove_dir_all`) - rust-lang/rust#146709 (stdarch subtree update) - rust-lang/rust#146738 (Fix tidy spellchecking on Windows) - rust-lang/rust#146740 (miri subtree update) r? `@ghost` `@rustbot` modify labels: rollup
2 parents 7c55480 + 213d5cc commit 8e4455b

File tree

174 files changed

+7444
-1734
lines changed

Some content is hidden

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

174 files changed

+7444
-1734
lines changed

.github/workflows/ci.yml

Lines changed: 17 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -31,21 +31,22 @@ jobs:
3131
os: ubuntu-24.04-arm
3232
multiarch: armhf
3333
gcc_cross: arm-linux-gnueabihf
34-
- host_target: riscv64gc-unknown-linux-gnu
35-
os: ubuntu-latest
36-
multiarch: riscv64
37-
gcc_cross: riscv64-linux-gnu
38-
qemu: true
39-
- host_target: s390x-unknown-linux-gnu
40-
os: ubuntu-latest
41-
multiarch: s390x
42-
gcc_cross: s390x-linux-gnu
43-
qemu: true
44-
- host_target: powerpc64le-unknown-linux-gnu
45-
os: ubuntu-latest
46-
multiarch: ppc64el
47-
gcc_cross: powerpc64le-linux-gnu
48-
qemu: true
34+
# Disabled due to Ubuntu repo trouble
35+
# - host_target: riscv64gc-unknown-linux-gnu
36+
# os: ubuntu-latest
37+
# multiarch: riscv64
38+
# gcc_cross: riscv64-linux-gnu
39+
# qemu: true
40+
# - host_target: s390x-unknown-linux-gnu
41+
# os: ubuntu-latest
42+
# multiarch: s390x
43+
# gcc_cross: s390x-linux-gnu
44+
# qemu: true
45+
# - host_target: powerpc64le-unknown-linux-gnu
46+
# os: ubuntu-latest
47+
# multiarch: ppc64el
48+
# gcc_cross: powerpc64le-linux-gnu
49+
# qemu: true
4950
- host_target: aarch64-apple-darwin
5051
os: macos-latest
5152
- host_target: i686-pc-windows-msvc
@@ -67,7 +68,7 @@ jobs:
6768
- name: install multiarch
6869
if: ${{ matrix.multiarch != '' }}
6970
run: |
70-
# s390x, ppc64el need Ubuntu Ports to be in the mirror list
71+
# s390x, ppc64el, riscv64 need Ubuntu Ports to be in the mirror list
7172
sudo bash -c "echo 'https://ports.ubuntu.com/ priority:4' >> /etc/apt/apt-mirrors.txt"
7273
# Add architecture
7374
sudo dpkg --add-architecture ${{ matrix.multiarch }}

Cargo.lock

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

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ harness = false
7070

7171
[features]
7272
default = ["stack-cache", "native-lib"]
73-
genmc = ["dep:genmc-sys"] # this enables a GPL dependency!
73+
genmc = ["dep:genmc-sys"]
7474
stack-cache = []
7575
stack-cache-consistency-check = ["stack-cache"]
7676
tracing = ["serde_json"]

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -220,7 +220,7 @@ degree documented below):
220220
- `solaris` / `illumos`: maintained by @devnexen. Supports the entire test suite.
221221
- `freebsd`: maintained by @YohDeadfall and @LorrensP-2158466. Supports the entire test suite.
222222
- `android`: **maintainer wanted**. Support very incomplete, but a basic "hello world" works.
223-
- `wasi`: **maintainer wanted**. Support very incomplete, not even standard output works, but an empty `main` function works.
223+
- `wasi`: **maintainer wanted**. Support very incomplete, but a basic "hello world" works.
224224
- For targets on other operating systems, Miri might fail before even reaching the `main` function.
225225

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

ci/ci.sh

Lines changed: 10 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -137,6 +137,7 @@ function run_tests_minimal {
137137

138138
# In particular, fully cover all tier 1 targets.
139139
# We also want to run the many-seeds tests on all tier 1 targets.
140+
# We run GC_STRESS only once for each tier 1 OS.
140141
case $HOST_TARGET in
141142
x86_64-unknown-linux-gnu)
142143
# Host
@@ -147,29 +148,31 @@ case $HOST_TARGET in
147148
;;
148149
i686-unknown-linux-gnu)
149150
# Host
150-
# Without GC_STRESS as this is a slow runner.
151151
MIR_OPT=1 MANY_SEEDS=64 TEST_BENCH=1 CARGO_MIRI_ENV=1 run_tests
152152
# Partially supported targets (tier 2)
153153
BASIC="empty_main integer heap_alloc libc-mem vec string btreemap" # ensures we have the basics: pre-main code, system allocator
154154
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
155155
TEST_TARGET=aarch64-linux-android run_tests_minimal $BASIC $UNIX time hashmap random thread sync concurrency epoll eventfd
156-
TEST_TARGET=wasm32-wasip2 run_tests_minimal $BASIC wasm
156+
TEST_TARGET=wasm32-wasip2 run_tests_minimal $BASIC hello wasm
157157
TEST_TARGET=wasm32-unknown-unknown run_tests_minimal no_std empty_main wasm # this target doesn't really have std
158158
TEST_TARGET=thumbv7em-none-eabihf run_tests_minimal no_std
159159
;;
160160
aarch64-unknown-linux-gnu)
161161
# Host
162-
GC_STRESS=1 MIR_OPT=1 MANY_SEEDS=64 TEST_BENCH=1 CARGO_MIRI_ENV=1 run_tests
162+
MIR_OPT=1 MANY_SEEDS=64 TEST_BENCH=1 CARGO_MIRI_ENV=1 run_tests
163163
# Extra tier 2
164164
MANY_SEEDS=16 TEST_TARGET=arm-unknown-linux-gnueabi run_tests # 32bit ARM
165165
MANY_SEEDS=16 TEST_TARGET=aarch64-pc-windows-gnullvm run_tests # gnullvm ABI
166166
MANY_SEEDS=16 TEST_TARGET=s390x-unknown-linux-gnu run_tests # big-endian architecture of choice
167-
# Custom target JSON file
168-
TEST_TARGET=tests/x86_64-unknown-kernel.json MIRI_NO_STD=1 run_tests_minimal no_std
167+
# Not officially supported tier 2
168+
MANY_SEEDS=16 TEST_TARGET=x86_64-unknown-freebsd run_tests
169+
MANY_SEEDS=16 TEST_TARGET=i686-unknown-freebsd run_tests
169170
;;
170171
armv7-unknown-linux-gnueabihf)
171172
# Host
172-
GC_STRESS=1 MIR_OPT=1 MANY_SEEDS=64 TEST_BENCH=1 CARGO_MIRI_ENV=1 run_tests
173+
MIR_OPT=1 MANY_SEEDS=64 TEST_BENCH=1 CARGO_MIRI_ENV=1 run_tests
174+
# Custom target JSON file
175+
TEST_TARGET=tests/x86_64-unknown-kernel.json MIRI_NO_STD=1 run_tests_minimal no_std
173176
;;
174177
aarch64-apple-darwin)
175178
# Host
@@ -181,12 +184,9 @@ case $HOST_TARGET in
181184
MANY_SEEDS=16 TEST_TARGET=mips-unknown-linux-gnu run_tests # a 32bit big-endian target, and also a target without 64bit atomics
182185
MANY_SEEDS=16 TEST_TARGET=x86_64-unknown-illumos run_tests
183186
MANY_SEEDS=16 TEST_TARGET=x86_64-pc-solaris run_tests
184-
MANY_SEEDS=16 TEST_TARGET=x86_64-unknown-freebsd run_tests
185-
MANY_SEEDS=16 TEST_TARGET=i686-unknown-freebsd run_tests
186187
;;
187188
i686-pc-windows-msvc)
188189
# Host
189-
# Without GC_STRESS as this is a very slow runner.
190190
MIR_OPT=1 MANY_SEEDS=64 TEST_BENCH=1 run_tests
191191
# Extra tier 1
192192
# We really want to ensure a Linux target works on a Windows host,
@@ -195,8 +195,7 @@ case $HOST_TARGET in
195195
;;
196196
aarch64-pc-windows-msvc)
197197
# Host
198-
# Without GC_STRESS as this is a very slow runner.
199-
MIR_OPT=1 MANY_SEEDS=64 TEST_BENCH=1 CARGO_MIRI_ENV=1 run_tests
198+
GC_STRESS=1 MIR_OPT=1 MANY_SEEDS=64 TEST_BENCH=1 CARGO_MIRI_ENV=1 run_tests
200199
# Extra tier 1
201200
MANY_SEEDS=64 TEST_TARGET=i686-unknown-linux-gnu run_tests
202201
;;

doc/genmc.md

Lines changed: 34 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,7 @@ Miri-GenMC integrates that model checker into Miri.
99

1010
## Usage
1111

12-
**IMPORTANT: The license of GenMC and thus the `genmc-sys` crate in the Miri repo is currently "GPL-3.0-or-later", so a binary produced with the `genmc` feature is subject to the requirements of the GPL. As long as that remains the case, the `genmc` feature of Miri is OFF-BY-DEFAULT and must be OFF for all Miri releases.**
13-
14-
For testing/developing Miri-GenMC (while keeping in mind the licensing issues):
12+
For testing/developing Miri-GenMC:
1513
- clone the Miri repo.
1614
- build Miri-GenMC with `./miri build --features=genmc`.
1715
- OR: install Miri-GenMC in the current system with `./miri install --features=genmc`
@@ -21,7 +19,30 @@ Basic usage:
2119
MIRIFLAGS="-Zmiri-genmc" cargo miri run
2220
```
2321

24-
<!-- FIXME(genmc): explain options. -->
22+
Note that `cargo miri test` in GenMC mode is currently not supported.
23+
24+
### Supported Parameters
25+
26+
- `-Zmiri-genmc`: Enable GenMC mode (not required if any other GenMC options are used).
27+
- `-Zmiri-genmc-estimate`: This enables estimation of the concurrent execution space and verification time, before running the full verification. This should help users detect when their program is too complex to fully verify in a reasonable time. This will explore enough executions to make a good estimation, but at least 10 and at most `estimation-max` executions.
28+
- `-Zmiri-genmc-estimation-max={MAX_ITERATIONS}`: Set the maximum number of executions that will be explored during estimation (default: 1000).
29+
- `-Zmiri-genmc-print-exec-graphs={none,explored,blocked,all}`: Make GenMC print the execution graph of the program after every explored, every blocked, or after every execution (default: None).
30+
- `-Zmiri-genmc-print-exec-graphs`: Shorthand for suffix `=explored`.
31+
- `-Zmiri-genmc-print-genmc-output`: Print the output that GenMC provides. NOTE: this output is quite verbose and the events in the printed execution graph are hard to map back to the Rust code location they originate from.
32+
- `-Zmiri-genmc-log=LOG_LEVEL`: Change the log level for GenMC. Default: `warning`.
33+
- `quiet`: Disable logging.
34+
- `error`: Print errors.
35+
- `warning`: Print errors and warnings.
36+
- `tip`: Print errors, warnings and tips.
37+
- If Miri is built with debug assertions, there are additional log levels available (downgraded to `tip` without debug assertions):
38+
- `debug1`: Print revisits considered by GenMC.
39+
- `debug2`: Print the execution graph after every memory access.
40+
- `debug3`: Print reads-from values considered by GenMC.
41+
- `-Zmiri-genmc-verbose`: Show more information, such as estimated number of executions, and time taken for verification.
42+
43+
#### Regular Miri parameters useful for GenMC mode
44+
45+
- `-Zmiri-disable-weak-memory-emulation`: Disable any weak memory effects (effectively upgrading all atomic orderings in the program to `SeqCst`). This option may reduce the number of explored program executions, but any bugs related to weak memory effects will be missed. This option can help determine if an error is caused by weak memory effects (i.e., if it disappears with this option enabled).
2546

2647
<!-- FIXME(genmc): explain Miri-GenMC specific functions. -->
2748

@@ -57,6 +78,15 @@ The process for obtaining them is as follows:
5778
If you place this directory inside the Miri folder, it is recommended to call it `genmc-src` as that tells `./miri fmt` to avoid
5879
formatting the Rust files inside that folder.
5980

81+
### Formatting the C++ code
82+
83+
For formatting the C++ code we provide a `.clang-format` file in the `genmc-sys` directory.
84+
With `clang-format` installed, run this command to format the c++ files (replace the `-i` with `--dry-run` to just see the changes.):
85+
```
86+
find ./genmc-sys/cpp/ -name "*.cpp" -o -name "*.hpp" | xargs clang-format --style=file:"./genmc-sys/.clang-format" -i
87+
```
88+
NOTE: this is currently not done automatically on pull requests to Miri.
89+
6090
<!-- FIXME(genmc): explain how submitting code to GenMC should be handled. -->
6191

6292
<!-- FIXME(genmc): explain development. -->

genmc-sys/.clang-format

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
# .clang-format
2+
3+
BasedOnStyle: LLVM
4+
Standard: c++20
5+
6+
ColumnLimit: 100
7+
AllowShortFunctionsOnASingleLine: Empty
8+
AllowShortIfStatementsOnASingleLine: false
9+
AllowShortLoopsOnASingleLine: false
10+
AllowShortBlocksOnASingleLine: Empty
11+
BreakBeforeBraces: Attach
12+
13+
BinPackArguments: false
14+
BinPackParameters: false
15+
AllowAllParametersOfDeclarationOnNextLine: false
16+
AlwaysBreakAfterReturnType: None
17+
18+
# Force parameters to break and align
19+
AlignAfterOpenBracket: BlockIndent
20+
AllowAllArgumentsOnNextLine: false
21+
22+
# Spacing around braces and parentheses
23+
SpaceBeforeCtorInitializerColon: true
24+
SpaceBeforeInheritanceColon: true
25+
SpaceInEmptyBlock: false
26+
SpacesInContainerLiterals: true
27+
SpacesInParensOptions:
28+
InCStyleCasts: false
29+
InConditionalStatements: false
30+
InEmptyParentheses: false
31+
Other: false
32+
SpacesInSquareBrackets: false
33+
34+
# Brace spacing for initializers
35+
Cpp11BracedListStyle: false
36+
SpaceBeforeCpp11BracedList: true
37+
38+
# Import grouping: group standard, external, and project includes.
39+
IncludeBlocks: Regroup
40+
SortIncludes: true
41+
42+
# Granularity: sort includes per module/file.
43+
IncludeIsMainRegex: '([-_](test|unittest))?$'
44+
45+
# Miscellaneous
46+
SpaceAfterCStyleCast: true
47+
SpaceBeforeParens: ControlStatements
48+
PointerAlignment: Left
49+
IndentCaseLabels: true
50+
IndentWidth: 4
51+
TabWidth: 4
52+
UseTab: Never

genmc-sys/Cargo.toml

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,15 @@
11
[package]
22
authors = ["Miri Team"]
3-
# The parts in this repo are MIT OR Apache-2.0, but we are linking in
4-
# code from https://github.com/MPI-SWS/genmc which is GPL-3.0-or-later.
5-
license = "(MIT OR Apache-2.0) AND GPL-3.0-or-later"
3+
license = "MIT OR Apache-2.0"
64
name = "genmc-sys"
75
version = "0.1.0"
86
edition = "2024"
97

108
[dependencies]
11-
cxx = { version = "1.0.160", features = ["c++20"] }
9+
cxx = { version = "1.0.173", features = ["c++20"] }
1210

1311
[build-dependencies]
1412
cc = "1.2.16"
1513
cmake = "0.1.54"
1614
git2 = { version = "0.20.2", default-features = false, features = ["https"] }
17-
cxx-build = { version = "1.0.160", features = ["parallel"] }
15+
cxx-build = { version = "1.0.173", features = ["parallel"] }

0 commit comments

Comments
 (0)