Skip to content

Commit f45b570

Browse files
committed
Add 'src/tools/miri/' from commit '75dd959a3a40eb5b4574f8d2e23aa6efbeb33573'
git-subtree-dir: src/tools/miri git-subtree-mainline: 3f3167f git-subtree-split: 75dd959
2 parents 3f3167f + 75dd959 commit f45b570

File tree

1,196 files changed

+54796
-0
lines changed

Some content is hidden

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

1,196 files changed

+54796
-0
lines changed

src/tools/miri/.editorconfig

+25
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
# EditorConfig helps developers define and maintain consistent
2+
# coding styles between different editors and IDEs
3+
# editorconfig.org
4+
5+
root = true
6+
7+
8+
[*]
9+
end_of_line = lf
10+
charset = utf-8
11+
trim_trailing_whitespace = true
12+
insert_final_newline = true
13+
indent_style = space
14+
indent_size = 4
15+
16+
[*.rs]
17+
indent_style = space
18+
indent_size = 4
19+
20+
[*.toml]
21+
indent_style = space
22+
indent_size = 4
23+
24+
[*.md]
25+
trim_trailing_whitespace = false

src/tools/miri/.gitattributes

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
* text=auto eol=lf
2+
3+
# Older git versions try to fix line endings on images, this prevents it.
4+
*.png binary
5+
*.jpg binary
6+
*.ico binary
+156
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,156 @@
1+
name: CI
2+
3+
on:
4+
push:
5+
# Run in PRs and for bors, but not on master.
6+
branches:
7+
- 'auto'
8+
- 'try'
9+
pull_request:
10+
branches:
11+
- 'master'
12+
schedule:
13+
- cron: '5 15 * * *' # At 15:05 UTC every day.
14+
15+
jobs:
16+
build:
17+
runs-on: ${{ matrix.os }}
18+
env:
19+
RUST_BACKTRACE: 1
20+
HOST_TARGET: ${{ matrix.host_target }}
21+
strategy:
22+
matrix:
23+
build: [linux64, macos, win32]
24+
include:
25+
- build: linux64
26+
os: ubuntu-latest
27+
host_target: x86_64-unknown-linux-gnu
28+
- build: macos
29+
os: macos-latest
30+
host_target: x86_64-apple-darwin
31+
- build: win32
32+
os: windows-latest
33+
host_target: i686-pc-windows-msvc
34+
steps:
35+
- uses: actions/checkout@v3
36+
37+
- name: Set the tag GC interval to 1 on linux
38+
if: runner.os == 'Linux'
39+
run: echo "MIRIFLAGS=-Zmiri-tag-gc=1" >> $GITHUB_ENV
40+
41+
# We install gnu-tar because BSD tar is buggy on macOS builders of GHA.
42+
# See <https://github.com/actions/cache/issues/403>.
43+
- name: Install GNU tar
44+
if: runner.os == 'macOS'
45+
run: |
46+
brew install gnu-tar
47+
echo "/usr/local/opt/gnu-tar/libexec/gnubin" >> $GITHUB_PATH
48+
49+
# Cache the global cargo directory, but NOT the local `target` directory which
50+
# we cannot reuse anyway when the nightly changes (and it grows quite large
51+
# over time).
52+
- name: Add cache for cargo
53+
id: cache
54+
uses: actions/cache@v3
55+
with:
56+
path: |
57+
# Taken from <https://doc.rust-lang.org/nightly/cargo/guide/cargo-home.html#caching-the-cargo-home-in-ci>.
58+
~/.cargo/bin
59+
~/.cargo/registry/index
60+
~/.cargo/registry/cache
61+
~/.cargo/git/db
62+
# contains package information of crates installed via `cargo install`.
63+
~/.cargo/.crates.toml
64+
~/.cargo/.crates2.json
65+
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock', 'cargo-miri/src/version.rs') }}
66+
restore-keys: ${{ runner.os }}-cargo
67+
68+
- name: Install rustup-toolchain-install-master and xargo
69+
if: ${{ steps.cache.outputs.cache-hit == 'false' }}
70+
shell: bash
71+
run: |
72+
cargo install rustup-toolchain-install-master
73+
cargo install xargo
74+
75+
- name: Install "master" toolchain
76+
shell: bash
77+
run: |
78+
if [[ ${{ github.event_name }} == 'schedule' ]]; then
79+
./rustup-toolchain HEAD --host ${{ matrix.host_target }}
80+
else
81+
./rustup-toolchain "" --host ${{ matrix.host_target }}
82+
fi
83+
84+
- name: Show Rust version
85+
run: |
86+
rustup show
87+
rustc -Vv
88+
cargo -V
89+
90+
- name: Test
91+
run: bash ./ci.sh
92+
93+
style:
94+
name: style checks
95+
runs-on: ubuntu-latest
96+
steps:
97+
- uses: actions/checkout@v3
98+
- name: Install required toolchain
99+
# We need a toolchain that can actually build Miri, just a nightly won't do.
100+
run: |
101+
cargo install rustup-toolchain-install-master # TODO: cache this?
102+
./rustup-toolchain "" -c clippy
103+
- name: rustfmt
104+
run: ./miri fmt --check
105+
- name: clippy
106+
run: ./miri clippy -- -D warnings
107+
- name: rustdoc
108+
run: RUSTDOCFLAGS="-Dwarnings" cargo doc --document-private-items
109+
110+
# These jobs doesn't actually test anything, but they're only used to tell
111+
# bors the build completed, as there is no practical way to detect when a
112+
# workflow is successful listening to webhooks only.
113+
#
114+
# ALL THE PREVIOUS JOBS NEED TO BE ADDED TO THE `needs` SECTION OF THIS JOB!
115+
# (`fmt` is deliberately not listed, we want bors to ignore it.)
116+
end-success:
117+
name: bors build finished
118+
runs-on: ubuntu-latest
119+
needs: [build, style]
120+
if: github.event.pusher.name == 'bors' && success()
121+
steps:
122+
- name: mark the job as a success
123+
run: exit 0
124+
end-failure:
125+
name: bors build finished
126+
runs-on: ubuntu-latest
127+
needs: [build, style]
128+
if: github.event.pusher.name == 'bors' && (failure() || cancelled())
129+
steps:
130+
- name: mark the job as a failure
131+
run: exit 1
132+
133+
# Send a Zulip notification when a cron job fails
134+
cron-fail-notify:
135+
name: cronjob failure notification
136+
runs-on: ubuntu-latest
137+
needs: [build, style]
138+
if: github.event_name == 'schedule' && (failure() || cancelled())
139+
steps:
140+
- name: Install zulip-send
141+
run: pip3 install zulip
142+
- name: Send Zulip notification
143+
shell: bash
144+
env:
145+
ZULIP_BOT_EMAIL: ${{ secrets.ZULIP_BOT_EMAIL }}
146+
ZULIP_API_TOKEN: ${{ secrets.ZULIP_API_TOKEN }}
147+
run: |
148+
~/.local/bin/zulip-send --stream miri --subject "Cron Job Failure (miri, $(date -u +%Y-%m))" \
149+
--message 'Dear @*T-miri*,
150+
151+
It would appear that the Miri cron job build failed. Would you mind investigating this issue?
152+
153+
Thanks in advance!
154+
Sincerely,
155+
The Miri Cronjobs Bot' \
156+
--user $ZULIP_BOT_EMAIL --api-key $ZULIP_API_TOKEN --site https://rust-lang.zulipchat.com

src/tools/miri/.gitignore

+13
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
target
2+
/doc
3+
tex/*/out
4+
*.dot
5+
*.out
6+
*.rs.bk
7+
.vscode
8+
*.mm_profdata
9+
perf.data
10+
perf.data.old
11+
flamegraph.svg
12+
tests/extern-so/libtestlib.so
13+
.auto-*

src/tools/miri/.gitpod.yml

+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
image: ubuntu:latest
2+
3+
tasks:
4+
- before: echo "..."
5+
init: |
6+
cargo install rustup-toolchain-install-master
7+
./rustup-toolchain
8+
./miri build
9+
command: echo "Run tests with ./miri test"

0 commit comments

Comments
 (0)