@@ -8,10 +8,43 @@ find useful.
88Check out the issues on this GitHub repository for some ideas. In particular,
99look for the green ` E-* `  labels which mark issues that should be rather
1010well-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.
1213
1314[ Rust Zulip ] : https://rust-lang.zulipchat.com 
1415
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+ 
1548## Preparing the build environment  
1649
1750Miri heavily relies on internal and unstable rustc interfaces to execute MIR,
@@ -173,24 +206,24 @@ to `.vscode/settings.json` in your local Miri clone:
173206        " cargo-miri/Cargo.toml" 
174207        " miri-script/Cargo.toml" 
175208    ],
209+     "rust-analyzer.check.invocationLocation" : " root" 
210+     "rust-analyzer.check.invocationStrategy" : " once" 
176211    "rust-analyzer.check.overrideCommand" : [
177212        " env" 
178213        " MIRI_AUTO_OPS=no" 
179214        " ./miri" 
180-         " cargo" 
181215        " clippy" // make this `check` when working with a locally built rustc 
182216        " --message-format=json" 
183-         " --all-targets" 
184217    ],
185218    // 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" 
186221    "rust-analyzer.cargo.buildScripts.overrideCommand" : [
187222        " env" 
188223        " MIRI_AUTO_OPS=no" 
189224        " ./miri" 
190-         " cargo" 
191225        " check" 
192226        " --message-format=json" 
193-         " --all-targets" 
194227    ],
195228}
196229``` 
@@ -309,6 +342,7 @@ anyone but Miri itself. They are used to communicate between different Miri
309342binaries, and as such worth documenting:
310343
311344*  ` 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.
312346*  ` MIRI_BE_RUSTC `  can be set to ` host `  or ` target ` . It tells the Miri driver to
313347  actually not interpret the code but compile it like rustc would. With ` target ` , Miri sets
314348  some compiler flags to prepare the code for interpretation; with ` host ` , this is not done.
0 commit comments