@@ -8,10 +8,43 @@ find useful.
8
8
Check out the issues on this GitHub repository for some ideas. In particular,
9
9
look for the green ` E-* ` labels which mark issues that should be rather
10
10
well-suited for onboarding. For more ideas or help with hacking on Miri, you can
11
- contact us (` oli-obk ` and ` RalfJ ` ) on the [ Rust Zulip] .
11
+ contact us on the [ Rust Zulip] . See the [ Rust website] ( https://www.rust-lang.org/governance/teams/compiler#team-miri )
12
+ for a list of Miri maintainers.
12
13
13
14
[ Rust Zulip ] : https://rust-lang.zulipchat.com
14
15
16
+ ### Larger-scale contributions
17
+
18
+ If you are thinking about making a larger-scale contribution -- in particular anything that needs
19
+ more than can reasonably fit in a single PR to be feature-complete -- then please talk to us before
20
+ writing significant amounts of code. Generally, we will ask that you follow a three-step "project"
21
+ process for such contributions:
22
+
23
+ 1 . Clearly define the ** goal** of the project. This defines the scope of the project, i.e. which
24
+ part of which APIs should be supported. If this involves functions that expose a big API surface
25
+ with lots of flags, the project may want to support only a tiny subset of flags; that should be
26
+ documented. A good way to express the goal is with one or more test cases that Miri should be
27
+ able to successfully execute when the project is completed. It is a good idea to get feedback
28
+ from team members already at this stage to ensure that the project is reasonably scoped and
29
+ aligns with our interests.
30
+ 2 . Make a ** design** for how to realize the goal. A larger project will likely have to do global
31
+ changes to Miri, like adding new global state to the ` Machine ` type or new methods to the
32
+ ` FileDescription ` trait. Often we have to iterate on those changes, which can quite substantially
33
+ change how the final implementation looks like.
34
+
35
+ The design should be reasonably concrete, i.e. for new global state or methods the corresponding
36
+ Rust types and method signatures should be spelled out. We realize that it can be hard to make a
37
+ design without doing implementation work, in particular if you are not yet familiar with the
38
+ codebase. Doing draft implementations in phase 2 of this process is perfectly fine, just please
39
+ be aware that we might request fundamental changes that can require significantly reworking what
40
+ you already did. If you open a PR in this stage, please clearly indicate that this project is
41
+ still in the design stage.
42
+
43
+ 3 . Finish the ** implementation** and have it reviewed.
44
+
45
+ This process is largely informal, and its primary goal is to more clearly communicate expectations.
46
+ Please get in touch with us if you have any questions!
47
+
15
48
## Preparing the build environment
16
49
17
50
Miri heavily relies on internal and unstable rustc interfaces to execute MIR,
@@ -173,24 +206,24 @@ to `.vscode/settings.json` in your local Miri clone:
173
206
" cargo-miri/Cargo.toml" ,
174
207
" miri-script/Cargo.toml" ,
175
208
],
209
+ "rust-analyzer.check.invocationLocation" : " root" ,
210
+ "rust-analyzer.check.invocationStrategy" : " once" ,
176
211
"rust-analyzer.check.overrideCommand" : [
177
212
" env" ,
178
213
" MIRI_AUTO_OPS=no" ,
179
214
" ./miri" ,
180
- " cargo" ,
181
215
" clippy" , // make this `check` when working with a locally built rustc
182
216
" --message-format=json" ,
183
- " --all-targets" ,
184
217
],
185
218
// Contrary to what the name suggests, this also affects proc macros.
219
+ "rust-analyzer.cargo.buildScripts.invocationLocation" : " root" ,
220
+ "rust-analyzer.cargo.buildScripts.invocationStrategy" : " once" ,
186
221
"rust-analyzer.cargo.buildScripts.overrideCommand" : [
187
222
" env" ,
188
223
" MIRI_AUTO_OPS=no" ,
189
224
" ./miri" ,
190
- " cargo" ,
191
225
" check" ,
192
226
" --message-format=json" ,
193
- " --all-targets" ,
194
227
],
195
228
}
196
229
```
@@ -309,6 +342,7 @@ anyone but Miri itself. They are used to communicate between different Miri
309
342
binaries, and as such worth documenting:
310
343
311
344
* ` CARGO_EXTRA_FLAGS ` is understood by ` ./miri ` and passed to all host cargo invocations.
345
+ It is reserved for CI usage; setting the wrong flags this way can easily confuse the script.
312
346
* ` MIRI_BE_RUSTC ` can be set to ` host ` or ` target ` . It tells the Miri driver to
313
347
actually not interpret the code but compile it like rustc would. With ` target ` , Miri sets
314
348
some compiler flags to prepare the code for interpretation; with ` host ` , this is not done.
0 commit comments