Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Finding all the rtools.. #231

Merged
merged 5 commits into from
Apr 27, 2024
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
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",
CGMossa marked this conversation as resolved.
Show resolved Hide resolved
"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