Skip to content

Commit be79f47

Browse files
authored
Merge pull request #4767 from RalfJung/shim-scope
document guidelines for which shims have a place in Miri
2 parents a109785 + d6362e6 commit be79f47

1 file changed

Lines changed: 17 additions & 0 deletions

File tree

src/tools/miri/CONTRIBUTING.md

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,23 @@ process for such contributions:
6666
This process is largely informal, and its primary goal is to more clearly communicate expectations.
6767
Please get in touch with us if you have any questions!
6868

69+
## Scope of Miri shims
70+
71+
Miri has "shims" to implement functionality that is usually implemented in C libraries which are
72+
invoked from Rust code, such as opening files or spawning threads, as well as for
73+
CPU-vendor-provided SIMD intrinsics. However, the set of C functions that Rust code invokes this way
74+
is enormous, and for obvious reasons we have no intention of implementing every C API ever written
75+
in Miri.
76+
77+
At the moment, the general guideline for "could this function have a shim in Miri" is: we will
78+
generally only add shims for functions that can be implemented in a portable way using just what is
79+
provided by the Rust standard library. The function should also be reasonably widely-used in Rust
80+
code to justify the review and maintenance effort (i.e. the easier the function is to implement, the
81+
lower the barrier). Other than that, we might make exceptions for certain cases if (a) there is a
82+
good case for why Miri should support those APIs, and (b) robust and widely-used portable libraries
83+
exist in the Rust ecosystem. We will generally not add shims to Miri that would require Miri to
84+
directly interact with platform-specific APIs (such as `libc` or `windows-sys`).
85+
6986
## Preparing the build environment
7087

7188
Miri heavily relies on internal and unstable rustc interfaces to execute MIR,

0 commit comments

Comments
 (0)