这是indexloc提供的服务,不要输入任何密码
Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
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
5 changes: 4 additions & 1 deletion .appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@ branches:
- try

install:
# Setting build env
- set RUST_OS_NAME=Windows
# Compute the Rust version we use.
- set /p RUSTC_HASH=<rust-version
# Install Rust. We use the "stable" toolchain for better caching, it is just used to build `rustup-toolchain-install-master`.
Expand All @@ -36,7 +38,8 @@ install:
- cargo --version

test_script:
- set PYTHON=C:\msys64\mingw64\bin\python3.exe
# Add python3 path: https://www.appveyor.com/docs/windows-images-software/#python
- set PATH=C:\Python35-x64;%PATH%
- bash ci.sh

after_test:
Expand Down
95 changes: 95 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,3 +33,98 @@ jobs:
host_target: i686-pc-windows-msvc
steps:
- uses: actions/checkout@v2

- name: Setting build env
run: |
echo "RUST_OS_NAME=${{ runner.os }}" >> $GITHUB_ENV
shell: bash

# We install gnu-tar because BSD tar is buggy on Github's macos machines.
# See <https://github.com/actions/cache/issues/403>.
- name: Install GNU tar
if: runner.os == 'macOS'
run: |
brew install gnu-tar
echo "/usr/local/opt/gnu-tar/libexec/gnubin" >> $GITHUB_PATH

# Cache the global cargo directory, but NOT the local `target` directory which
# we cannot reuse anyway when the nightly changes (and it grows quite large
# over time).
- name: Add cache for cargo
uses: actions/cache@v2
with:
path: |
# to avoid saving rustup proxy, save xargo and RTIM in separate dir.
~/.cargo/ci
~/.cargo/registry
~/.cargo/git
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
restore-keys: ${{ runner.os }}-cargo

# We use the "stable" toolchain for better caching, it is just used to build `rustup-toolchain-install-master`.
# But we also need to take into account that the build cache might have a different, outdated default.
- name: Install stable Rust
run: |
# rustup toolchain uninstall beta nightly master
rustup override unset
rustup toolchain install stable
rustup default stable

- name: Install RTIM
run: |
cargo install --root ~/.cargo/ci --debug rustup-toolchain-install-master
echo "$HOME/.cargo/ci/bin" >> $GITHUB_PATH
shell: bash

- name: Install xargo
run: |
cargo install --root ~/.cargo/ci --debug xargo
shell: bash

- name: Install "master" toolchain
run: |
if [[ ${{ github.event_name }} == 'schedule' ]]; then
RUSTC_HASH=$(git ls-remote https://github.com/rust-lang/rust.git master | awk '{print $1}')
else
RUSTC_HASH=$(< rust-version)
fi
rustup-toolchain-install-master \
-f \
-n master "$RUSTC_HASH" \
-c rust-src \
-c rustc-dev \
-c llvm-tools \
--host ${{ matrix.host_target }}
rustup default master
shell: bash

- name: Inspect Rust version
run: |
rustup show
rustc -Vv
cargo -V

- name: Test
if: false
run: bash ./ci.sh

# Don't cache "master" toolchain, it's a waste.
- name: Before caching
run: |
# Binary artifacts is saved in `ci/bin` dir.
strip ~/.cargo/ci/bin/*
shell: bash

rustfmt:
runs-on: ubuntu-latest
# FIXME: the project isn't fmt-ed yet.
if: false
steps:
- uses: actions/checkout@v2
- run: rustup toolchain install stable -c rustfmt
- run: |
cargo fmt -- --check
# Some are not in cargo workspace.
git ls-files 'bench*/*.rs' | xargs rustfmt --check
git ls-files 'cargo-miri/*.rs' | xargs rustfmt --check
git ls-files 'tests*/*.rs' | xargs rustfmt --check
13 changes: 13 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,19 @@ before_script:
else
RUSTC_HASH=$(cat rust-version)
fi
# Setting build env
- |
case $TRAVIS_OS_NAME in
linux )
export RUST_OS_NAME=Linux
;;
osx )
export RUST_OS_NAME=macOS
;;
* )
echo "Doesn't know this OS"
exit 1;
esac
# Install Rust. We use the "stable" toolchain for better caching, it is just used to build `rustup-toolchain-install-master`.
# But we also need to take into account that the build cache might have a different, outdated default.
- curl https://build.travis-ci.org/files/rustup-init.sh -sSf | sh -s -- -y --default-toolchain none --profile minimal
Expand Down
8 changes: 7 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
# Miri [![Build Status](https://travis-ci.com/rust-lang/miri.svg?branch=master)](https://travis-ci.com/rust-lang/miri) [![Windows build status](https://ci.appveyor.com/api/projects/status/github/rust-lang/miri?svg=true)](https://ci.appveyor.com/project/rust-lang-libs/miri)
# Miri

[![Actions build status][actions-badge]][actions-url]
[![Travis build status](https://travis-ci.com/rust-lang/miri.svg?branch=master)](https://travis-ci.com/rust-lang/miri)
[![Appveyor Windows build status](https://ci.appveyor.com/api/projects/status/github/rust-lang/miri?svg=true)](https://ci.appveyor.com/project/rust-lang-libs/miri)

[actions-badge]: https://github.com/rust-lang/miri/workflows/CI/badge.svg?branch=master
[actions-url]: https://github.com/rust-lang/miri/actions

An experimental interpreter for [Rust][rust]'s
[mid-level intermediate representation][mir] (MIR). It can run binaries and
Expand Down
45 changes: 28 additions & 17 deletions ci.sh
Original file line number Diff line number Diff line change
Expand Up @@ -23,32 +23,43 @@ function run_tests {
fi

./miri test --locked
if ! [ -n "${MIRI_TEST_TARGET+exists}" ]; then
if [ -z "${MIRI_TEST_TARGET+exists}" ]; then
# Only for host architecture: tests with MIR optimizations
#FIXME: Only testing opt level 1 due to <https://github.com/rust-lang/rust/issues/77564>.
MIRIFLAGS="-Z mir-opt-level=1" ./miri test --locked
fi

if command -v python3; then
PYTHON=python3
else
PYTHON=python
fi

# "miri test" has built the sysroot for us, now this should pass without
# any interactive questions.
${PYTHON:-python3} test-cargo-miri/run-test.py

${PYTHON} test-cargo-miri/run-test.py
echo
}

# host
run_tests

if [ "${TRAVIS_OS_NAME:-}" == linux ]; then
MIRI_TEST_TARGET=i686-unknown-linux-gnu run_tests
MIRI_TEST_TARGET=x86_64-apple-darwin run_tests
MIRI_TEST_TARGET=i686-pc-windows-msvc run_tests
elif [ "${TRAVIS_OS_NAME:-}" == osx ]; then
MIRI_TEST_TARGET=mips64-unknown-linux-gnuabi64 run_tests # big-endian architecture
MIRI_TEST_TARGET=x86_64-pc-windows-msvc run_tests
elif [ "${CI_WINDOWS:-}" == True ]; then
MIRI_TEST_TARGET=x86_64-unknown-linux-gnu run_tests
MIRI_TEST_TARGET=x86_64-apple-darwin run_tests
else
echo "FATAL: unknown CI platform"
exit 1
fi
case $RUST_OS_NAME in
Linux)
MIRI_TEST_TARGET=i686-unknown-linux-gnu run_tests
MIRI_TEST_TARGET=x86_64-apple-darwin run_tests
MIRI_TEST_TARGET=i686-pc-windows-msvc run_tests
;;
macOS )
MIRI_TEST_TARGET=mips64-unknown-linux-gnuabi64 run_tests # big-endian architecture
MIRI_TEST_TARGET=x86_64-pc-windows-msvc run_tests
;;
Windows)
MIRI_TEST_TARGET=x86_64-unknown-linux-gnu run_tests
MIRI_TEST_TARGET=x86_64-apple-darwin run_tests
;;
* )
echo "FATAL: unknown OS"
exit 1
;;
esac