r-lib / pkgbuild

Find tools needed to build R packages
https://pkgbuild.r-lib.org
Other
65 stars 33 forks source link

Cannot install pkgbuild 1.2.0 during CI of a package that passes checks locally #111

Closed amarquard closed 2 years ago

amarquard commented 3 years ago

I maintain an internal R package, that has a CI trigger on github. The CI started to fail at this step devtools::install(upgrade_dependencies = FALSE) and reports something related to pkgbuild. I am as confident as I dare be that this is not due to changes in my package source code, because I have been making minor changes to the package that yesterday passed CI, and right now doesn't even get the actual devtools::check() in the CI but stalls already at devtools::install(upgrade_dependencies = FALSE) with the following error message:

Error in get0(oNam, envir = ns) : 
  lazy-load database '/usr/local/lib/R/site-library/pkgbuild/R/pkgbuild.rdb' is corrupt
Calls: <Anonymous> -> :: -> getExportedValue -> get0
In addition: Warning message:
In get0(oNam, envir = ns) : internal error -3 in R_decompress1

This didn't happen yesterday (worst argument ever, I know) - and locally my package passes devtools::check().

After noticing that the pkgbuild 1.2.0 is as of very recent (yesterday?) I thought I might dare ask whether this error is related to the new release of pkgbuild.

If relevant, here are the steps of my CI:

jobs:
  build:
    runs-on: ubuntu-18.04
    container: docker://rocker/tidyverse
    steps:
    - uses: actions/checkout@v1
    - run: Rscript -e 'devtools::install_deps(".", dependencies=TRUE, upgrade=FALSE)'
    - run: Rscript -e 'devtools::build()'
    - run: Rscript -e 'devtools::install(upgrade_dependencies = FALSE)'
    - run: Rscript -e 'devtools::check()'

Thanks in advance for any feedback on this.

amarquard commented 3 years ago

To be more specific, it wasn't just yesterday that it worked. It was actually going fine past the devtools::install(upgrade_dependencies = FALSE) step a few hours ago, and now it's not... if that might help to clarify what has changed...

amarquard commented 3 years ago

Installing pkgbuild in a separate step that doesn't use devtools fixes this. So perhaps this is a devtools issue, not a pkgbuild issue? (In that case my apologies for posting it here)

jobs:
  build:
    runs-on: ubuntu-18.04
    container: docker://rocker/tidyverse
    steps:
    - uses: actions/checkout@v1
    - run: Rscript -e 'devtools::install_deps(".", dependencies=TRUE, upgrade=FALSE)'
    - run: Rscript -e 'devtools::build()'
    - run: Rscript -e 'install.packages("pkgbuild")'
    - run: Rscript -e 'devtools::install(upgrade_dependencies = FALSE)'
    - run: Rscript -e 'devtools::check()'
jimhester commented 3 years ago

You get these types of lazy load errors when you are trying to install a newer version of a package on top of an older version already loaded in the same or a different R session.

amarquard commented 3 years ago

Yes thank you - I noticed you mentioning this very helpful point on other pages, too. But does this mean there is really no way to install pkgbuild via devtools::install() (which tries to install pkgbuild because it is a dependency) because devtools is already loading pkgbuild - so it seems somehow a circular problem?

jimhester commented 3 years ago

You can use remotes directly to install it instead (devtools uses remotes internally for installation). Remotes has no dependencies, so avoids this issue.

gaborcsardi commented 2 years ago

This is an old issue, and I am closing it now. Please open a new issue if you still have problems. Thanks!