Closed CeresBarros closed 1 year ago
This works for me. Can you confirm that it is still a problem with development
branch?
In general, when this happens on Windows, it often means that another R session is open using the package.
Thanks for looking into this @eliotmcintire -- I'll try to reproduce.
Can't reproduce after closing all R sessions (previously I had them "restarted" but open because I was working on different interacting projects/packages).
Does this mean that Require
is a little more sensitive to multiple R sessions being open than devtools
or remotes
?
I don't think so. THose other ones have the same problem... it is R that has the problem. That warning
(Warning: package ‘reproducible’ is in use and will not be installed
) is not a Require
error; it is an install.packages
error. remotes
uses install.packages
under the hood, I believe.
Can't reproduce after closing all R sessions (previously I had them "restarted" but open because I was working on different interacting projects/packages).
In my experience, this is Rstudio on Windows that hangs onto packages for an unpredictable amount of time after an R
restart within Rstudio.
I don't think so. THose other ones have the same problem... it is R that has the problem. That warning (Warning: package ‘reproducible’ is in use and will not be installed) is not a Require error; it is an install.packages error. remotes uses install.packages under the hood, I believe.
Yes, but note that warning was not issued after restarting the session. At that point, Require
skipped the install as if it had been installed already.
-- Installing from:
-- GitHub: CeresBarros/reproducible@51ecfd2b1b9915da3bd012ce23f47d4b98a9f212
-- 1 of 1. Estimated time left: ...; est. finish: ...calculating
Warning: package ‘reproducible’ is in use and will not be installed
Restarting R session...
> Require::Require(c("CeresBarros/reproducible@51ecfd2b1b9915da3bd012ce23f47d4b98a9f212 (HEAD)"),
+ purge = TRUE, install = "force", install_githubArgs = list(force = TRUE))
Using GITHUB_PAT to access files on GitHub
Skipping install of CeresBarros/reproducible@51ecfd2b1b9915da3bd012ce23f47d4b98a9f212, the SHA1 has not changed from last install
## but this works:
> devtools::install_github("CeresBarros/reproducible@51ecfd2b1b9915da3bd012ce23f47d4b98a9f212")
Using github PAT from envvar GITHUB_PAT
Downloading GitHub repo CeresBarros/reproducible@51ecfd2b1b9915da3bd012ce23f47d4b98a9f212
(...)
* DONE (reproducible)
Ah. That is a problem. I thinks it installed it, but it didn't... boom. That needs fixing. Though hard to "reprex" because it has to fail...
I'll try to get a reprex
Ok. Made a PR #88
reprex:
try(remove.packages("reproducible"))
Require::clearRequirePackageCache("reproducible", ask = FALSE) # just in case some previous one had the bug
Require::Install("reproducible") # installs current CRAN version, which is older than SHA below
library(reproducible) # load it
Require::Require(c("CeresBarros/reproducible@51ecfd2b1b9915da3bd012ce23f47d4b98a9f212 (HEAD)"))
packageVersion("reproducible") # will be 2.0.2 from CRAN
detach("package:reproducible", unload = TRUE)
# now installs correct SHA which is 2.0.2.9001
Require::Require(c("CeresBarros/reproducible@51ecfd2b1b9915da3bd012ce23f47d4b98a9f212 (HEAD)"))
packageVersion("reproducible") # was incorrectly 2.0.2 from CRAN prior to PR #87
Pulled into development
I made the mistake of trying to update a loaded package to a specific commit.
Require
failed to install (as it should) but I can't seem to force the installation withRequire
I tried to provide a reprex:
my session info: