-
Notifications
You must be signed in to change notification settings - Fork 3.8k
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] [ci] Add option to skip installation in build_r.R #2957
Conversation
Linking #2441 for example of |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM! Really huge difference it time! 🎉
Seeing this on the linux CI task in Azure DevOps and I am very confused I don't understand how this could be failing on Azure DevOps but not Travis 🤔 My best guess is that some very new version of one of our dependencies previously relied on
EDIT: wait no we already install
And further up: I hope this was just transient. Pushing another small commit to test. |
Co-Authored-By: Nikita Titov <[email protected]>
f00b07b
to
c8d557d
Compare
This PR is ready to merge, but I think we're facing a bug Travis faced a few days ago and thought they'd fixed. Successful build: https://travis-ci.org/github/microsoft/LightGBM/builds/669022302 Details on the issue from https://www.traviscistatus.com/: |
close-reopen to retrigger CI to try to get past transient issues |
This seems to be working! Going to merge it so we can start getting the benefits in our CI 😀 |
@@ -69,10 +69,10 @@ packages="c('data.table', 'jsonlite', 'Matrix', 'R6', 'testthat')" | |||
if [[ $OS_NAME == "macos" ]]; then | |||
packages+=", type = 'binary'" | |||
fi | |||
Rscript --vanilla -e "install.packages(${packages}, repos = '${CRAN_MIRROR}', lib = '${R_LIB_PATH}')" || exit -1 | |||
Rscript --vanilla -e "install.packages(${packages}, repos = '${CRAN_MIRROR}', lib = '${R_LIB_PATH}', dependencies = c('Depends', 'Imports', 'LinkingTo'))" || exit -1 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@jameslamb
Just curious: what is the default set of options?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This set is the default set. From ?install.packages
The default, NA, means c("Depends", "Imports", "LinkingTo").
Those are the minimum ones needed to load a package. In case you're not familiar with them:
Depends
: Has to be present to install your package. Will be loaded whenever your package is loaded.Imports
: Has to be present to install your package. Will only be loaded when your package calls code from them.LinkingTo
: Has to be present to install your package. These are usually header-only packages that your code links to, e.g. the BH package for Boost.
This commit just makes that explicit.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Got it, thanks a lot for the detailed explanation!
Right now,
Rscript build_r.R
will build a source distribution of the R package and install it. In this PR, I propose an addition to the script to tellbuild_r.R
to just build the package tarball but not install it.This should allow us to cut a few minutes out of the
r-package
tasks in CI!Right now we are doing this:
That means we're building
lib_lightgbm
twice, without getting any extra testing benefit. In fact, I think that the scenario of checking a source tarball on a system wherelightgbm
hasn't been installed already is an even better test of the experience for our users!Note that this PR won't change the existing behavior for anyone using
build_r.R
. The default will still be to both build and install.