From 208d66c89cd4b7d3521d03ef23e2cebd5e44f467 Mon Sep 17 00:00:00 2001 From: Mossa Date: Wed, 24 Apr 2024 19:45:25 +0200 Subject: [PATCH 1/7] updated path --- .github/workflows/test.yml | 46 +++++++++++++++++++++++++------------- 1 file changed, 30 insertions(+), 16 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index b8da3b17..2a966c33 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -55,12 +55,11 @@ jobs: # - emit-bindings: If 'true', emit bindings. In principle, we choose # only one stable Rust toolchain per combination of a platform and # an R version (e.g. Windows and R-release) to emit bindings. - - {os: windows-latest, r: 'release', rust-version: 'stable-msvc', target: 'x86_64-pc-windows-gnu', rtools-version: '43', emit-bindings: 'true'} - - {os: windows-latest, r: 'release', rust-version: 'nightly-msvc', target: 'x86_64-pc-windows-gnu', rtools-version: '43'} - - {os: windows-latest, r: 'devel', rust-version: 'stable-msvc', target: 'x86_64-pc-windows-gnu', rtools-version: '44', emit-bindings: 'true'} - - {os: windows-latest, r: 'release', rust-version: 'stable-gnu', target: 'x86_64-pc-windows-gnu', rtools-version: '43'} - - {os: windows-latest, r: 'oldrel', rust-version: 'stable-msvc', target: 'x86_64-pc-windows-gnu', rtools-version: '42', emit-bindings: 'true'} - + - {os: windows-latest, r: 'release', rust-version: 'stable-msvc', target: 'x86_64-pc-windows-gnu', emit-bindings: 'true'} + - {os: windows-latest, r: 'release', rust-version: 'nightly-msvc', target: 'x86_64-pc-windows-gnu'} + - {os: windows-latest, r: 'devel', rust-version: 'stable-msvc', target: 'x86_64-pc-windows-gnu', emit-bindings: 'true'} + - {os: windows-latest, r: 'release', rust-version: 'stable-gnu', target: 'x86_64-pc-windows-gnu'} + - {os: windows-latest, r: 'oldrel', rust-version: 'stable-msvc', target: 'x86_64-pc-windows-gnu', emit-bindings: 'true'} - {os: macOS-latest, r: 'release', rust-version: 'nightly'} - {os: macOS-latest, r: 'devel', rust-version: 'stable', emit-bindings: 'true'} @@ -106,7 +105,6 @@ jobs: with: r-version: ${{ matrix.config.r }} use-public-rspm: true - rtools-version: ${{ matrix.config.rtools-version }} - name: Set up Rust uses: dtolnay/rust-toolchain@master @@ -135,15 +133,33 @@ jobs: echo "LIBRARY_PATH=${pwd_slash}/libgcc_mock" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append # Add R bin path to PATH - echo "$(Rscript.exe -e 'cat(normalizePath(R.home()))')\bin\x64" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append ; + echo "$(Rscript.exe --vanilla -e 'cat(normalizePath(R.home()))')\bin\x64" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append ; # Add Rtools' GCC to PATH - if ($env:RTOOLS_VERSION -eq '44') { - $mingw_root = "C:\rtools44\x86_64-w64-mingw32.static.posix" - } elseif ($env:RTOOLS_VERSION -eq '43') { - $mingw_root = "C:\rtools43\x86_64-w64-mingw32.static.posix" - } elseif ($env:RTOOLS_VERSION -eq '42') { - $mingw_root = "C:\rtools42\x86_64-w64-mingw32.static.posix" + # Source: https://github.com/r-lib/actions/blob/b7e68d63e51bdf225997973e2add36d551f60f02/setup-r/lib/installer.js#L471 + $directories = @( + "C:\rtools44-aarch64\aarch64-w64-mingw32.static.posix" + "C:\rtools44\x86_64-w64-mingw32.static.posix", + "C:\rtools43\x86_64-w64-mingw32.static.posix", + "C:\rtools42\x86_64-w64-mingw32.static.posix", + "C:\rtools40\ucrt64", + "C:\Rtools\mingw_64", + ) + + $mingw_root = $null + foreach ($dir in $directories) { + if (Test-Path $dir) { + $mingw_root = $dir + Write-Host "Found Rtools at directory at: $mingw_root" + break + } + } + echo "MINGW_ROOT=$mingw_root" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append + + if ($null -eq $mingw_root) { + Write-Host "No Rtools directory found." + } else { + Write-Host "Mingw root set to: $mingw_root" } echo "$mingw_root\bin" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append @@ -151,8 +167,6 @@ jobs: echo "LIBRSYS_LIBCLANG_INCLUDE_PATH=$mingw_root\include" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append env: RUST_TARGET: ${{ matrix.config.target }} - RTOOLS_VERSION: ${{ matrix.config.rtools-version }} - # macOS configurations, mainly llvm and path to libclang # Because of this R installation issue on macOS-11.0 From 4ec65d562e729056a164d824f1f759f3576d08a9 Mon Sep 17 00:00:00 2001 From: Mossa Date: Wed, 24 Apr 2024 19:52:39 +0200 Subject: [PATCH 2/7] minor --- .github/workflows/test.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 2a966c33..dc02f950 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -138,12 +138,12 @@ jobs: # Add Rtools' GCC to PATH # Source: https://github.com/r-lib/actions/blob/b7e68d63e51bdf225997973e2add36d551f60f02/setup-r/lib/installer.js#L471 $directories = @( - "C:\rtools44-aarch64\aarch64-w64-mingw32.static.posix" + "C:\rtools44-aarch64\aarch64-w64-mingw32.static.posix", "C:\rtools44\x86_64-w64-mingw32.static.posix", "C:\rtools43\x86_64-w64-mingw32.static.posix", "C:\rtools42\x86_64-w64-mingw32.static.posix", "C:\rtools40\ucrt64", - "C:\Rtools\mingw_64", + "C:\Rtools\mingw_64" ) $mingw_root = $null From c9472ced26adb7d0200145eee3cf421702c89f22 Mon Sep 17 00:00:00 2001 From: Mossa Date: Mon, 22 Apr 2024 10:21:52 +0200 Subject: [PATCH 3/7] added aarch64-pc-windows-gnullvm target add both `devel` and `release` --- .github/workflows/test.yml | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index dc02f950..15ca63e3 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -66,8 +66,11 @@ jobs: - {os: macOS-latest, r: 'oldrel', rust-version: 'stable', emit-bindings: 'true'} - {os: macOS-latest, r: 'release', rust-version: 'stable', emit-bindings: 'true'} - {os: macOS-latest, r: 'release', rust-version: 'stable', target: 'x86_64-apple-darwin', skip-tests: 'true', emit-bindings: 'true'} - - + - {os: windows-latest, r: 'release', rust-version: 'stable', target: 'aarch64-pc-windows-gnullvm', skip-tests: 'true', emit-bindings: 'true'} + - {os: windows-latest, r: 'release', rust-version: 'stable', target: 'x86_64-pc-windows-gnullvm', skip-tests: 'true', emit-bindings: 'true'} + - {os: windows-latest, r: 'devel', rust-version: 'stable', target: 'aarch64-pc-windows-gnullvm', skip-tests: 'true', emit-bindings: 'true'} + - {os: windows-latest, r: 'devel', rust-version: 'stable', target: 'x86_64-pc-windows-gnullvm', skip-tests: 'true', emit-bindings: 'true'} + - {os: ubuntu-latest, r: 'release', rust-version: 'nightly'} - {os: ubuntu-latest, r: 'release', rust-version: 'stable', emit-bindings: 'true'} - {os: ubuntu-latest, r: 'release', rust-version: 'stable', target: 'aarch64-unknown-linux-gnu', skip-tests: 'true', emit-bindings: 'true'} From 7d31211a43e7218e43b98db1b752bd99822a9f6f Mon Sep 17 00:00:00 2001 From: Mossa Date: Mon, 22 Apr 2024 10:35:53 +0200 Subject: [PATCH 4/7] WARNING: Re-enable disabled CI steps here! --- .github/workflows/test.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 15ca63e3..2b23a4c0 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -66,10 +66,10 @@ jobs: - {os: macOS-latest, r: 'oldrel', rust-version: 'stable', emit-bindings: 'true'} - {os: macOS-latest, r: 'release', rust-version: 'stable', emit-bindings: 'true'} - {os: macOS-latest, r: 'release', rust-version: 'stable', target: 'x86_64-apple-darwin', skip-tests: 'true', emit-bindings: 'true'} - - {os: windows-latest, r: 'release', rust-version: 'stable', target: 'aarch64-pc-windows-gnullvm', skip-tests: 'true', emit-bindings: 'true'} - - {os: windows-latest, r: 'release', rust-version: 'stable', target: 'x86_64-pc-windows-gnullvm', skip-tests: 'true', emit-bindings: 'true'} - - {os: windows-latest, r: 'devel', rust-version: 'stable', target: 'aarch64-pc-windows-gnullvm', skip-tests: 'true', emit-bindings: 'true'} - - {os: windows-latest, r: 'devel', rust-version: 'stable', target: 'x86_64-pc-windows-gnullvm', skip-tests: 'true', emit-bindings: 'true'} + - {os: windows-latest, r: 'release', rust-version: 'nightly', target: 'aarch64-pc-windows-gnullvm', skip-tests: 'true', emit-bindings: 'true'} + - {os: windows-latest, r: 'release', rust-version: 'nightly', target: 'x86_64-pc-windows-gnullvm', skip-tests: 'true', emit-bindings: 'true'} + - {os: windows-latest, r: 'devel', rust-version: 'nightly', target: 'aarch64-pc-windows-gnullvm', skip-tests: 'true', emit-bindings: 'true'} + - {os: windows-latest, r: 'devel', rust-version: 'nightly', target: 'x86_64-pc-windows-gnullvm', skip-tests: 'true', emit-bindings: 'true'} - {os: ubuntu-latest, r: 'release', rust-version: 'nightly'} - {os: ubuntu-latest, r: 'release', rust-version: 'stable', emit-bindings: 'true'} From 279e873537c70852229aade101dd5cd240bbdb5a Mon Sep 17 00:00:00 2001 From: Mossa Date: Mon, 22 Apr 2024 13:53:15 +0200 Subject: [PATCH 5/7] maybe I've correctly located the binary [generate bindings] --- .github/workflows/test.yml | 10 ++++++++++ build.rs | 1 + 2 files changed, 11 insertions(+) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 2b23a4c0..6640b1a6 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -108,6 +108,16 @@ jobs: with: r-version: ${{ matrix.config.r }} use-public-rspm: true + - name: Print out paths for R + run: | + $r_home = rscript -e "R.home()" | Out-String + Write-Output "R home directory: $r_home" + + $r_bin = rscript -e "R.home('bin')" | Out-String + Write-Output "R bin directory: $r_bin" + + $r_include = rscript -e "R.home('include')" | Out-String + Write-Output "R include directory: $r_include" - name: Set up Rust uses: dtolnay/rust-toolchain@master diff --git a/build.rs b/build.rs index eb320c60..2f7ccc8b 100644 --- a/build.rs +++ b/build.rs @@ -203,6 +203,7 @@ fn get_r_library(r_home: &Path) -> PathBuf { // For Windows (true, "x86_64") => Path::new(r_home).join("bin").join("x64"), (true, "x86") => Path::new(r_home).join("bin").join("i386"), + (true, "aarch64") => Path::new(r_home).join("bin").join("aarch64"), (true, _) => panic!("Unknown architecture"), // For Unix-alike (false, _) => Path::new(r_home).join("lib"), From ca334da0dfd0cdf5ec946d5b57df2bbc243e0b1e Mon Sep 17 00:00:00 2001 From: Mossa Date: Mon, 22 Apr 2024 14:12:58 +0200 Subject: [PATCH 6/7] fixed path [generate bindings] --- build.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build.rs b/build.rs index 2f7ccc8b..9ac41a0d 100644 --- a/build.rs +++ b/build.rs @@ -203,7 +203,7 @@ fn get_r_library(r_home: &Path) -> PathBuf { // For Windows (true, "x86_64") => Path::new(r_home).join("bin").join("x64"), (true, "x86") => Path::new(r_home).join("bin").join("i386"), - (true, "aarch64") => Path::new(r_home).join("bin").join("aarch64"), + (true, "aarch64") => Path::new(r_home).join("bin").join("x64"), (true, _) => panic!("Unknown architecture"), // For Unix-alike (false, _) => Path::new(r_home).join("lib"), From 9a3695b4a4d66fdad597aa361122ae14861a7e4b Mon Sep 17 00:00:00 2001 From: Mossa Date: Wed, 24 Apr 2024 20:32:38 +0200 Subject: [PATCH 7/7] ci: fix? case sensitivity? --- .github/workflows/test.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 6640b1a6..1fc01f53 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -110,13 +110,13 @@ jobs: use-public-rspm: true - name: Print out paths for R run: | - $r_home = rscript -e "R.home()" | Out-String + $r_home = Rscript -e "R.home()" | Out-String Write-Output "R home directory: $r_home" - $r_bin = rscript -e "R.home('bin')" | Out-String + $r_bin = Rscript -e "R.home('bin')" | Out-String Write-Output "R bin directory: $r_bin" - $r_include = rscript -e "R.home('include')" | Out-String + $r_include = Rscript -e "R.home('include')" | Out-String Write-Output "R include directory: $r_include" - name: Set up Rust