Skip to content

Miri subtree update #122538

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 29 commits into from
Mar 15, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
82f2f2f
simplify no-std tests
RalfJung Mar 9, 2024
ac968d4
Auto merge of #3369 - RalfJung:no-std, r=RalfJung
bors Mar 9, 2024
bfbf1d3
windows: remove support for slim rwlock
RalfJung Mar 9, 2024
1d279f1
Preparing for merge from rustc
Mar 10, 2024
bca5e33
Merge from rustc
Mar 10, 2024
2ecfbae
fmt
Mar 10, 2024
16316a9
Auto merge of #3371 - rust-lang:rustup-2024-03-10, r=saethlin
bors Mar 10, 2024
5531a80
chore: remove repetitive word
tgolang Mar 11, 2024
7a5b6eb
Auto merge of #3373 - tgolang:master, r=RalfJung
bors Mar 11, 2024
9123df0
Preparing for merge from rustc
Mar 12, 2024
19378ca
Merge from rustc
Mar 12, 2024
9b6a6b8
Auto merge of #3375 - rust-lang:rustup-2024-03-12, r=oli-obk
bors Mar 12, 2024
b6f4ff5
Auto merge of #3370 - RalfJung:windows-sync, r=RalfJung
bors Mar 12, 2024
48a19ff
Improve sysroots notification
saethlin Mar 13, 2024
34d6f07
Auto merge of #3376 - saethlin:sysroots-notification, r=saethlin
bors Mar 14, 2024
f5bb34f
Preparing for merge from rustc
Mar 14, 2024
06ca3ab
Merge from rustc
Mar 14, 2024
4cd673b
fmt
Mar 14, 2024
24071bd
Auto merge of #3378 - rust-lang:rustup-2024-03-14, r=RalfJung
bors Mar 14, 2024
915bb5b
make cron job topic names more consistent
RalfJung Mar 14, 2024
ee2bd39
Auto merge of #3380 - RalfJung:cron, r=RalfJung
bors Mar 14, 2024
1bc4d62
explain time-with-isolation test better
RalfJung Mar 14, 2024
76d364b
Auto merge of #3379 - RalfJung:time-with-isolation, r=saethlin
bors Mar 14, 2024
22f6193
Apply the same shell quoting trick we use in the URL to
saethlin Mar 14, 2024
ed9d70f
Auto merge of #3382 - saethlin:sysroots-notification, r=saethlin
bors Mar 14, 2024
3cc4059
Preparing for merge from rustc
RalfJung Mar 15, 2024
0d811d7
Merge from rustc
RalfJung Mar 15, 2024
32c734b
fmt
RalfJung Mar 15, 2024
6d9549f
Auto merge of #3383 - RalfJung:rustup, r=RalfJung
bors Mar 15, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/tools/miri/.github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,7 @@ jobs:
ZULIP_API_TOKEN: ${{ secrets.ZULIP_API_TOKEN }}
run: |
~/.local/bin/zulip-send --user $ZULIP_BOT_EMAIL --api-key $ZULIP_API_TOKEN --site https://rust-lang.zulipchat.com \
--stream miri --subject "Cron Job Failure (miri, $(date -u +%Y-%m))" \
--stream miri --subject "Miri Build Failure ($(date -u +%Y-%m))" \
--message 'Dear @*T-miri*,

It would appear that the [Miri cron job build]('"https://github.com/$GITHUB_REPOSITORY/actions/runs/$GITHUB_RUN_ID"') failed.
Expand Down
21 changes: 17 additions & 4 deletions src/tools/miri/.github/workflows/sysroots.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,25 @@ jobs:
./miri install
python3 -m pip install beautifulsoup4
./ci/build-all-targets.sh
- name: Upload build errors
# We don't want to skip this step on failure
if: always()
uses: actions/upload-artifact@v4
with:
name: failures
path: failures.tar.gz

