Auto merge of #1407 - RalfJung:appveyor, r=RalfJung
Share CI code between Travis and AppVeyor
This commit is contained in:
commit
10419b3f2f
4 changed files with 75 additions and 113 deletions
105
.appveyor.yml
105
.appveyor.yml
|
|
@ -1,84 +1,49 @@
|
|||
build: off # No Visual Studio auto-build.
|
||||
environment:
|
||||
global:
|
||||
PROJECT_NAME: miri
|
||||
matrix:
|
||||
- TARGET: i686-pc-windows-msvc
|
||||
global:
|
||||
PROJECT_NAME: miri
|
||||
matrix:
|
||||
- TARGET: i686-pc-windows-msvc
|
||||
matrix:
|
||||
fast_finish: true # Immediately finish build once one of the jobs fails.
|
||||
cache:
|
||||
- '%USERPROFILE%\.cargo'
|
||||
- '%USERPROFILE%\.rustup'
|
||||
|
||||
# branches to build
|
||||
branches:
|
||||
# whitelist
|
||||
only:
|
||||
- auto
|
||||
- try
|
||||
|
||||
matrix:
|
||||
fast_finish: true # set this flag to immediately finish build once one of the jobs fails.
|
||||
|
||||
cache:
|
||||
- '%USERPROFILE%\.cargo'
|
||||
- '%USERPROFILE%\.rustup'
|
||||
- auto
|
||||
- try
|
||||
|
||||
install:
|
||||
# Compute the rust version we use
|
||||
- set /p RUSTC_HASH=<rust-version
|
||||
# Install Rust
|
||||
- curl -sSf --retry 3 -o rustup-init.exe https://win.rustup.rs/
|
||||
- rustup-init.exe -y --default-host %TARGET% --default-toolchain stable --profile minimal
|
||||
- set PATH=%USERPROFILE%\.cargo\bin;%PATH%
|
||||
- rustup default stable
|
||||
- rustup toolchain uninstall beta
|
||||
- rustup update
|
||||
# Install "master" toolchain
|
||||
- cargo install rustup-toolchain-install-master
|
||||
# We need to install cargo here as well or else the DLL search path inside `cargo run`
|
||||
# will be for the wrong toolchain. (On Unix, `./miri` takes care of this, but not here.)
|
||||
- rustup-toolchain-install-master -f -n master %RUSTC_HASH% -c rust-src -c rustc-dev -c cargo
|
||||
- rustup default master
|
||||
- rustc --version
|
||||
- cargo --version
|
||||
|
||||
build_script:
|
||||
- set RUSTFLAGS=-C debug-assertions
|
||||
# Build and install miri
|
||||
- cargo build --release --all-features --all-targets --locked
|
||||
- cargo install --all-features --force --path . --locked --offline
|
||||
# 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`.
|
||||
# But we also need to take into account that the build cache might have a different, outdated default.
|
||||
- curl -sSf --retry 3 -o rustup-init.exe https://win.rustup.rs/
|
||||
- rustup-init.exe -y --default-host %TARGET% --default-toolchain none --profile minimal
|
||||
- set PATH=%USERPROFILE%\.cargo\bin;%PATH%
|
||||
- rustup default stable
|
||||
- rustup toolchain uninstall beta nightly
|
||||
- rustup update
|
||||
# Install "master" toolchain.
|
||||
- cargo install rustup-toolchain-install-master
|
||||
- rustup-toolchain-install-master -f -n master %RUSTC_HASH% -c rust-src -c rustc-dev
|
||||
- rustup default master
|
||||
- rustc --version
|
||||
- cargo --version
|
||||
|
||||
test_script:
|
||||
- set RUST_TEST_NOCAPTURE=1
|
||||
- set RUST_BACKTRACE=1
|
||||
- set CARGO_INCREMENTAL=0
|
||||
# Test host miri: 32bit Windows
|
||||
- cargo miri setup
|
||||
- set MIRI_SYSROOT=%USERPROFILE%\AppData\Local\rust-lang\miri\cache\HOST
|
||||
- cargo test --release --all-features --locked
|
||||
- cd test-cargo-miri
|
||||
- '"C:\msys64\mingw64\bin\python3.exe" run-test.py'
|
||||
- cd ..
|
||||
- ps: $env:MIRI_SYSROOT = ""
|
||||
# Test foreign miri: 64bit Linux
|
||||
- cargo miri setup --target x86_64-unknown-linux-gnu
|
||||
- set MIRI_SYSROOT=%USERPROFILE%\AppData\Local\rust-lang\miri\cache
|
||||
- set MIRI_TEST_TARGET=x86_64-unknown-linux-gnu
|
||||
- cargo test --release --all-features --locked
|
||||
- cd test-cargo-miri
|
||||
- '"C:\msys64\mingw64\bin\python3.exe" run-test.py'
|
||||
- cd ..
|
||||
- ps: $env:MIRI_SYSROOT = ""
|
||||
# Test foreign miri: 64bit macOS
|
||||
- cargo miri setup --target x86_64-apple-darwin
|
||||
- set MIRI_SYSROOT=%USERPROFILE%\AppData\Local\rust-lang\miri\cache
|
||||
- set MIRI_TEST_TARGET=x86_64-apple-darwin
|
||||
- cargo test --release --all-features --locked
|
||||
- cd test-cargo-miri
|
||||
- '"C:\msys64\mingw64\bin\python3.exe" run-test.py'
|
||||
- cd ..
|
||||
- ps: $env:MIRI_SYSROOT = ""
|
||||
- set PYTHON=C:\msys64\mingw64\bin\python3.exe
|
||||
- bash ci.sh
|
||||
|
||||
after_test:
|
||||
# Don't cache "master" toolchain, it's a waste
|
||||
- rustup default stable
|
||||
- rustup toolchain uninstall master
|
||||
# Don't cache "master" toolchain, it's a waste.
|
||||
- rustup default stable
|
||||
- rustup toolchain uninstall master
|
||||
|
||||
notifications:
|
||||
- provider: Email
|
||||
on_build_success: false
|
||||
- provider: Email
|
||||
on_build_success: false
|
||||
|
|
|
|||
48
.travis.yml
48
.travis.yml
|
|
@ -1,41 +1,40 @@
|
|||
language: generic
|
||||
os:
|
||||
- linux
|
||||
- osx
|
||||
dist: xenial
|
||||
cache:
|
||||
# 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).
|
||||
directories:
|
||||
- $HOME/.cargo
|
||||
- $HOME/.rustup
|
||||
|
||||
os:
|
||||
- linux
|
||||
- osx
|
||||
dist: xenial
|
||||
- $HOME/.cargo
|
||||
- $HOME/.rustup
|
||||
|
||||
# Run in PRs and for bors, but not on master.
|
||||
branches:
|
||||
only:
|
||||
- master
|
||||
- auto
|
||||
- try
|
||||
if: branch = auto OR branch = try OR type = pull_request OR type = cron
|
||||
|
||||
env:
|
||||
global:
|
||||
- RUST_TEST_NOCAPTURE=1
|
||||
- RUST_BACKTRACE=1
|
||||
- CARGO_INCREMENTAL=0
|
||||
|
||||
before_script:
|
||||
# Compute the rust version we use. We do not use "language: rust" to have more control here.
|
||||
# Compute the Rust version we use. We do not use "language: rust" to have more control here.
|
||||
- |
|
||||
if [[ "$TRAVIS_EVENT_TYPE" == cron ]]; then
|
||||
RUSTC_HASH=$(git ls-remote https://github.com/rust-lang/rust.git master | awk '{print $1}')
|
||||
else
|
||||
RUSTC_HASH=$(cat rust-version)
|
||||
fi
|
||||
# Install Rust ("stable" toolchain for better caching, it is just used to build rustup-toolchain-install-master)
|
||||
- curl https://build.travis-ci.org/files/rustup-init.sh -sSf | sh -s -- -y --default-toolchain stable --profile minimal
|
||||
# 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
|
||||
- export PATH=$HOME/.cargo/bin:$PATH
|
||||
- rustup default stable
|
||||
- rustup toolchain uninstall beta
|
||||
- rustup toolchain uninstall beta nightly
|
||||
- rustup update
|
||||
# Install "master" toolchain
|
||||
# Install "master" toolchain.
|
||||
- cargo install rustup-toolchain-install-master
|
||||
- travis_retry rustup-toolchain-install-master -f -n master $RUSTC_HASH -c rust-src -c rustc-dev
|
||||
- rustup default master
|
||||
|
|
@ -43,10 +42,10 @@ before_script:
|
|||
- cargo --version
|
||||
|
||||
script:
|
||||
- ./travis.sh
|
||||
- ./ci.sh
|
||||
|
||||
before_cache:
|
||||
# Don't cache "master" toolchain, it's a waste
|
||||
# Don't cache "master" toolchain, it's a waste.
|
||||
- rustup default stable
|
||||
- rustup toolchain uninstall master
|
||||
|
||||
|
|
@ -54,10 +53,5 @@ notifications:
|
|||
email:
|
||||
on_success: never
|
||||
recipients:
|
||||
- post+travis@ralfj.de
|
||||
- travis-miri@oli-obk.de
|
||||
branches:
|
||||
only:
|
||||
- master
|
||||
- auto
|
||||
- try
|
||||
- post+travis@ralfj.de
|
||||
- travis-miri@oli-obk.de
|
||||
|
|
|
|||
|
|
@ -2,8 +2,11 @@
|
|||
set -euo pipefail
|
||||
|
||||
# Determine configuration
|
||||
export CARGO_EXTRA_FLAGS="--all-features"
|
||||
export RUST_TEST_NOCAPTURE=1
|
||||
export RUST_BACKTRACE=1
|
||||
export RUSTC_EXTRA_FLAGS="-D warnings"
|
||||
export CARGO_INCREMENTAL=0
|
||||
export CARGO_EXTRA_FLAGS="--all-features"
|
||||
|
||||
# Prepare
|
||||
echo "Build and install miri"
|
||||
|
|
@ -22,28 +25,26 @@ function run_tests {
|
|||
./miri test --locked
|
||||
if ! [ -n "${MIRI_TEST_TARGET+exists}" ]; then
|
||||
# Only for host architecture: tests with MIR optimizations
|
||||
MIRI_TEST_FLAGS="-Z mir-opt-level=3" ./miri test
|
||||
MIRI_TEST_FLAGS="-Z mir-opt-level=3" ./miri test --locked
|
||||
fi
|
||||
# "miri test" has built the sysroot for us, now this should pass without
|
||||
# any interactive questions.
|
||||
test-cargo-miri/run-test.py
|
||||
${PYTHON:-python3} test-cargo-miri/run-test.py
|
||||
|
||||
echo
|
||||
}
|
||||
|
||||
# host
|
||||
run_tests
|
||||
# cross-test 32bit Linux from everywhere
|
||||
MIRI_TEST_TARGET=i686-unknown-linux-gnu run_tests
|
||||
|
||||
if [ "$TRAVIS_OS_NAME" == linux ]; then
|
||||
# cross-test 64bit macOS from Linux
|
||||
if [ "${TRAVIS_OS_NAME:-}" == linux ]; then
|
||||
MIRI_TEST_TARGET=i686-unknown-linux-gnu run_tests
|
||||
MIRI_TEST_TARGET=x86_64-apple-darwin run_tests
|
||||
# cross-test 32bit Windows from Linux
|
||||
MIRI_TEST_TARGET=i686-pc-windows-msvc run_tests
|
||||
elif [ "$TRAVIS_OS_NAME" == osx ]; then
|
||||
# cross-test 64bit Windows from macOS
|
||||
elif [ "${TRAVIS_OS_NAME:-}" == osx ]; then
|
||||
MIRI_TEST_TARGET=x86_64-pc-windows-msvc run_tests
|
||||
# cross-test 32bit GNU Windows from macOS
|
||||
MIRI_TEST_TARGET=i686-pc-windows-gnu 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
|
||||
fi
|
||||
|
|
@ -549,12 +549,12 @@ pub trait EvalContextExt<'mir, 'tcx: 'mir>: crate::MiriEvalContextExt<'mir, 'tcx
|
|||
target_op: OpTy<'tcx, Tag>,
|
||||
linkpath_op: OpTy<'tcx, Tag>
|
||||
) -> InterpResult<'tcx, i32> {
|
||||
#[cfg(target_family = "unix")]
|
||||
#[cfg(unix)]
|
||||
fn create_link(src: &Path, dst: &Path) -> std::io::Result<()> {
|
||||
std::os::unix::fs::symlink(src, dst)
|
||||
}
|
||||
|
||||
#[cfg(target_family = "windows")]
|
||||
#[cfg(windows)]
|
||||
fn create_link(src: &Path, dst: &Path) -> std::io::Result<()> {
|
||||
use std::os::windows::fs;
|
||||
if src.is_dir() {
|
||||
|
|
@ -816,7 +816,8 @@ pub trait EvalContextExt<'mir, 'tcx: 'mir>: crate::MiriEvalContextExt<'mir, 'tcx
|
|||
|
||||
this.check_no_isolation("mkdir")?;
|
||||
|
||||
let _mode = if this.tcx.sess.target.target.target_os == "macos" {
|
||||
#[cfg_attr(not(unix), allow(unused_variables))]
|
||||
let mode = if this.tcx.sess.target.target.target_os == "macos" {
|
||||
u32::from(this.read_scalar(mode_op)?.not_undef()?.to_u16()?)
|
||||
} else {
|
||||
this.read_scalar(mode_op)?.to_u32()?
|
||||
|
|
@ -824,14 +825,15 @@ pub trait EvalContextExt<'mir, 'tcx: 'mir>: crate::MiriEvalContextExt<'mir, 'tcx
|
|||
|
||||
let path = this.read_path_from_c_str(this.read_scalar(path_op)?.not_undef()?)?;
|
||||
|
||||
#[cfg_attr(not(unix), allow(unused_mut))]
|
||||
let mut builder = DirBuilder::new();
|
||||
|
||||
// If the host supports it, forward on the mode of the directory
|
||||
// (i.e. permission bits and the sticky bit)
|
||||
#[cfg(target_family = "unix")]
|
||||
#[cfg(unix)]
|
||||
{
|
||||
use std::os::unix::fs::DirBuilderExt;
|
||||
builder.mode(_mode.into());
|
||||
builder.mode(mode.into());
|
||||
}
|
||||
|
||||
let result = builder.create(path).map(|_| 0i32);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue