rust
rust copied to clipboard
Support DirEntry metadata calls in miri
This should work as it uses lstat64 which is supported here: ~https://github.com/rust-lang/miri/blob/d9ad25ee4bbd9364c498959cdc82b5fa6c41e63c/src/shims/unix/macos/foreign_items.rs#L42~ just noticed that's macos, linux would be using statx: https://github.com/rust-lang/miri/blob/86f0e63b21721fe2c14608644f467b9cb21945eb/src/shims/unix/linux/foreign_items.rs#L112
The failing syscall is dirfd
, so maybe that should actually be added to the shims?
r? @Mark-Simulacrum
(rust-highfive has picked a reviewer for you, use r? to override)
Hey! It looks like you've submitted a new PR for the library teams!
If this PR contains changes to any rust-lang/rust
public library APIs then please comment with @rustbot label +T-libs-api -T-libs
to tag it appropriately. If this PR contains changes to any unstable APIs please edit the PR description to add a link to the relevant API Change Proposal or create one if you haven't already. If you're unsure where your change falls no worries, just leave it as is and the reviewer will take a look and make a decision to forward on if necessary.
Examples of T-libs-api
changes:
- Stabilizing library features
- Introducing insta-stable changes such as new implementations of existing stable traits on existing stable types
- Introducing new or changing existing unstable library APIs (excluding permanently unstable features / features without a tracking issue)
- Changing public documentation in ways that create new stability guarantees
- Changing observable runtime behavior of library APIs
r? @RalfJung
I can't approve miri-specific library hacks, that needs someone from the libs team. Cc @thomcc
However, from the Miri side, this is lacking tests that ensure that this actually works.
The failing syscall is dirfd, so maybe that should actually be added to the shims?
The problem is that dirfd is not exposed by the standard library, so Miri has no good way of implementing that shim in a cross-platform way.
r? @thomcc
The problem is that dirfd is not exposed by the standard library, so Miri has no good way of implementing that shim in a cross-platform way.
This would bother me more if we didn't already have both code-paths -- maintaining the miri
in the cfg does not worry me.
It is unfortunate from the perspective of having slightly inaccurate emulation on these targets, though.
However, from the Miri side, this is lacking tests that ensure that this actually works.
Hmm, this is a good point I guess. Would adding a test for this function in libstd be sufficient here?
Which libstd API function is enabled by this? The test should be added in src/tools/miri/tests/pass-dep/shims/fs.rs
.
@rustbot author
The Miri subtree was changed
cc @rust-lang/miri
@rustbot ready
Thanks. Looks good to me if @RalfJung doesn't want any changes to the tests.
@bors r=thomcc
Looks good to me
:pushpin: Commit 727335878d316f6301780d182ea14ec4fb32531d has been approved by thomcc
It is now in the queue for this repository.
:hourglass: Testing commit 727335878d316f6301780d182ea14ec4fb32531d with merge 21b246587c2687935bd6004ffa5dcc4f4dd6600d...
:sunny: Test successful - checks-actions Approved by: thomcc Pushing 21b246587c2687935bd6004ffa5dcc4f4dd6600d to master...
Finished benchmarking commit (21b246587c2687935bd6004ffa5dcc4f4dd6600d): comparison URL.
Overall result: no relevant changes - no action needed
@rustbot label: -perf-regression
Instruction count
This benchmark run did not return any relevant results for this metric.
Max RSS (memory usage)
Results
This is a less reliable metric that may be of interest but was not used to determine the overall result at the top of this comment.
mean[^1] | range | count[^2] | |
---|---|---|---|
Regressions ❌ (primary) |
- | - | 0 |
Regressions ❌ (secondary) |
- | - | 0 |
Improvements ✅ (primary) |
- | - | 0 |
Improvements ✅ (secondary) |
-2.5% | [-2.7%, -2.2%] | 2 |
All ❌✅ (primary) | - | - | 0 |
Cycles
This benchmark run did not return any relevant results for this metric.
[^1]: the arithmetic mean of the percent change [^2]: number of relevant changes