sysroots-cron-fail-notify:
name: sysroots cronjob failure notification
runs-on: ubuntu-latest
needs: [sysroots]
if: failure() || cancelled()
steps:
# Download our build error logs
- name: Download build errors
uses: actions/download-artifact@v4
with:
name: failures
# Send a Zulip notification
- name: Install zulip-send
run: pip3 install zulip
Expand All @@ -36,11 +48,12 @@ jobs:
ZULIP_BOT_EMAIL: ${{ secrets.ZULIP_BOT_EMAIL }}
ZULIP_API_TOKEN: ${{ secrets.ZULIP_API_TOKEN }}
run: |
tar xf failures.tar.gz
ls failures
~/.local/bin/zulip-send --user $ZULIP_BOT_EMAIL --api-key $ZULIP_API_TOKEN --site https://rust-lang.zulipchat.com \
--stream miri --subject "Cron Job Failure (miri, $(date -u +%Y-%m))" \
--message 'Dear @*T-miri*,

It would appear that the [Miri sysroots cron job build]('"https://github.com/$GITHUB_REPOSITORY/actions/runs/$GITHUB_RUN_ID"') failed.
--stream miri --subject "Sysroot Build Errors ($(date -u +%Y-%m))" \
--message 'It would appear that the [Miri sysroots cron job build]('"https://github.com/$GITHUB_REPOSITORY/actions/runs/$GITHUB_RUN_ID"') failed to build these targets:
'"$(ls failures)"'

Would you mind investigating this issue?

Expand Down
2 changes: 1 addition & 1 deletion src/tools/miri/cargo-miri/src/phases.rs
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ pub fn phase_cargo_miri(mut args: impl Iterator<Item = String>) {
let target = get_arg_flag_value("--target");
let target = target.as_ref().unwrap_or(host);

// If cleaning the the target directory & sysroot cache,
// If cleaning the target directory & sysroot cache,
// delete them then exit. There is no reason to setup a new
// sysroot in this execution.
if let MiriCommand::Clean = subcommand {
Expand Down
7 changes: 5 additions & 2 deletions src/tools/miri/ci/build-all-targets.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
set -eu
set -o pipefail

# .github/workflows/sysroots.yml relies on this name this to report which sysroots didn't build
FAILS_DIR=failures

rm -rf $FAILS_DIR
Expand All @@ -13,14 +14,16 @@ PLATFORM_SUPPORT_FILE=$(rustc +miri --print sysroot)/share/doc/rust/html/rustc/p
for target in $(python3 ci/scrape-targets.py $PLATFORM_SUPPORT_FILE); do
# Wipe the cache before every build to minimize disk usage
cargo +miri miri clean
if cargo +miri miri setup --target $target 2>&1 | tee failures/$target; then
if cargo +miri miri setup --target $target 2>&1 | tee $FAILS_DIR/$target; then
# If the build succeeds, delete its output. If we have output, a build failed.
rm $FAILS_DIR/$target
fi
done

tar czf $FAILS_DIR.tar.gz $FAILS_DIR

# If the sysroot for any target fails to build, we will have a file in FAILS_DIR.
if [[ $(ls failures | wc -l) -ne 0 ]]; then
if [[ $(ls $FAILS_DIR | wc -l) -ne 0 ]]; then
echo "Sysroots for the following targets failed to build:"
ls $FAILS_DIR
exit 1
Expand Down
2 changes: 1 addition & 1 deletion src/tools/miri/rust-version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
4d4bb491b65c300835442f6cb4f34fc9a5685c26
ee03c286cfdca26fa5b2a4ee40957625d2c826ff
7 changes: 6 additions & 1 deletion src/tools/miri/src/concurrency/data_race.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1074,7 +1074,12 @@ impl VClockAlloc {
size: Size,
machine: &mut MiriMachine<'_, '_>,
) -> InterpResult<'tcx> {
self.unique_access(alloc_id, alloc_range(Size::ZERO, size), NaWriteType::Deallocate, machine)
self.unique_access(
alloc_id,
alloc_range(Size::ZERO, size),
NaWriteType::Deallocate,
machine,
)
}
}

