Skip to content

Commit

Permalink
Finding all the rtools.. (#231)
Browse files Browse the repository at this point in the history
* updated path

* minor

* Update bindings [skip ci]

* Update .github/workflows/test.yml

Co-authored-by: Ilia Kosenkov <[email protected]>

* Update bindings [skip ci]

---------

Co-authored-by: CGMossa <[email protected]>
Co-authored-by: Ilia Kosenkov <[email protected]>
  • Loading branch information
3 people authored Apr 27, 2024
1 parent 9751fd1 commit 57789db
Show file tree
Hide file tree
Showing 5 changed files with 35 additions and 21 deletions.
46 changes: 30 additions & 16 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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'}
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -135,24 +133,40 @@ 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
# Add include path
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
Expand Down
2 changes: 1 addition & 1 deletion bindings/bindings-linux-aarch64-R4.5-devel.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
4 changes: 2 additions & 2 deletions bindings/bindings-linux-x86_64-R4.5-devel.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion bindings/bindings-macos-aarch64-R4.5-devel.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion bindings/bindings-windows-x86_64-R4.5-devel.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 57789db

Please sign in to comment.