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

[R-package] fixed some minor issues with testing on Windows #2908

Merged
merged 1 commit into from
Mar 22, 2020

Conversation

jameslamb
Copy link
Collaborator

@jameslamb jameslamb commented Mar 14, 2020

I started working on #2335 tonight, specifically adding CI for Windows.

In this PR, I'd like to propose a few small fixes to start improving support on Windows.

  1. Added architecture-specific source directories to .gitignore. These come from multi-architecture R package builds on Windows, and shouldn't be checked into source control
  2. Minor readability cleanup in Windows section of install.libs.R, added some logs and clarified existing logs
  3. Fixed one unit test that fails on Windows because of different default quoting between Windows and other operating system

I tested these changes locally on Windows 10, using Visual Studio 16 2019, with Rscript build_r.R

Copy link
Collaborator

@StrikerRUS StrikerRUS left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM except one comment.

@@ -52,22 +57,28 @@ if (!use_precompile) {
build_cmd <- "mingw32-make.exe _lightgbm"
system(paste0(cmake_cmd, " ..")) # Must build twice for Windows due sh.exe in Rtools
} else {
try_vs <- 0L
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why this initialization was removed?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This isn't necessary, I think maybe it is a misunderstanding about how system() works. You don't need to allocate an int and then fill it. system() will just return it.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OK, so in R variable defined in nested scope remains visible in outer scope later, right?

Copy link
Collaborator Author

@jameslamb jameslamb Mar 14, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's right. Python is the same way

for i in range(5):
    x = i

if True:
    print(x)

If you think that isn't obvious though I can restore this! But I'd change it to 1L so that that default assumption is "VS didn't work" instead of "assume it worked"

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I see, thanks for the explanation!

I'd better leave it up to other reviewers.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

no prob! @Laurae2 or @guolinke what do you think?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

gently ping @guolinke

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it could be remvoed.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

great, thank you

@jameslamb jameslamb mentioned this pull request Mar 14, 2020
12 tasks
@jameslamb jameslamb merged commit 7f71c96 into microsoft:master Mar 22, 2020
@jameslamb jameslamb deleted the misc/r-pkg-windows branch March 25, 2020 20:02
@github-actions
Copy link

This pull request has been automatically locked since there has not been any recent activity since it was closed. To start a new related discussion, open a new issue at https://github.com/microsoft/LightGBM/issues including a reference to this.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Aug 24, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants