Skip to content

Commit

Permalink
[ci] fix MSVC warning about builds in temp directory (#6573)
Browse files Browse the repository at this point in the history
  • Loading branch information
StrikerRUS authored Jul 29, 2024
1 parent 9f07fbe commit b33f412
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
1 change: 0 additions & 1 deletion .ci/test_r_package_windows.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -195,7 +195,6 @@ if ($env:COMPILER -ne "MSVC") {
}

} else {
$env:TMPDIR = $env:USERPROFILE # to avoid warnings about incremental builds inside a temp directory
$INSTALL_LOG_FILE_NAME = "$env:BUILD_SOURCESDIRECTORY\00install_out.txt"
Run-R-Code-Redirect-Stderr "source('build_r.R')" 1> $INSTALL_LOG_FILE_NAME ; $install_succeeded = $?
Write-Output "----- build and install logs -----"
Expand Down
7 changes: 7 additions & 0 deletions .ci/test_windows.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,13 @@ function Check-Output {

$env:CONDA_ENV = "test-env"
$env:LGB_VER = (Get-Content $env:BUILD_SOURCESDIRECTORY\VERSION.txt).trim()
# Use custom temp directory to avoid
# > warning MSB8029: The Intermediate directory or Output directory cannot reside under the Temporary directory
# > as it could lead to issues with incremental build.
# And make sure this directory is always clean
$env:TMPDIR = "$env:USERPROFILE\tmp"
Remove-Item $env:TMPDIR -Force -Recurse -ErrorAction Ignore
[Void][System.IO.Directory]::CreateDirectory($env:TMPDIR)

if ($env:TASK -eq "r-package") {
& .\.ci\test_r_package_windows.ps1 ; Check-Output $?
Expand Down

0 comments on commit b33f412

Please sign in to comment.