Skip to content

Commit f0db863

Browse files
author
The rustc-josh-sync Cronjob Bot
committed
Merge ref '82310651b93a' from rust-lang/rust
Pull recent changes from https://github.com/rust-lang/rust via Josh. Upstream ref: 82310651b93a594a3fd69015e1562186a080d94c Filtered ref: e13c0be8f13737c64082b89ce834546079767ac4 This merge was created using https://github.com/rust-lang/josh-sync.
2 parents b051872 + c0dcba2 commit f0db863

File tree

693 files changed

+5648
-2598
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

693 files changed

+5648
-2598
lines changed

.github/workflows/ci.yml

Lines changed: 62 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -13,35 +13,82 @@ defaults:
1313
shell: bash
1414

1515
jobs:
16-
build:
16+
test:
17+
name: test (${{ matrix.host_target }})
1718
strategy:
1819
fail-fast: false
1920
matrix:
2021
include:
21-
- os: ubuntu-latest
22-
host_target: x86_64-unknown-linux-gnu
23-
- os: macos-14
24-
host_target: aarch64-apple-darwin
25-
- os: windows-latest
26-
host_target: i686-pc-windows-msvc
22+
- host_target: x86_64-unknown-linux-gnu
23+
os: ubuntu-latest
24+
- host_target: i686-unknown-linux-gnu
25+
os: ubuntu-latest
26+
multiarch: i386
27+
gcc_cross: i686-linux-gnu
28+
- host_target: aarch64-unknown-linux-gnu
29+
os: ubuntu-24.04-arm
30+
- host_target: armv7-unknown-linux-gnueabihf
31+
os: ubuntu-24.04-arm
32+
multiarch: armhf
33+
gcc_cross: arm-linux-gnueabihf
34+
- host_target: riscv64gc-unknown-linux-gnu
35+
os: ubuntu-latest
36+
multiarch: riscv64
37+
gcc_cross: riscv64-linux-gnu
38+
qemu: true
39+
- host_target: s390x-unknown-linux-gnu
40+
os: ubuntu-latest
41+
multiarch: s390x
42+
gcc_cross: s390x-linux-gnu
43+
qemu: true
44+
- host_target: aarch64-apple-darwin
45+
os: macos-latest
46+
- host_target: i686-pc-windows-msvc
47+
os: windows-latest
2748
runs-on: ${{ matrix.os }}
2849
env:
2950
HOST_TARGET: ${{ matrix.host_target }}
3051
steps:
3152
- uses: actions/checkout@v4
53+
- name: install qemu
54+
if: ${{ matrix.qemu }}
55+
run: sudo apt install qemu-user qemu-user-binfmt
56+
- name: install multiarch
57+
if: ${{ matrix.multiarch != '' }}
58+
run: |
59+
# s390x, ppc64el need Ubuntu Ports to be in the mirror list
60+
sudo bash -c "echo 'https://ports.ubuntu.com/ priority:4' >> /etc/apt/apt-mirrors.txt"
61+
# Add architecture
62+
sudo dpkg --add-architecture ${{ matrix.multiarch }}
63+
sudo apt update
64+
# Install needed packages
65+
sudo apt install $(echo "libatomic1: zlib1g-dev:" | sed 's/:/:${{ matrix.multiarch }}/g')
3266
- uses: ./.github/workflows/setup
3367
with:
3468
toolchain_flags: "--host ${{ matrix.host_target }}"
3569

36-
# The `style` job only runs on Linux; this makes sure the Windows-host-specific
37-
# code is also covered by clippy.
38-
- name: Check clippy
39-
if: ${{ matrix.os == 'windows-latest' }}
40-
run: ./miri clippy -- -D warnings
70+
# We set up the cross-compiler *after* the basic setup as setting CC would otherwise
71+
# cause confusion.
72+
- name: install gcc-cross
73+
if: ${{ matrix.gcc_cross != '' }}
74+
run: |
75+
sudo apt install gcc-${{ matrix.gcc_cross }}
76+
echo "Setting environment variables:"
77+
echo "CC_${{ matrix.host_target }}=${{ matrix.gcc_cross }}-gcc" | tee -a $GITHUB_ENV
78+
TARGET_UPPERCASE=$(echo ${{ matrix.host_target }} | tr '[:lower:]-' '[:upper:]_')
79+
echo "CARGO_TARGET_${TARGET_UPPERCASE}_LINKER=${{ matrix.gcc_cross }}-gcc" | tee -a $GITHUB_ENV
4180
42-
- name: Test Miri
81+
# The main test job! We don't run this in qemu as that is quite slow,
82+
# so those targets only get the clippy check below.
83+
- name: test Miri
84+
if: ${{ !matrix.qemu }}
4385
run: ./ci/ci.sh
4486

87+
# The `style` job only runs on Linux; this makes sure the host-specific
88+
# code is also covered by clippy.
89+
- name: clippy
90+
run: ./miri clippy -- -D warnings
91+
4592
style:
4693
name: style checks
4794
runs-on: ubuntu-latest
@@ -51,8 +98,6 @@ jobs:
5198

5299
- name: rustfmt
53100
run: ./miri fmt --check
54-
- name: clippy
55-
run: ./miri clippy -- -D warnings
56101
- name: clippy (no features)
57102
run: ./miri clippy --no-default-features -- -D warnings
58103
- name: clippy (all features)
@@ -73,7 +118,7 @@ jobs:
73118
# ALL THE PREVIOUS JOBS NEED TO BE ADDED TO THE `needs` SECTION OF THIS JOB!
74119
# And they should be added below in `cron-fail-notify` as well.
75120
conclusion:
76-
needs: [build, style, coverage]
121+
needs: [test, style, coverage]
77122
# We need to ensure this job does *not* get skipped if its dependencies fail,
78123
# because a skipped job is considered a success by GitHub. So we have to
79124
# overwrite `if:`. We use `!cancelled()` to ensure the job does still not get run
@@ -135,7 +180,7 @@ jobs:
135180
cron-fail-notify:
136181
name: cronjob failure notification
137182
runs-on: ubuntu-latest
138-
needs: [build, style, coverage]
183+
needs: [test, style, coverage]
139184
if: ${{ github.event_name == 'schedule' && failure() }}
140185
steps:
141186
# Send a Zulip notification

.github/workflows/setup/action.yml

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ name: "Miri CI setup"
22
description: "Sets up Miri CI"
33
inputs:
44
toolchain_flags:
5+
description: extra flags to pass to rustup-toolchain-install-master
56
required: false
67
default: ''
78
runs:
@@ -31,18 +32,15 @@ runs:
3132
~/.cargo/bin
3233
~/.cargo/.crates.toml
3334
~/.cargo/.crates2.json
34-
key: cargo-${{ runner.os }}-${{ hashFiles('**/Cargo.lock', '.github/workflows/**/*.yml') }}
35-
restore-keys: cargo-${{ runner.os }}
35+
# Bump the version when something here changes that needs a cache reset.
36+
key: cargo-${{ runner.os }}-${{ runner.arch }}-${{ hashFiles('**/Cargo.lock') }}-v1
37+
restore-keys: cargo-${{ runner.os }}-${{ runner.arch }}
3638

37-
- name: Install rustup-toolchain-install-master
39+
- name: Install the tools we need
3840
if: steps.cache.outputs.cache-hit != 'true'
3941
run: cargo install -f rustup-toolchain-install-master hyperfine
4042
shell: bash
4143

42-
- name: Install nightly toolchain
43-
run: rustup toolchain install nightly --profile minimal
44-
shell: bash
45-
4644
- name: Install "master" toolchain
4745
run: |
4846
if [[ ${{ github.event_name }} == 'schedule' ]]; then

CONTRIBUTING.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -158,6 +158,15 @@ compiler that has `debug=true` set in `bootstrap.toml`.
158158
You can set `MIRI_BACKTRACE=1` to get a backtrace of where an
159159
evaluation error was originally raised.
160160

161+
#### Tracing
162+
163+
You can generate a Chrome trace file from a Miri execution by passing `--features=tracing` during the
164+
build and then setting `MIRI_TRACING=1` when running Miri. This will generate a `.json` file that
165+
you can visualize in [Perfetto](https://ui.perfetto.dev/). For example:
166+
167+
```sh
168+
MIRI_TRACING=1 ./miri run --features=tracing tests/pass/hello.rs
169+
```
161170

162171
### UI testing
163172

0 commit comments

Comments
 (0)