Unverified Commit 7be57d77 authored by James Lamb's avatar James Lamb Committed by GitHub
Browse files

[ci][R-package][python] suppress warning about empty 'compute' director, fix...


[ci][R-package][python] suppress warning about empty 'compute' director, fix Rtools installation and temporary pin Sphinx version (#3277)

* [R-package] suppress warning about empty 'compute' directory

* get more logs from Rtools install

* empty commit

* add a timeout

* trying Invoke-WebRequest instead

* switch to CRAN link

* do not use Start-Process

* relative paths

* trying suppressmessageboxes

* switch strategy for running Rtools

* Update requirements_rtd.txt

* Update requirements_base.txt
Co-authored-by: default avatarNikita Titov <nekit94-08@mail.ru>
parent ee8ec182
......@@ -8,7 +8,7 @@ function Download-File-With-Retries {
do {
Write-Output "Downloading ${url}"
sleep 5;
(New-Object System.Net.WebClient).DownloadFile($url, $destfile)
Invoke-WebRequest -Uri $url -OutFile $destfile
} while(!$?);
}
......@@ -102,8 +102,8 @@ if ($env:R_BUILD_TYPE -eq "cmake") {
# download R and RTools
Write-Output "Downloading R and Rtools"
Download-File-With-Retries -url "https://cloud.r-project.org/bin/windows/base/old/$env:R_WINDOWS_VERSION/R-$env:R_WINDOWS_VERSION-win.exe" -destfile "R-win.exe"
Download-File-With-Retries -url "https://cloud.r-project.org/bin/windows/Rtools/$env:RTOOLS_EXE_FILE" -destfile "Rtools.exe"
Download-File-With-Retries -url "https://cran.r-project.org/bin/windows/base/old/$env:R_WINDOWS_VERSION/R-$env:R_WINDOWS_VERSION-win.exe" -destfile "R-win.exe"
Download-File-With-Retries -url "https://cran.r-project.org/bin/windows/Rtools/$env:RTOOLS_EXE_FILE" -destfile "Rtools.exe"
# Install R
Write-Output "Installing R"
......@@ -111,7 +111,7 @@ Start-Process -FilePath R-win.exe -NoNewWindow -Wait -ArgumentList "/VERYSILENT
Write-Output "Done installing R"
Write-Output "Installing Rtools"
Start-Process -FilePath Rtools.exe -NoNewWindow -Wait -ArgumentList "/VERYSILENT /DIR=$RTOOLS_INSTALL_PATH" ; Check-Output $?
./Rtools.exe /VERYSILENT /SUPPRESSMSGBOXES /DIR=$RTOOLS_INSTALL_PATH ; Check-Output $?
Write-Output "Done installing Rtools"
Write-Output "Installing dependencies"
......
......@@ -12,6 +12,7 @@ jobs:
test:
name: ${{ matrix.task }} (${{ matrix.os }}, ${{ matrix.compiler }}, R ${{ matrix.r_version }}, ${{ matrix.build_type }})
runs-on: ${{ matrix.os }}
timeout-minutes: 60
strategy:
fail-fast: false
matrix:
......
......@@ -10,6 +10,11 @@ INSTALL_AFTER_BUILD <- !("--skip-install" %in% args)
TEMP_R_DIR <- file.path(getwd(), "lightgbm_r")
TEMP_SOURCE_DIR <- file.path(TEMP_R_DIR, "src")
install_libs_content <- readLines(
file.path("R-package", "src", "install.libs.R")
)
USING_GPU <- any(grepl("use_gpu.*TRUE", install_libs_content))
# R returns FALSE (not a non-zero exit code) if a file copy operation
# breaks. Let's fix that
.handle_result <- function(res) {
......@@ -100,13 +105,17 @@ result <- file.copy(
)
.handle_result(result)
result <- file.copy(
from = "compute/"
, to = sprintf("%s/", TEMP_SOURCE_DIR)
, recursive = TRUE
, overwrite = TRUE
)
.handle_result(result)
# compute/ is a submodule with boost, only needed if
# building the R package with GPU support
if (USING_GPU) {
result <- file.copy(
from = "compute/"
, to = sprintf("%s/", TEMP_SOURCE_DIR)
, recursive = TRUE
, overwrite = TRUE
)
.handle_result(result)
}
result <- file.copy(
from = "CMakeLists.txt"
......
sphinx
sphinx < 3.2
sphinx_rtd_theme >= 0.3
mock; python_version < '3'
sphinx >= 3.0.2
sphinx >= 3.0.2,<3.2
sphinx_rtd_theme >= 0.3
mock; python_version < '3'
breathe
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment