Skip to content
Merged
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
20 changes: 11 additions & 9 deletions .github/workflows/check-full.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,20 +16,22 @@ jobs:
fail-fast: false
matrix:
config:
- {os: windows-latest, r: 'release', rust: 'stable-msvc'}
- {os: macOS-latest, r: 'release', rust: 'stable' }
- {os: macos-15-intel, r: 'release', rust: 'stable' }
- {os: ubuntu-latest, r: 'release', rust: 'stable' }
- {os: ubuntu-latest, r: 'devel', rust: 'stable' }
- {os: ubuntu-latest, r: 'release', rust: 'nightly' }
- { os: "windows-latest", r: "release", rust: "stable-msvc" }
- { os: "windows-11-arm", r: "release", rust: "stable-msvc", rust_target: "aarch64-pc-windows-gnullvm"}
- { os: "macOS-latest", r: "release", rust: "stable" }
- { os: "macos-15-intel", r: "release", rust: "stable" }
- { os: "ubuntu-latest", r: "release", rust: "stable" }
- { os: "ubuntu-latest", r: "devel", rust: "stable" }
- { os: "ubuntu-latest", r: "release", rust: "nightly" }

steps:
- uses: actions/checkout@v6
- uses: actions/checkout@v7

- name: Set up Rust
uses: dtolnay/rust-toolchain@master
with:
toolchain: ${{ matrix.config.rust }}
targets: ${{ matrix.config.rust_target }}

# - name: Run cargo test
# run: cargo test --manifest-path ./src/rust/Cargo.toml
Expand All @@ -49,8 +51,8 @@ jobs:

- uses: r-lib/actions/check-r-package@v2
env:
MAKEFLAGS: -j2 # cf. https://github.com/yutannihilation/string2path/pull/149
MAKEFLAGS: -j2 # cf. https://github.com/yutannihilation/string2path/pull/149

- name: debug
run: cat ./check/*.Rcheck/00install.out
if: ${{ always() }}
if: ${{ always() }}
2 changes: 2 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# string2path (development version)

* Support ARM64 Windows (#212).

# string2path 0.3.1

* Fix Intel macOS build (#209).
Expand Down
4 changes: 4 additions & 0 deletions configure.win
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@ BEFORE_CARGO_BUILD=''
# Check the Rust installation, and abort if not available
"${R_HOME}/bin${R_ARCH_BIN}/Rscript.exe" "./tools/configure.R"

# choose the appropriate target
TARGET="$("${R_HOME}/bin${R_ARCH_BIN}/Rscript" "tools/rustarch.R")"

ret=$?

if [ $ret -ne 0 ]; then
Expand All @@ -30,6 +33,7 @@ else
fi

sed \
-e "s|@TARGET@|${TARGET}|" \
-e "s|@BEFORE_CARGO_BUILD@|${BEFORE_CARGO_BUILD}|" \
-e "s|@VENDORING@|${VENDORING}|" \
-e "s|@OFFLINE_OPTION@|${OFFLINE_OPTION}|" \
Expand Down
2 changes: 1 addition & 1 deletion src/Makevars.win.in
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
TARGET = x86_64-pc-windows-gnu
TARGET = @TARGET@

# Rtools42 doesn't have the linker in the location that cargo expects, so we
# need to overwrite it via configuration.
Expand Down
11 changes: 11 additions & 0 deletions tools/rustarch.R
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# The original file is in the hellorust pacakge by Jeroen Ooms, which is under the MIT license.
# cf. https://github.com/r-rust/hellorust/blob/master/tools/rustarch.R
arch <- if(grepl("aarch", R.version$platform)){
"aarch64-pc-windows-gnullvm"
} else if(grepl("clang", Sys.getenv('R_COMPILED_BY'))){
"x86_64-pc-windows-gnullvm"
} else {
"x86_64-pc-windows-gnu"
}

cat(arch)