Expand Down
3 changes: 1 addition & 2 deletions src/tools/miri/src/diagnostics.rs
Original file line number Diff line number Diff line change
Expand Up @@ -527,8 +527,7 @@ impl<'mir, 'tcx> MiriMachine<'mir, 'tcx> {
pub fn emit_diagnostic(&self, e: NonHaltingDiagnostic) {
use NonHaltingDiagnostic::*;

let stacktrace =
Frame::generate_stacktrace_from_stack(self.threads.active_thread_stack());
let stacktrace = Frame::generate_stacktrace_from_stack(self.threads.active_thread_stack());
let (stacktrace, _was_pruned) = prune_stacktrace(stacktrace, self);

let (title, diag_level) = match &e {
Expand Down
45 changes: 0 additions & 45 deletions src/tools/miri/src/shims/windows/foreign_items.rs
Original file line number Diff line number Diff line change
Expand Up @@ -297,32 +297,6 @@ pub trait EvalContextExt<'mir, 'tcx: 'mir>: crate::MiriInterpCxExt<'mir, 'tcx> {
}

// Synchronization primitives
"AcquireSRWLockExclusive" => {
let [ptr] = this.check_shim(abi, Abi::System { unwind: false }, link_name, args)?;
this.AcquireSRWLockExclusive(ptr)?;
}
"ReleaseSRWLockExclusive" => {
let [ptr] = this.check_shim(abi, Abi::System { unwind: false }, link_name, args)?;
this.ReleaseSRWLockExclusive(ptr)?;
}
"TryAcquireSRWLockExclusive" => {
let [ptr] = this.check_shim(abi, Abi::System { unwind: false }, link_name, args)?;
let ret = this.TryAcquireSRWLockExclusive(ptr)?;
this.write_scalar(ret, dest)?;
}
"AcquireSRWLockShared" => {
let [ptr] = this.check_shim(abi, Abi::System { unwind: false }, link_name, args)?;
this.AcquireSRWLockShared(ptr)?;
}
"ReleaseSRWLockShared" => {
let [ptr] = this.check_shim(abi, Abi::System { unwind: false }, link_name, args)?;
this.ReleaseSRWLockShared(ptr)?;
}
"TryAcquireSRWLockShared" => {
let [ptr] = this.check_shim(abi, Abi::System { unwind: false }, link_name, args)?;
let ret = this.TryAcquireSRWLockShared(ptr)?;
this.write_scalar(ret, dest)?;
}
"InitOnceBeginInitialize" => {
let [ptr, flags, pending, context] =
this.check_shim(abi, Abi::System { unwind: false }, link_name, args)?;
Expand All @@ -335,25 +309,6 @@ pub trait EvalContextExt<'mir, 'tcx: 'mir>: crate::MiriInterpCxExt<'mir, 'tcx> {
let result = this.InitOnceComplete(ptr, flags, context)?;
this.write_scalar(result, dest)?;
}
"SleepConditionVariableSRW" => {
let [condvar, lock, timeout, flags] =
this.check_shim(abi, Abi::System { unwind: false }, link_name, args)?;

let result = this.SleepConditionVariableSRW(condvar, lock, timeout, flags, dest)?;
this.write_scalar(result, dest)?;
}
"WakeConditionVariable" => {
let [condvar] =
this.check_shim(abi, Abi::System { unwind: false }, link_name, args)?;

this.WakeConditionVariable(condvar)?;
}
"WakeAllConditionVariable" => {
let [condvar] =
this.check_shim(abi, Abi::System { unwind: false }, link_name, args)?;

this.WakeAllConditionVariable(condvar)?;
}
"WaitOnAddress" => {
let [ptr_op, compare_op, size_op, timeout_op] =
this.check_shim(abi, Abi::System { unwind: false }, link_name, args)?;
Expand Down
Loading