From 0af7fbbf3b3e42648a85a2b0a81f63d2425dee1b Mon Sep 17 00:00:00 2001 From: Roy Ivy III Date: Sat, 28 Jul 2018 21:19:34 -0500 Subject: [PATCH 01/14] uucore: Add globbing for Windows machines --- mkmain.rs | 2 +- src/uucore/Cargo.toml | 1 + src/uucore/lib.rs | 10 ++++++++++ src/uutils/uutils.rs | 3 +-- 4 files changed, 13 insertions(+), 3 deletions(-) diff --git a/mkmain.rs b/mkmain.rs index 9270b5390..f065ea8b2 100644 --- a/mkmain.rs +++ b/mkmain.rs @@ -13,7 +13,7 @@ use uu_@UTIL_CRATE@::uumain; fn main() { uucore::panic::install_sigpipe_hook(); - let code = uumain(std::env::args().collect()); + let code = uumain(uucore::args().collect()); // Since stdout is line-buffered by default, we need to ensure any pending // writes are flushed before exiting. Ideally, this should be enforced by // each utility. diff --git a/src/uucore/Cargo.toml b/src/uucore/Cargo.toml index 3a5a09a66..c4fda8c07 100644 --- a/src/uucore/Cargo.toml +++ b/src/uucore/Cargo.toml @@ -10,6 +10,7 @@ failure_derive = { version = "0.1.1", optional = true } time = { version = "0.1.40", optional = true } data-encoding = { version = "^2.1", optional = true } libc = { version = "0.2.42", optional = true } +wild = "1.0.1" [target.'cfg(target_os = "redox")'.dependencies] termion = "1.5" diff --git a/src/uucore/lib.rs b/src/uucore/lib.rs index bfa111564..8cc7494fe 100644 --- a/src/uucore/lib.rs +++ b/src/uucore/lib.rs @@ -1,3 +1,13 @@ +extern crate wild; + +pub fn args() -> Box> { + Box::new( wild::args().map(|s| s.into_string().unwrap()) ) +} + +pub fn args_os() -> Box> { + Box::new( wild::args() ) +} + #[cfg(feature = "libc")] pub extern crate libc; #[cfg(feature = "winapi")] diff --git a/src/uutils/uutils.rs b/src/uutils/uutils.rs index 59a2d7a40..7ee823dad 100644 --- a/src/uutils/uutils.rs +++ b/src/uutils/uutils.rs @@ -13,7 +13,6 @@ include!(concat!(env!("OUT_DIR"), "/uutils_crates.rs")); use std::collections::hash_map::HashMap; use std::path::Path; -use std::env; use std::io::Write; extern crate uucore; @@ -40,7 +39,7 @@ fn main() { uucore::panic::install_sigpipe_hook(); let umap = util_map(); - let mut args: Vec = env::args().collect(); + let mut args: Vec = uucore::args().collect(); // try binary name as util name. let args0 = args[0].clone(); From 8684a148cac6c99aabb30eb3e7e55d0393c7ecba Mon Sep 17 00:00:00 2001 From: Roy Ivy III Date: Sun, 5 Aug 2018 21:54:59 -0500 Subject: [PATCH 02/14] uucore: fix: use forked 'wild' crate with case-sensitivity + API fixes --- src/uucore/Cargo.toml | 2 +- src/uucore/lib.rs | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/uucore/Cargo.toml b/src/uucore/Cargo.toml index c4fda8c07..0f49aa139 100644 --- a/src/uucore/Cargo.toml +++ b/src/uucore/Cargo.toml @@ -10,7 +10,7 @@ failure_derive = { version = "0.1.1", optional = true } time = { version = "0.1.40", optional = true } data-encoding = { version = "^2.1", optional = true } libc = { version = "0.2.42", optional = true } -wild = "1.0.1" +wild = { git = "https://gitlab.com/rivy/wild.git" } [target.'cfg(target_os = "redox")'.dependencies] termion = "1.5" diff --git a/src/uucore/lib.rs b/src/uucore/lib.rs index 8cc7494fe..f3d24d6ce 100644 --- a/src/uucore/lib.rs +++ b/src/uucore/lib.rs @@ -1,11 +1,11 @@ extern crate wild; pub fn args() -> Box> { - Box::new( wild::args().map(|s| s.into_string().unwrap()) ) + wild::args() } pub fn args_os() -> Box> { - Box::new( wild::args() ) + wild::args_os() } #[cfg(feature = "libc")] From 289c0526000e3a672b8962fd2d1a69bf78965454 Mon Sep 17 00:00:00 2001 From: Roy Ivy III Date: Mon, 3 Sep 2018 11:30:34 -0500 Subject: [PATCH 03/14] uucore: fix: use updated 'wild' crate for globbing --- src/uucore/Cargo.toml | 2 +- src/uucore/lib.rs | 6 +----- 2 files changed, 2 insertions(+), 6 deletions(-) diff --git a/src/uucore/Cargo.toml b/src/uucore/Cargo.toml index 0f49aa139..578c9eb3b 100644 --- a/src/uucore/Cargo.toml +++ b/src/uucore/Cargo.toml @@ -10,7 +10,7 @@ failure_derive = { version = "0.1.1", optional = true } time = { version = "0.1.40", optional = true } data-encoding = { version = "^2.1", optional = true } libc = { version = "0.2.42", optional = true } -wild = { git = "https://gitlab.com/rivy/wild.git" } +wild = "2.0.1" [target.'cfg(target_os = "redox")'.dependencies] termion = "1.5" diff --git a/src/uucore/lib.rs b/src/uucore/lib.rs index f3d24d6ce..cc77e9f0e 100644 --- a/src/uucore/lib.rs +++ b/src/uucore/lib.rs @@ -1,13 +1,9 @@ extern crate wild; -pub fn args() -> Box> { +pub fn args() -> impl Iterator { wild::args() } -pub fn args_os() -> Box> { - wild::args_os() -} - #[cfg(feature = "libc")] pub extern crate libc; #[cfg(feature = "winapi")] From fada9314d7057c0f29092a509aa5e0c14ea42c32 Mon Sep 17 00:00:00 2001 From: Roy Ivy III Date: Thu, 20 Sep 2018 00:39:56 -0500 Subject: [PATCH 04/14] update rust minimum version to 1.27.0 (includes testing) --- .travis.yml | 4 +++- README.md | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/.travis.yml b/.travis.yml index d55c91fbf..d05418fa0 100644 --- a/.travis.yml +++ b/.travis.yml @@ -2,6 +2,9 @@ language: rust matrix: fast_finish: true include: + - rust: 1.27.0 + os: linux + env: FEATURES='' - rust: stable os: linux env: FEATURES='' @@ -64,4 +67,3 @@ after_success: | cargo tarpaulin --out Xml bash <(curl -s https://codecov.io/bash) fi - diff --git a/README.md b/README.md index d3ccfe778..c8713e36f 100644 --- a/README.md +++ b/README.md @@ -36,7 +36,7 @@ Requirements ### Rust Version ### uutils follows Rust's release channels and is tested against stable, beta and nightly. -The current oldest supported version of the Rust compiler is `1.22.0`. +The current oldest supported version of the Rust compiler is `1.27.0`. On both Windows and Redox, only the nightly version is tested currently. From cb7a926e9a83f7f6fac18a2034960bb7f91159aa Mon Sep 17 00:00:00 2001 From: Roy Ivy III Date: Tue, 28 Aug 2018 20:39:50 -0500 Subject: [PATCH 05/14] maint: turn off cargo autotests to silence warnings --- Cargo.toml | 1 + 1 file changed, 1 insertion(+) diff --git a/Cargo.toml b/Cargo.toml index 76acc235e..8b74f668f 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -3,6 +3,7 @@ name = "uutils" version = "0.0.1" authors = [] build = "build.rs" +autotests = false [features] unix = [ From a66f7a7a536e7b752e1813d2ce3bb594444e3d76 Mon Sep 17 00:00:00 2001 From: Roy Ivy III Date: Mon, 3 Sep 2018 17:44:18 -0500 Subject: [PATCH 06/14] fix: remove deprecated 'std::ascii::AsciiExt' --- src/du/du.rs | 2 -- src/hashsum/hashsum.rs | 2 -- src/pinky/pinky.rs | 2 -- src/truncate/truncate.rs | 2 -- src/wc/wc.rs | 2 -- 5 files changed, 10 deletions(-) diff --git a/src/du/du.rs b/src/du/du.rs index ad2b5df25..08d0fff5b 100644 --- a/src/du/du.rs +++ b/src/du/du.rs @@ -14,8 +14,6 @@ extern crate time; #[macro_use] extern crate uucore; -// XXX: remove when we no longer support 1.22.0 -use std::ascii::AsciiExt; use std::collections::HashSet; use std::env; use std::fs; diff --git a/src/hashsum/hashsum.rs b/src/hashsum/hashsum.rs index e71ed4f4e..e953939e4 100644 --- a/src/hashsum/hashsum.rs +++ b/src/hashsum/hashsum.rs @@ -32,8 +32,6 @@ use regex::Regex; use sha1::Sha1; use sha2::{Sha224, Sha256, Sha384, Sha512}; use sha3::{Sha3_224, Sha3_256, Sha3_384, Sha3_512, Shake128, Shake256}; -#[allow(unused_imports)] -use std::ascii::AsciiExt; use std::fs::File; use std::io::{self, stdin, BufRead, BufReader, Read}; use std::path::Path; diff --git a/src/pinky/pinky.rs b/src/pinky/pinky.rs index e36d05f63..8e23986c6 100644 --- a/src/pinky/pinky.rs +++ b/src/pinky/pinky.rs @@ -164,8 +164,6 @@ pub trait Capitalize { impl Capitalize for str { fn capitalize(&self) -> String { - #[allow(unused_imports)] - use std::ascii::AsciiExt; self.char_indices() .fold(String::with_capacity(self.len()), |mut acc, x| { if x.0 != 0 { diff --git a/src/truncate/truncate.rs b/src/truncate/truncate.rs index ef1168daf..6386ca79e 100644 --- a/src/truncate/truncate.rs +++ b/src/truncate/truncate.rs @@ -14,8 +14,6 @@ extern crate getopts; #[macro_use] extern crate uucore; -#[allow(unused_imports)] -use std::ascii::AsciiExt; use std::fs::{metadata, File, OpenOptions}; use std::io::Result; use std::path::Path; diff --git a/src/wc/wc.rs b/src/wc/wc.rs index c7a3857f5..970016689 100644 --- a/src/wc/wc.rs +++ b/src/wc/wc.rs @@ -16,8 +16,6 @@ extern crate uucore; use getopts::{Matches, Options}; -#[allow(unused_imports)] -use std::ascii::AsciiExt; use std::fs::File; use std::io::{stdin, BufRead, BufReader, Read}; use std::path::Path; From 197bd2e10ce69f64ca1c0cc548ae8a95acb2d4fd Mon Sep 17 00:00:00 2001 From: Roy Ivy III Date: Mon, 3 Sep 2018 17:45:58 -0500 Subject: [PATCH 07/14] fix: gate unix-only macros (silences "unused" warnings) --- src/ls/ls.rs | 4 +++- src/uucore/fs.rs | 1 + tests/tests.rs | 1 + 3 files changed, 5 insertions(+), 1 deletion(-) diff --git a/src/ls/ls.rs b/src/ls/ls.rs index 7bfaf3461..d67ba6504 100644 --- a/src/ls/ls.rs +++ b/src/ls/ls.rs @@ -18,6 +18,7 @@ use pretty_bytes::converter::convert; use term_grid::{Cell, Direction, Filling, Grid, GridOptions}; use time::{strftime, Timespec}; +#[cfg(unix)] #[macro_use] extern crate lazy_static; @@ -587,11 +588,13 @@ fn color_name(name: String, typ: &str) -> String { } } +#[cfg(unix)] macro_rules! has { ($mode:expr, $perm:expr) => ( $mode & ($perm as mode_t) != 0 ) } + #[cfg(unix)] fn display_file_name( path: &Path, @@ -698,4 +701,3 @@ fn display_symlink_count(metadata: &Metadata) -> String { fn display_symlink_count(metadata: &Metadata) -> String { metadata.nlink().to_string() } - diff --git a/src/uucore/fs.rs b/src/uucore/fs.rs index 78ccfbef3..fdb82abe6 100644 --- a/src/uucore/fs.rs +++ b/src/uucore/fs.rs @@ -25,6 +25,7 @@ use std::io::Result as IOResult; use std::path::{Component, Path, PathBuf}; use std::borrow::Cow; +#[cfg(unix)] macro_rules! has { ($mode:expr, $perm:expr) => ( $mode & ($perm as u32) != 0 diff --git a/tests/tests.rs b/tests/tests.rs index 08552a4d5..5885d8f9b 100644 --- a/tests/tests.rs +++ b/tests/tests.rs @@ -1,6 +1,7 @@ #[macro_use] mod common; +#[cfg(unix)] #[macro_use] extern crate lazy_static; From a046d94e7557b52219ac245a82c54f6a25662c55 Mon Sep 17 00:00:00 2001 From: Roy Ivy III Date: Sat, 22 Sep 2018 19:11:13 -0500 Subject: [PATCH 08/14] fix: gate unix-only imports --- tests/test_cp.rs | 1 + 1 file changed, 1 insertion(+) diff --git a/tests/test_cp.rs b/tests/test_cp.rs index 82651be57..d47fbb5c9 100644 --- a/tests/test_cp.rs +++ b/tests/test_cp.rs @@ -1,4 +1,5 @@ use common::util::*; +#[cfg(not(windows))] use std::fs::set_permissions; static TEST_EXISTING_FILE: &str = "existing_file.txt"; From 16d39cafcca7f8b2f33d49bc3ef6dcc198b7ddd0 Mon Sep 17 00:00:00 2001 From: Roy Ivy III Date: Mon, 3 Sep 2018 17:50:34 -0500 Subject: [PATCH 09/14] fix: remove unused imports --- src/cp/cp.rs | 3 --- src/mkdir/mkdir.rs | 2 +- 2 files changed, 1 insertion(+), 4 deletions(-) diff --git a/src/cp/cp.rs b/src/cp/cp.rs index d8147f6ba..5179e0831 100644 --- a/src/cp/cp.rs +++ b/src/cp/cp.rs @@ -24,9 +24,6 @@ extern crate walkdir; #[cfg(unix)] extern crate xattr; -#[cfg(windows)] -use std::os::windows::io::AsRawHandle; - #[cfg(windows)] extern crate kernel32; #[cfg(windows)] diff --git a/src/mkdir/mkdir.rs b/src/mkdir/mkdir.rs index 231ce3b93..2a8b3c84a 100644 --- a/src/mkdir/mkdir.rs +++ b/src/mkdir/mkdir.rs @@ -16,7 +16,7 @@ extern crate libc; extern crate uucore; use std::fs; -use std::path::{Path, PathBuf}; +use std::path::Path; static NAME: &'static str = "mkdir"; static VERSION: &'static str = env!("CARGO_PKG_VERSION"); From c56f8f6807e6ffd4c84a20910ceb576781d997ad Mon Sep 17 00:00:00 2001 From: Roy Ivy III Date: Mon, 3 Sep 2018 17:51:20 -0500 Subject: [PATCH 10/14] fix: remove unused 'mut' --- src/cp/cp.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/cp/cp.rs b/src/cp/cp.rs index 5179e0831..b41f324b4 100644 --- a/src/cp/cp.rs +++ b/src/cp/cp.rs @@ -730,7 +730,7 @@ fn preserve_hardlinks( } #[cfg(windows)] { - let mut stat = mem::uninitialized(); + let stat = mem::uninitialized(); let handle = CreateFile2( src_path.as_ptr() as *const u16, winapi::um::winnt::GENERIC_READ, From f56a7d30bafbece908c4ecdcd5bc4256505780f3 Mon Sep 17 00:00:00 2001 From: Roy Ivy III Date: Mon, 3 Sep 2018 17:51:50 -0500 Subject: [PATCH 11/14] fix: remove unused parens --- src/cp/cp.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/cp/cp.rs b/src/cp/cp.rs index b41f324b4..ce93534fe 100644 --- a/src/cp/cp.rs +++ b/src/cp/cp.rs @@ -745,7 +745,7 @@ fn preserve_hardlinks( std::io::Error::last_os_error() ).into()); } - inode = (((*stat).nFileIndexHigh as u64) << 32 | (*stat).nFileIndexLow as u64); + inode = ((*stat).nFileIndexHigh as u64) << 32 | (*stat).nFileIndexLow as u64; nlinks = (*stat).nNumberOfLinks as u64; } From 9cbf8b5856e84e1260e8dad0a7ae6cbe31fdb7ee Mon Sep 17 00:00:00 2001 From: Roy Ivy III Date: Sat, 28 Jul 2018 21:21:37 -0500 Subject: [PATCH 12/14] maint: reduce CI config file visibility --- appveyor.yml => .appveyor.yml | 0 codecov.yml => .codecov.yml | 0 2 files changed, 0 insertions(+), 0 deletions(-) rename appveyor.yml => .appveyor.yml (100%) rename codecov.yml => .codecov.yml (100%) diff --git a/appveyor.yml b/.appveyor.yml similarity index 100% rename from appveyor.yml rename to .appveyor.yml diff --git a/codecov.yml b/.codecov.yml similarity index 100% rename from codecov.yml rename to .codecov.yml From e5f67765e3bcf7c453b57defcc9eb4c68fea8776 Mon Sep 17 00:00:00 2001 From: Roy Ivy III Date: Thu, 20 Sep 2018 12:53:49 -0500 Subject: [PATCH 13/14] fix Travis CI configuration --- .travis.yml | 39 ++++++++++++++++++++------------------- 1 file changed, 20 insertions(+), 19 deletions(-) diff --git a/.travis.yml b/.travis.yml index d05418fa0..6673c1fa9 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,22 +1,29 @@ language: rust + +rust: + - stable + - beta + +os: + - linux + - osx + +env: + # sphinx v1.8.0 is bugged & fails for linux builds; so, force specfic `sphinx` version + global: FEATURES='' TEST_INSTALL='' SPHINX_VERSIONED='sphinx==1.7.8' + matrix: + allow_failures: + - rust: nightly fast_finish: true include: - rust: 1.27.0 - os: linux - env: FEATURES='' - rust: stable os: linux - env: FEATURES='' + env: TEST_INSTALL=true - rust: stable os: osx - env: FEATURES='' - - rust: beta - os: linux - env: FEATURES='' - - rust: beta - os: osx - env: FEATURES='' + env: TEST_INSTALL=true - rust: nightly os: linux env: FEATURES=nightly @@ -26,10 +33,6 @@ matrix: - rust: nightly os: linux env: FEATURES=nightly,redox CC=x86_64-unknown-redox-gcc CARGO_ARGS='--no-default-features --target=x86_64-unknown-redox' REDOX=1 - allow_failures: - - rust: nightly - os: linux - env: FEATURES=nightly,redox CC=x86_64-unknown-redox-gcc CARGO_ARGS='--no-default-features --target=x86_64-unknown-redox' REDOX=1 cache: directories: @@ -41,20 +44,18 @@ before_install: - if [ $REDOX ]; then ./.travis/redox-toolchain.sh; fi install: - - if [ $TRAVIS_OS_NAME = linux ]; then sudo apt-get install python-pip && sudo pip install sphinx; fi + - if [ $TRAVIS_OS_NAME = linux ]; then sudo apt-get install python-pip && sudo pip install $SPHINX_VERSIONED; fi - | if [ $TRAVIS_OS_NAME = osx ]; then brew update brew upgrade python - pip3 install sphinx + pip3 install $SPHINX_VERSIONED fi script: - cargo build $CARGO_ARGS --features "$FEATURES" - if [ ! $REDOX ]; then cargo test $CARGO_ARGS --features "$FEATURES" --no-fail-fast; fi - - mkdir installdir_test - - DESTDIR=installdir_test make install - - "[ `ls installdir_test/usr/local/bin | wc -l` -gt 0 ]" + - if [ -n "$TEST_INSTALL" ]; then mkdir installdir_test; DESTDIR=installdir_test make install; [ `ls installdir_test/usr/local/bin | wc -l` -gt 0 ]; fi addons: apt: From 851f2e53234e6167388a4bcc8e418d676d61d383 Mon Sep 17 00:00:00 2001 From: Roy Ivy III Date: Fri, 21 Sep 2018 12:53:04 -0500 Subject: [PATCH 14/14] fix AppVeyor CI configuration --- .appveyor.yml | 112 ++++++++++++++++++++++++++++++++++++++------------ 1 file changed, 85 insertions(+), 27 deletions(-) diff --git a/.appveyor.yml b/.appveyor.yml index bcf2fecae..2cbfe4016 100644 --- a/.appveyor.yml +++ b/.appveyor.yml @@ -1,58 +1,116 @@ +version: "{build} ~ {branch}" + +branches: + except: + - gh-pages + os: Visual Studio 2015 +matrix: + allow_failures: + - CHANNEL: nightly + environment: + global: + FEATURES: "generic" matrix: - - TARGET: x86_64-pc-windows-msvc - MSYS_BITS: 64 + - CHANNEL: 1.27.0 + ARCH: i686 TOOLCHAIN: msvc - PLATFORM: x86_64 - - TARGET: i686-pc-windows-msvc - MSYS_BITS: 32 + - CHANNEL: stable + ARCH: i686 TOOLCHAIN: msvc - PLATFORM: i686 - - TARGET: i686-pc-windows-gnu + - CHANNEL: stable + ARCH: x86_64 + TOOLCHAIN: msvc +# - CHANNEL: beta +# ARCH: i686 +# TOOLCHAIN: msvc +# - CHANNEL: beta +# ARCH: x86_64 +# TOOLCHAIN: msvc + - CHANNEL: nightly + ARCH: i686 + TOOLCHAIN: msvc + - CHANNEL: nightly + ARCH: x86_64 + TOOLCHAIN: msvc + - CHANNEL: stable + ARCH: i686 + TOOLCHAIN: gnu + - CHANNEL: stable + ARCH: x86_64 + TOOLCHAIN: gnu +# - CHANNEL: beta +# ARCH: i686 +# TOOLCHAIN: gnu +# - CHANNEL: beta +# ARCH: x86_64 +# TOOLCHAIN: gnu + - CHANNEL: nightly + ARCH: i686 + TOOLCHAIN: gnu + - CHANNEL: nightly + ARCH: x86_64 + TOOLCHAIN: gnu + - CHANNEL: stable + ARCH: i686 + TOOLCHAIN: gnu MINGW_URL: https://sourceforge.net/projects/mingw-w64/files/Toolchains%20targetting%20Win32/Personal%20Builds/mingw-builds/4.9.2/threads-win32/dwarf/i686-4.9.2-release-win32-dwarf-rt_v4-rev4.7z/download MINGW_ARCHIVE: i686-4.9.2-release-win32-dwarf-rt_v4-rev4.7z MINGW_DIR: mingw32 DIR_TEMP_MINGW: C:\cached\mingw - - TARGET: x86_64-pc-windows-gnu - MSYS_BITS: 64 install: - - SET PATH=%PATH%;C:\Program Files (x86)\Rust\bin;C:\MinGW\bin + # force branch checkout (if knowable), then reset to the specific commit ## (can be needed for accurate code coverage info) + # * this allows later apps to see the branch name using standard `git branch` operations, yet always builds the correct specific commit + # * ref: [`@`](https://archive.is/RVpnF) + - if DEFINED APPVEYOR_REPO_BRANCH if /I "%APPVEYOR_REPO_SCM%"=="git" ( git checkout "%APPVEYOR_REPO_BRANCH%" & git reset --hard "%APPVEYOR_REPO_COMMIT%" ) + # ensure CWD is project main directory + - cd "%APPVEYOR_BUILD_FOLDER%" + # create a working area + - ps: if ( ! $env:CI_TEMP_DIR ) { $env:CI_TEMP_DIR = "${env:TEMP}\${env:APPVEYOR_JOB_ID}" ; mkdir -force $env:CI_TEMP_DIR | out-null } + - set "TARGET=%ARCH%-pc-windows-%TOOLCHAIN%" + # install `rust` via `rustup` + - call appveyor DownloadFile "https://win.rustup.rs/" -FileName "%CI_TEMP_DIR%\rustup-init.exe" + - call "%CI_TEMP_DIR%\\rustup-init.exe" -y --default-toolchain %CHANNEL% --default-host %TARGET% --no-modify-path + - set "PATH=%PATH%;%USERPROFILE%\.cargo\bin" + - rustc -vV + - cargo -vV - # Use the system msys if we can + # finalize FEATURES + - if /I "%CHANNEL%"=="nightly" set "FEATURES=nightly %FEATURES%" + + # "gnu" toolchain setup + - if /I "%TOOLCHAIN%"=="gnu" set "PATH=%PATH%;C:\MinGW\bin" + # * use the system MSYS if we can + - if /I "%TOOLCHAIN%"=="gnu" if /I "%ARCH%"=="i686" set "MSYS_BITS=32" + - if /I "%TOOLCHAIN%"=="gnu" if /I "%ARCH%"=="x86_64" set "MSYS_BITS=64" - if defined MSYS_BITS set PATH=C:\msys64\mingw%MSYS_BITS%\bin;C:\msys64\usr\bin;%PATH% - - - ps: >- - Start-FileDownload "https://static.rust-lang.org/dist/rust-nightly-${env:TARGET}.exe"; + # * specific MinGW, if specified + - ps: | if ((Test-Path Env:\MINGW_ARCHIVE) -and -not (Test-Path "${env:DIR_TEMP_MINGW}\${env:MINGW_ARCHIVE}")) { if (Test-Path "${env:DIR_TEMP_MINGW}") { rm -Recurse ${env:DIR_TEMP_MINGW}\*; } New-Item -ItemType Directory -Force -Path ${env:DIR_TEMP_MINGW} | Out-Null; $download_loc = ${env:MINGW_URL}; - Start-FileDownload $download_loc -FileName "${env:DIR_TEMP_MINGW}\${env:MINGW_ARCHIVE}"; + appveyor DownloadFile $download_loc -FileName "${env:DIR_TEMP_MINGW}\${env:MINGW_ARCHIVE}"; } - if defined MINGW_ARCHIVE 7z x -y "%DIR_TEMP_MINGW%\%MINGW_ARCHIVE%" > nul - if defined MINGW_ARCHIVE set PATH=%CD%\%MINGW_DIR%\bin;C:\msys64\usr\bin;%PATH% - - rust-nightly-%TARGET%.exe /VERYSILENT /NORESTART /DIR="C:\Program Files (x86)\Rust" - - - rustc -V - - cargo -V - - if "%TOOLCHAIN%" == "msvc" if "%PLATFORM%" == "i686" call "%VS140COMNTOOLS%\..\..\VC\vcvarsall.bat" - - if "%TOOLCHAIN%" == "msvc" if "%PLATFORM%" == "x86_64" "C:\Program Files\Microsoft SDKs\Windows\v7.1\Bin\SetEnv.cmd" /x64 - - if "%TOOLCHAIN%" == "msvc" if "%PLATFORM%" == "x86_64" call "%VS140COMNTOOLS%\..\..\VC\vcvarsall.bat" x86_amd64 + # "msvc" toolchain setup + - if "%TOOLCHAIN%" == "msvc" if "%ARCH%" == "i686" call "%VS140COMNTOOLS%\..\..\VC\vcvarsall.bat" + - if "%TOOLCHAIN%" == "msvc" if "%ARCH%" == "x86_64" "C:\Program Files\Microsoft SDKs\Windows\v7.1\Bin\SetEnv.cmd" /x64 + - if "%TOOLCHAIN%" == "msvc" if "%ARCH%" == "x86_64" call "%VS140COMNTOOLS%\..\..\VC\vcvarsall.bat" x86_amd64 artifacts: - path: target\debug\uutils.exe name: uutils.exe -build: false +build_script: + - cargo build --features "%FEATURES%" --no-default-features test_script: - - cargo test --no-fail-fast --features "nightly generic" --no-default-features - -cache: - - c:\cached + - cargo test --no-fail-fast --features "%FEATURES%" --no-default-features