From 880e6847cfb895459a183346f62767f4a9f31660 Mon Sep 17 00:00:00 2001 From: Ralf Jung Date: Sun, 10 May 2020 23:49:10 +0200 Subject: [PATCH 1/5] play with bash on AppVeyor Also consistently order and format our two CI files --- .appveyor.yml | 106 +++++++++++++++------------------------------ .travis.yml | 48 +++++++++----------- travis.sh => ci.sh | 19 ++++---- 3 files changed, 67 insertions(+), 106 deletions(-) rename travis.sh => ci.sh (73%) diff --git a/.appveyor.yml b/.appveyor.yml index 294ef26be0be..209e38dc532a 100644 --- a/.appveyor.yml +++ b/.appveyor.yml @@ -1,84 +1,50 @@ +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= Date: Mon, 11 May 2020 10:13:17 +0200 Subject: [PATCH 2/5] fix warnings for non-Unix builds --- src/shims/fs.rs | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/src/shims/fs.rs b/src/shims/fs.rs index 0de0b33fb2e2..8613f6bb0994 100644 --- a/src/shims/fs.rs +++ b/src/shims/fs.rs @@ -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); From fdebecbb086a6f1a4606d50a53231ae69eb1a47a Mon Sep 17 00:00:00 2001 From: Ralf Jung Date: Mon, 11 May 2020 10:40:25 +0200 Subject: [PATCH 3/5] fix python interpreter on Windows --- .appveyor.yml | 1 + ci.sh | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/.appveyor.yml b/.appveyor.yml index 209e38dc532a..741a1de11a80 100644 --- a/.appveyor.yml +++ b/.appveyor.yml @@ -38,6 +38,7 @@ install: - cargo --version test_script: +- set PYTHON=C:\msys64\mingw64\bin\python3.exe - bash ci.sh after_test: diff --git a/ci.sh b/ci.sh index 4bc039e607ba..ecc881919dee 100755 --- a/ci.sh +++ b/ci.sh @@ -29,7 +29,7 @@ function run_tests { 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 } From dec0bf15f67d5181917d02a469756d91059ebace Mon Sep 17 00:00:00 2001 From: Ralf Jung Date: Mon, 11 May 2020 10:59:01 +0200 Subject: [PATCH 4/5] Windows CI: rely on stable cargo --- .appveyor.yml | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/.appveyor.yml b/.appveyor.yml index 741a1de11a80..34887459f6d9 100644 --- a/.appveyor.yml +++ b/.appveyor.yml @@ -29,10 +29,8 @@ install: - rustup toolchain uninstall beta nightly - rustup update # Install "master" toolchain. -# 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.) - cargo install rustup-toolchain-install-master -- rustup-toolchain-install-master -f -n master %RUSTC_HASH% -c rust-src -c rustc-dev -c cargo +- rustup-toolchain-install-master -f -n master %RUSTC_HASH% -c rust-src -c rustc-dev - rustup default master - rustc --version - cargo --version From 131bdf88a759e3737d1eb28801e7816340f236b5 Mon Sep 17 00:00:00 2001 From: Ralf Jung Date: Mon, 11 May 2020 11:19:26 +0200 Subject: [PATCH 5/5] always lock on CI --- ci.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ci.sh b/ci.sh index ecc881919dee..a7254f2958a0 100755 --- a/ci.sh +++ b/ci.sh @@ -25,7 +25,7 @@ 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.