From 57789db10c236e5d54f28203657c74d3d0cf639d Mon Sep 17 00:00:00 2001 From: CGMossa Date: Sat, 27 Apr 2024 09:40:28 +0200 Subject: [PATCH] Finding all the rtools.. (#231) * updated path * minor * Update bindings [skip ci] * Update .github/workflows/test.yml Co-authored-by: Ilia Kosenkov * Update bindings [skip ci] --------- Co-authored-by: CGMossa Co-authored-by: Ilia Kosenkov --- .github/workflows/test.yml | 46 ++++++++++++------- bindings/bindings-linux-aarch64-R4.5-devel.rs | 2 +- bindings/bindings-linux-x86_64-R4.5-devel.rs | 4 +- bindings/bindings-macos-aarch64-R4.5-devel.rs | 2 +- .../bindings-windows-x86_64-R4.5-devel.rs | 2 +- 5 files changed, 35 insertions(+), 21 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index b8da3b17..82661284 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 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 diff --git a/bindings/bindings-linux-aarch64-R4.5-devel.rs b/bindings/bindings-linux-aarch64-R4.5-devel.rs index f5dd8fb6..bd0c4faa 100644 --- a/bindings/bindings-linux-aarch64-R4.5-devel.rs +++ b/bindings/bindings-linux-aarch64-R4.5-devel.rs @@ -138,7 +138,7 @@ pub const R_STATUS: &[u8; 29] = b"Under development (unstable)\0"; pub const R_YEAR: &[u8; 5] = b"2024\0"; pub const R_MONTH: &[u8; 3] = b"04\0"; pub const R_DAY: &[u8; 3] = b"24\0"; -pub const R_SVN_REVISION: u32 = 86483; +pub const R_SVN_REVISION: u32 = 86484; pub const R_GE_definitions: u32 = 13; pub const R_GE_deviceClip: u32 = 14; pub const R_GE_group: u32 = 15; diff --git a/bindings/bindings-linux-x86_64-R4.5-devel.rs b/bindings/bindings-linux-x86_64-R4.5-devel.rs index b5a5b6b2..c0521d18 100644 --- a/bindings/bindings-linux-x86_64-R4.5-devel.rs +++ b/bindings/bindings-linux-x86_64-R4.5-devel.rs @@ -137,8 +137,8 @@ pub const R_MINOR: &[u8; 4] = b"5.0\0"; pub const R_STATUS: &[u8; 29] = b"Under development (unstable)\0"; pub const R_YEAR: &[u8; 5] = b"2024\0"; pub const R_MONTH: &[u8; 3] = b"04\0"; -pub const R_DAY: &[u8; 3] = b"23\0"; -pub const R_SVN_REVISION: u32 = 86473; +pub const R_DAY: &[u8; 3] = b"24\0"; +pub const R_SVN_REVISION: u32 = 86484; pub const R_GE_definitions: u32 = 13; pub const R_GE_deviceClip: u32 = 14; pub const R_GE_group: u32 = 15; diff --git a/bindings/bindings-macos-aarch64-R4.5-devel.rs b/bindings/bindings-macos-aarch64-R4.5-devel.rs index 2382c4b6..36d6e6da 100644 --- a/bindings/bindings-macos-aarch64-R4.5-devel.rs +++ b/bindings/bindings-macos-aarch64-R4.5-devel.rs @@ -140,7 +140,7 @@ pub const R_STATUS: &[u8; 29] = b"Under development (unstable)\0"; pub const R_YEAR: &[u8; 5] = b"2024\0"; pub const R_MONTH: &[u8; 3] = b"04\0"; pub const R_DAY: &[u8; 3] = b"24\0"; -pub const R_SVN_REVISION: u32 = 86482; +pub const R_SVN_REVISION: u32 = 86484; pub const R_GE_definitions: u32 = 13; pub const R_GE_deviceClip: u32 = 14; pub const R_GE_group: u32 = 15; diff --git a/bindings/bindings-windows-x86_64-R4.5-devel.rs b/bindings/bindings-windows-x86_64-R4.5-devel.rs index 62001ceb..a7390ec1 100644 --- a/bindings/bindings-windows-x86_64-R4.5-devel.rs +++ b/bindings/bindings-windows-x86_64-R4.5-devel.rs @@ -57,7 +57,7 @@ pub const R_STATUS: &[u8; 29] = b"Under development (unstable)\0"; pub const R_YEAR: &[u8; 5] = b"2024\0"; pub const R_MONTH: &[u8; 3] = b"04\0"; pub const R_DAY: &[u8; 3] = b"24\0"; -pub const R_SVN_REVISION: u32 = 86483; +pub const R_SVN_REVISION: u32 = 86484; pub const R_GE_definitions: u32 = 13; pub const R_GE_deviceClip: u32 = 14; pub const R_GE_group: u32 = 15;