-
Notifications
You must be signed in to change notification settings - Fork 62
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
Make lib
parameter value of lockfile_create() the same as for the lockfile_install() function e.g. .libPaths()[1]
#608
Comments
The goal of the current process is reproducibility. A
sequence should give you the same packages on every machine, irrespectively of what was already installed before.
If we just accepted whatever version of the package is already installed, then different computers would give you different versions of packages for the same |
Understood, but if you use: |
If you use
and package foobar is required, and it is already installed (a version that satisfies the requirements coming from |
Thinking about this more, I don't mind exposing this argument on GHA, so I can reopen r-lib/actions#814 But I am quite confident that the current defaults for |
pak/R/lockfile.R
Line 24 in 67e6347
Since
lockfile_create()
detects already installed packages inlib
and in .Library (base and recommended packages), IMO it should have the same default value forlib
aslockfile_install()
for consistency.The default value for lockfile_create() is
NULL
and the default value forlockfile_install()
is.libPaths()[1]
which creates unexpected results, i.e.:lockfile_create()
without alib
-parameter value (because defaultNULL
) won't detect already installed site-packages (in.libPaths()[1]
), resulting in a lockfile (pkg.lock
) with upstream sources instead ofinstalled
property, for example:instead of:
lockfile_install()
, which has a defaultlib
-parameter value of.libPaths()[1]
, is also supposed to detect already installed packages, this time in default.libPaths()[1]
(usually this is the same asSys.getenv("R_LIBS_SITE")
).But if those installed packages have different source metadata, they will be checked against pkgcache metadata (in
~/.cache
).If found in the cache (e.g. ✔ Cached copy of yaml 2.3.8 (source) is the latest build) they will not be reinstalled.
If not found there (could be due to another user with another homedir (~) but with the same site-library, they will be reinstalled nevertheless, even if the installed and remote package have the same version and architecture.
PROPOSED SOLUTION:
Having the
lib
parameter value oflockfile_create()
the same as for thelockfile_install()
function e.g..libPaths()[1]
will solve this as they will be marked as 'already installed' in the generated lockfile (same as is the case now for base and recommended packages).Thus an early detection of installed available packages.
What's the purpose of a
lib = NULL
value forlockfile_create()
anyway? Since site-library installed packages should always be considered for a dependency plan (imho). And why would one not want to detect them inlockfile_create()
but try to detect them inlockfile_install()
with a fallback to pkgcache? It's not consistent and produces unexpected results when packages were installed before from a different source or under a different user (in pulled base images for example).The text was updated successfully, but these errors were encountered: