Skip to content

Commit

Permalink
support aarch64-pc-windows-msvc (#12)
Browse files Browse the repository at this point in the history
  • Loading branch information
mykmelez authored and XAMPPRocky committed Jun 11, 2019
1 parent 6e0fae3 commit 5e3f71b
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 9 deletions.
34 changes: 27 additions & 7 deletions appveyor.yml
Original file line number Diff line number Diff line change
@@ -1,38 +1,53 @@
environment:
global:
HOST: x86_64-pc-windows-msvc
RUST_VERSION: stable
CRATE_NAME: remove_dir_all
matrix:
# MinGW
- TARGET: i686-pc-windows-gnu
HOST: i686-pc-windows-gnu
- TARGET: x86_64-pc-windows-gnu
HOST: x86_64-pc-windows-gnu

# MSVC
- TARGET: i686-pc-windows-msvc
- TARGET: x86_64-pc-windows-msvc
- TARGET: aarch64-pc-windows-msvc
APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2017

# Testing other channels
# Beta channel
- TARGET: i686-pc-windows-gnu
HOST: i686-pc-windows-gnu
RUST_VERSION: beta
- TARGET: x86_64-pc-windows-gnu
HOST: x86_64-pc-windows-gnu
RUST_VERSION: beta

- TARGET: i686-pc-windows-msvc
RUST_VERSION: beta
- TARGET: x86_64-pc-windows-msvc
RUST_VERSION: beta
- TARGET: aarch64-pc-windows-msvc
RUST_VERSION: beta
APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2017

# Nightly channel
- TARGET: i686-pc-windows-gnu
HOST: i686-pc-windows-gnu
RUST_VERSION: nightly
- TARGET: x86_64-pc-windows-gnu
HOST: x86_64-pc-windows-gnu
RUST_VERSION: nightly

- TARGET: i686-pc-windows-msvc
RUST_VERSION: nightly
- TARGET: x86_64-pc-windows-msvc
RUST_VERSION: nightly
- TARGET: aarch64-pc-windows-msvc
RUST_VERSION: nightly
APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2017

matrix:
allow_failures:
Expand All @@ -46,17 +61,22 @@ install:
$Env:PATH += ';C:\msys64\mingw32\bin'
}
- curl -sSf -o rustup-init.exe https://win.rustup.rs/
- rustup-init.exe -y --default-host %TARGET% --default-toolchain %RUST_VERSION%
- rustup-init.exe -y --default-host %HOST% --default-toolchain %RUST_VERSION%
- set PATH=%PATH%;C:\Users\appveyor\.cargo\bin
- rustup target install %TARGET%
- rustc -Vv
- cargo -V
build_script:
- cargo build --target %TARGET% &&
cargo build --target %TARGET% --release
# TODO This is the "test phase", tweak it as you see fit
test_script:
# we don't run the "test phase" when doing deploys
# we don't run the "test phase" when doing deploys, nor do we run it
# when the target is aarch64-pc-windows-msvc, since the Appveyor image
# can't execute that target's executables
- if [%APPVEYOR_REPO_TAG%]==[false] (
cargo build --target %TARGET% &&
cargo build --target %TARGET% --release &&
cargo test --target %TARGET% &&
cargo test --target %TARGET% --release
if not [%TARGET%]==[aarch64-pc-windows-msvc] (
cargo test --target %TARGET% &&
cargo test --target %TARGET% --release
)
)
build: false
6 changes: 4 additions & 2 deletions src/fs.rs
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,11 @@ struct RmdirContext<'a> {
/// ```rust
/// extern crate remove_dir_all;
///
/// use std::fs;
/// use remove_dir_all::*;
///
/// fn main() {
/// fs::create_dir("./temp/").unwrap();
/// remove_dir_all("./temp/").unwrap();
/// }
/// ```
Expand Down Expand Up @@ -166,9 +168,9 @@ fn move_item(file: &File, ctx: &mut RmdirContext) -> io::Result<()> {
fn rename(file: &File, new: &Path, replace: bool) -> io::Result<()> {
// &self must be opened with DELETE permission
use std::iter;
#[cfg(target_arch = "x86")]
#[cfg(target_pointer_width = "32")]
const STRUCT_SIZE: usize = 12;
#[cfg(target_arch = "x86_64")]
#[cfg(target_pointer_width = "64")]
const STRUCT_SIZE: usize = 20;

// FIXME: check for internal NULs in 'new'
Expand Down

0 comments on commit 5e3f71b

Please sign in to comment.