Changelog
Source:NEWS.md
Require 2.0.0
CRAN release: 2026-05-15
breaking changes
The package dependency and package installation engine now defaults to
pak.options(Require.usePak = FALSE)still falls back to the legacy non-pak code path, butpakis the only actively maintained installer going forward. This is the headline change motivating the major version bump. See vignette for the migration map and behavioural differences Require still papers over relative to a rawpak::pak()call.pak’s automatic system-requirements installation is now disabled by default.pakcan otherwise probe forsudoandapt-get installmissing system libraries; installing OS libraries is the user’s or administrator’s responsibility, not Require’s, and the silent privilege escalation is unwanted in containers, CI, shared/HPC nodes and on CRAN. SetPKG_SYSREQS=true(env var) oroptions(pkg.sysreqs = TRUE)before loading Require to opt back in; an explicit opt-in is honoured everywhere. A regression test guards this behaviour.
bug fixes
Windows + RStudio: the SSL warning emitted by
.rs.downloadFileinterceptingdownload.file("https://cran.r-project.org/CRAN_mirrors.csv")no longer surfaces. The retry loop inwhIsOfficialCRANrepo()already handled the failure gracefully; the warning was pure noise. The call is now wrapped insuppressWarnings(try(..., silent = TRUE)).-
install = "force"no longer (1) gratuitously upgrades transitive CRAN deps (e.g. broom, mgcv, sf, survival) when only top-level packages were requested, and (2) silently no-ops when called viaInstall()(which passesrequire = FALSE). Three coordinated fixes:-
pakDepsToPkgDT()now pins installed user packages to their installed version underinstall = "force"(previously skipped). Pak resolves the dep tree against the constraints the user is already running against, so installed deps that satisfy stay put. - The “Deal with force installs” block in
Require()now setsneedInstall = .txtInstalldirectly on user-requested rows, sopakInstallFiltered’stoInstallfilter no longer comes up empty whenrecordLoadOrderwas skipped (the previous indirection went throughloadOrder, whichInstall()doesn’t populate). -
forceInstall = TRUEis restored for user-requested rows underinstall = "force"(regressed toFALSEin the pak-integration commitc2830a6b). Only the non-pakdoInstallsHEAD-ref handling reads this flag; the pak path is unaffected.
-
pakInstallFiltered()now runs a pre-install integrity check: if any user-requested package’s installedDESCRIPTIONnames a hard dep (Depends/Imports/LinkingTo) that is neither already installed nor in pak’s plan, the install is skipped entirely and a warning is emitted. This catches the common failure mode where pak’s CRAN-style resolver ignoresRemotes:from a non-CRAN parent (e.g. r-universe), the Remote-only dep is missing, and pak would otherwise succeed from a cached binary – producing a broken install whoselibrary()call later fails with “there is no package called X”.
enhancements (originally drafted for 1.1.1)
Major change. The package dependency and package installation engine now uses
pakby default. Going forward, this will be the only maintained code. Require handles many cases thatpakdoes not handle. See vignette.-
Require()now skips pak’s online resolver entirely when every package it would install is already in pak’s download cache at a version that satisfies the user’s constraint. Avoids pak’s metadata refresh (which can stall on TCP timeouts when network is slow or unreachable – previously 47 s or indefinite wait when an internet- less Ubuntu had everything cached). Consistent with Require’s philosophy: don’t reach out for updates we never asked for.Implementation: a new
allInPakCache(pkgDT)gate; when it returnsTRUE, dispatch goes topakOfflineInstall()instead ofpakInstallFiltered()– even whenRequire.offlineMode = FALSE. The shortcut is skipped when the user signals “ignore the cache”:install = "force"orpurge = TRUE. pakCachedTarball()now respects version constraints. New optionalversionSpec/inequalityarguments; cache rows whoseversiondoesn’t satisfy the inequality are filtered out, so e.g.Require("dplyr (>= 2.0.0)")no longer mistakenly uses a cacheddplyr 1.2.1.allInPakCache()andpakOfflineInstall()both threadpkgDT$versionSpec/inequalityinto the lookup.Require.offlineMode = TRUEno longer fails when pak’s subprocess probes the network at startup. pkgcache fetcheshttps://bioconductor.org/config.yamlviadownload.file()even when installinglocal::source refs withdependencies = FALSE, which aborts the install when offline. Suppressed by settingR_BIOC_VERSIONandR_BIOC_CONFIG_URL(pointing at pkgcache’s bundledbioc-config.yamlfixture, located inside pak’s private library on most systems) for the duration of the pak call, restored on exit. pak’s startup errors are now treated as advisory: the ground-truthinstalled.packages()check decides whether the install actually landed.New auto-recovery when an online pak install fails because the network is unreachable. If
pakInstallFiltered()leaves any row flagged “could not be installed”,Require()now probes the network once (2 seconds) and, if missing, flipsRequire.offlineMode = TRUEand retries the still-missing packages viapakOfflineInstall()against the local pak download cache. The happy path is unchanged – the probe is paid only on the sad path. The auto-set state is cleared onRequire()’s on.exit so the user’s explicit setting is preserved.internetExists()andsetOfflineModeTRUE()gained aforceparameter that probes regardless ofoptions("Require.checkInternet"). Default remainsFALSE, so non-install code paths still respect the user’s opt-in.New
Require.downloadTimeoutoption (default300Lseconds). Raisesoptions("timeout")for the duration of GitHub source-archive downloads in the legacy (non-pak) install path, where R’s stock 60s default can abort multi-MB fetches on slow connections (issue #140). Has no effect underRequire.usePak = TRUE, which uses pak’s own libcurl downloader with its own retry/timeout.Require()now accepts a multi-line string of packages – newlines split into one package per line, whitespace is trimmed, and blank or#-prefixed lines are dropped (issue #147). An unquoted{...}block form is also accepted, e.g.Require({ dplyr; lme4; PredictiveEcology/LandR@development }); comments inside{...}are stripped by R’s parser before this function runs, and version constraints likepkg (>= 1.0)don’t parse in that form – use the quoted/multi-line-string form for those.pkgDepTopoSort()first argument renamed frompkgstopackagesfor consistency withRequire(),Install(), andpkgDep().
Function consolidation for cached packages
cachePkgDir()now points at the cache that actually holds package tarballs. UnderRequire.usePak = TRUEit returnspak::cache_summary()$cachepath(pak owns the binary/source cache via pkgcache, redirectable through the standardR_USER_CACHE_DIRenv var); underusePak = FALSEit returns the legacy<cacheDir>/packages/<Rver>. Previously it always returned the legacy path regardless of installer, so users (and Require itself) were inspecting the wrong directory in pak mode. Closes the spirit of issue #91 – env-var-driven shared cache works, and the R-version subdirectory is appended automatically by pak /tools::R_user_dir().cacheClearPackages()andcachePurge(packages = TRUE)now route through pak’s cache management in pak mode –pak::cache_clean()when nopackagesargument is given,pak::cache_delete(package = <names>)when it is. UnderusePak = FALSEthe legacy walk-and-unlink behaviour is unchanged. Previously these helpers only cleared Require’s bookkeeping directory while pak’s tarball cache silently kept growing. Note: theRversionargument is a no-op under pak (pak’s cache isn’t partitioned by R version the way Require’s was).New internal
.requirePkgInfoDir()for Require’s own bookkeeping (SHA DB, mirrors,pkgDepDB,available.packagescache,DESCRIPTIONsnapshots). Stays at the legacy<cacheDir>/packages/<Rver>path regardless of pak mode – those files belong to Require and pak doesn’t index them, so keeping them out of pak’s tarball cache prevents accidental deletion bypak::cache_clean()and silent file invisibility. All internal callers that previously usedcachePkgDir()for bookkeeping were migrated.
deprecations
-
The following names emit a
.Deprecated()warning and forward to their canonical replacement for one release cycle: options("Require.cachePkgDir")and theR_REQUIRE_PKG_CACHEenvironment variable are deprecated. UnderusePak = TRUEthey no longer influence the cache location (pak owns it). At package load a one-timepackageStartupMessage()points users at the standard replacement: setR_USER_CACHE_DIRin.Renvironto share or relocate the cache.tools::R_user_dir()automatically routes both pak’s cache (~/.cache/R/pkgcache/pkg) and Require’s scratch dir (~/.cache/R/Require) through that single env var, so a shared- cache setup needs just one line.?cachePkgDir(and the related?cachePurge,?cacheClearPackages,?cacheGetOptionCachePkgDirtopics) was rewritten to lead with a “What goes where” table covering bothusePakmodes, an explicit deprecation/migration table for every name above, and a description of howcachePkgDir()’s return value changes withusePak.
bug fixes
Snapshot installs no longer install the wrong (latest-CRAN) version of a pinned package. With
Require::Require(packageVersionFile = ...)the snapshot rows carry(==X)exact pins, but the cache-shortcut path (.9048) was constructing the pak ref viatrimVersionNumber(), which strips both parenthetical specs AND pak’spkg@verform whenRequire.usePak = TRUE. SofpCompare (==0.2.2)became a barefpCompareref and pak installed the latest CRAN version (0.2.4) instead of the snapshot pin.pakCachedTarball()now returns the cached row’sversion, andpakOfflineInstall()constructspkg@<cachedVersion>for source-tarball refs (.tar.gz) so pak resolves to exactly the cached version. Binary.zip/.tgzrefs unchanged (stilllocal::<file>), and GitHubaccount/repo@SHArefs unchanged.allInPakCache()now refuses the cache shortcut when any requested ref carries the(HEAD)pin (account/repo@branch (HEAD)).(HEAD)means “the current tip of the branch”, which can only be resolved online – a cached tarball provides no information about whether it represents the current tip. With this guard,Require()correctly forwards HEAD-pinned refs to pak’s online resolver instead of short-circuiting to a stale cached build.Removed the
pakResetSubprocess()call from the top ofpakOfflineInstall(). On Windows the kill-and-wait race against pak’s auto-respawn broke the very nextpak::cache_list()call, so immediately after the cache shortcut reported “all requested packages are in the pak download cache”,pakCachedTarball()returned NULL for every package with “no rows in pak::cache_list()”. Visible thanks to the diagnostic logging added in .9047. The reset was intended for the recovery-after-failure path but is unnecessary on the cache- shortcut path (no wedged subprocess to recover from), and on Windows it was actively destructive. Leaving the subprocess alone in both cases.Recovery from a failed online install (no internet) now works on Windows.
Require::Install("dplyr", ...)withofflineMode = FALSEand no internet fails insidepakInstallFiltered, the recovery hook flipsofflineMode = TRUE, andpakOfflineInstallretries from the pak cache. Previously the retry reported “not in pak cache” for every package even thoughpak::cache_list()showed them present. Root cause:pak::cache_list()is executed in pak’s persistent background subprocess, which can be in a wedged state from the preceding failed install plan, returning stale or empty rows.pakOfflineInstall()now callspakResetSubprocess()at the top so the cache lookup runs against a fresh subprocess.pakOfflineInstall()now logs why a package is reported as “not in pak cache” at default verbose: how manycache_list()rows it found for that package and whether their on-disk files exist. Surfaces the underlying state instead of just “not in cache”.-
Offline install on Windows no longer re-downloads cached binaries. The earlier bare-ref pak path (
pak::pak("dplyr", ...)+PKG_METADATA_UPDATE_AFTER) worked on Linux but on Windows pak’s resolver picks CRAN’s multi-arch URL (i386+x86_64-w64-mingw32) as canonical, missed the PPM single-arch cached binary (x86_64-w64-mingw32), and went online. The fix is per-extension routing inpakOfflineInstall():-
.zip(Windows binary) and.tgz(Mac binary) are passed to pak aslocal::<file>refs. pak treats these as direct binary installs – no resolver, no cache-key matching, no download. -
.tar.gzkeeps the bare-ref pak path (wherelocal::would triggerR CMD buildand rebuild vignettes – the original reasonlocal::couldn’t be used for source-format files offline). With the env-var hooks (PKG_METADATA_UPDATE_AFTER,R_BIOC_VERSION,R_BIOC_CONFIG_URL), the bare-ref path uses pak’s own cache without going online on Linux.
pak stays in charge throughout – its resolver, dep-ordering, sysreqs, build, and progress UI all apply. Only the ref form changes based on file extension.
-
Reverted to using
pak::pak()for the offline install (vs. theinstall.packages(<file>, repos = NULL)approach in .9044). The install.packages route installed each tarball standalone with no dep ordering, so a multi-package install where A depends on B in the same batch failed with “dependency ‘B’ is not available for package ‘A’”. Trying to topologically sort and install one-at-a-time reproduces logic that pak already does; per user direction, keep pak in charge. The env-var hooks (PKG_METADATA_UPDATE_AFTER,R_BIOC_VERSION,R_BIOC_CONFIG_URL) andpak.no_extra_messagesare back. ThetrimVersionNumber()fix that strips Require-internalpkg (>= X)constraints before pak sees them is preserved.Offline install no longer fails silently with “tarball was in pak cache but offline install failed” for every package when the dep tree contains version constraints.
pakOfflineInstall()was passingpackageFullName(e.g.glue (>= 1.3.2)) verbatim topak::pak(), which rejects parenthetical inequality constraints withCannot parse package: glue (>= 1.3.2). The error was buried atverboseLevel = 2, so at default verbose the user only saw the generic “offline install failed” warning with no diagnostic. NowtrimVersionNumber()strips the parenthetical before pak sees the ref (preserving GitHubaccount/repo@refforms), and any pak error is surfaced at default verbose so failures are debuggable.useLoadedIfSufficient()now verifies the package’sDESCRIPTIONexists on disk in an effective lib path before marking the row as satisfied. In a single R session,remove.packages()deletes files from disk but leaves the namespace inloadedNamespaces(), andsystem.file(package = ...)continues to return the recorded (now-nonexistent) path. The previous logic (loaded + libPath-in- effective) treated such packages as already installed; offlineRequire(pkg)then skipped reinstall and downstreaminstalled.packages()walks emittedcannot open compressed file '.../DESCRIPTION'warnings. Adding the disk-presence check makes Require correctly route those rows back through the install pipeline so the package ends up on disk again, consistent with Require’s “after this call, the packages are installed” contract.Online pak install no longer spins forever when a package fails to build because of missing system packages. The identify-and-defer loop’s dep resolver re-includes the failing package in every retry plan (since dependents still reference it), so the loop ping-pongs on the same culprit indefinitely. New
extractMissingSysreqs()parses pak’s “Missing N system packages” block and the+ <sysreq> - <pkg>mapping. When detected, the loop bails out with an actionable warning naming each affected package and its missing system dependencies (e.g. “fs needs: cmake, libuv1-dev”). Packages that already installed before the failure are preserved.-
Offline install under
Require.usePak = TRUE + Require.offlineMode = TRUEnow uses pak’s normal install flow against its existing cache instead of forcing alocal::<tarball>source install. The previous design fed paklocal::refs which forced its source-install pipeline (R CMD buildrebuilds vignettes – needs network – and failed offline with “Failed to build dplyr 1.2.1 (300ms)”). The new flow passes normal CRAN/GitHub refs topak::pak()and uses three env-var hooks to keep pak’s subprocess fully offline:-
PKG_METADATA_UPDATE_AFTER=365d– treat pak’s cached metadata as fresh so pak doesn’t refresh from CRAN/PPM. -
R_BIOC_VERSION– short-circuit pkgcache’s Bioconductor version probe. -
R_BIOC_CONFIG_URL=file://...– redirect any residual yaml fetch to pkgcache’s bundled fixture. Plusoptions(pak.no_extra_messages = TRUE)to silence the pillar hint. All four are saved + restored on exit.
With the cached metadata and a cached binary (or source) for the package, pak installs without recompilation – e.g. dplyr in ~64ms on a warm cache instead of failing.
-
Offline install on Linux no longer fails to recognise PPM (binary) tarballs in pak’s cache. PPM binaries share the bare
pkg_ver.tar.gzfilename with their source counterparts on Linux; onlypak::cache_list()’splatformcolumn distinguishes them. The old filename-only classification misrouted PPM binaries into pak’s source-install branch, which then tried toR CMD buildthem (rebuilding vignettes that need network) and aborted with “Failed to build dplyr 1.2.1 (300ms)” or similar.pakCachedTarball()now returns anis_binaryflag derived from theplatformcolumn, andpakOfflineInstall()routes accordingly.The Linux binary path now picks
typefrom.Platform$pkgTypesoinstall.packages(..., type = "binary")– which errors on Linux – is not used. Linux getstype = "source"; Mac/Windows still gettype = "binary".pakOfflineInstall()now emits two distinct warnings when something is missing on disk after the install: “not in pak cache” for packages whose tarball wasn’t cached, and “tarball was in pak cache but offline install failed” for packages that had a tarball but failed to install. The old single hard-coded “not in pak cache” message was actively misleading when the latter happened.-
Require::Install()with==/<=version pins now actually installs the requested version. Five interacting bugs in the pak install path causedInstall(c("stringfish (<= 0.15.8)", "qs (== 0.27.3)"))to silently install stringfish 0.19.0 (ignoring the upper bound) and report qs as[still-missing]in the install summary even after the archive-fallback pass had successfully installed it. Fixes:@-version ref normalization. New
pakRefToBareName()helper (R/pak.R) reduces any pak ref to the bare package name thatinstalled.packages()returns.extractPkgName()only strips parenthetical(>=X)version specs — it does NOT strip pak’spkg@Xexact-pin form thatequalsToAt()/lessThanToAt()introduce. Consequence pre-fix:qs@0.27.3survived throughpkgNamesAllandpassNames, never matchedinstalled.packages()’s bare"qs", and every version-pinned install looked “still missing” to the iter-loop / archive-fallback / install-summary checks — even right after a successful install.Cache key now respects user-supplied version constraints.
pakDepsCacheKey()previously hashed only the version-strippedpkgsForPak, so two calls differing only in constraints shared a cache entry. The cachedpak_resultwas reused by downstreampakDepsToPkgDTprocessing whose behavior DOES branch on the user-supplied constraints (trimRedundancies+lessThanToAtrely on constraint rows actually being present inpkgDT); a stale entry from a different constraint set silently corrupted the next install plan. Fix: thread auserPkgsparameter throughpakDepsCacheKey/pakDepsResolve/pakDepsCacheInvalidate, passresolvedPkgs(constraint-bearing form) at the call site.pakInstallFiltereddedup keeps the strictest constraint row. When pkgDT had two rows for the same Package (e.g. user’s(<= 0.15.8)upper bound and a transitive dep’s(>= 0.15.1)lower bound, both correctly kept bytrimRedundanciesbecause they’re complementary, not redundant),unique(by = "Package")arbitrarily kept whichever sorted first — typically the>=row from the dep tree. The user’s<=pin was then dropped, the downstreamgsub("\\(>=...\\)")stripped to bare name, theany::prefix made itany::stringfish, and pak silently installed the latest. Fix: sort by inequality priority (==><=><>>=>>> none) before unique-by-Package so the strictest row wins.equalsToAt()/lessThanToAt()then translate the surviving==/<=/<row into pak’s exact@versionpin form.No more empty
Warning message: could not be installed:.pakGetArchive()was being called bypakErrorHandlingwith an emptypkgNoVersionwhen pak emitted an internal error that didn’t match any known parse pattern (e.g.if (!version_satisfies(...))). The downstream warning then fired with no package name and no reason. Fix: early-return atpakGetArchiveentry whenpkg2is empty;nzchar()guard at the warn site as belt-and-braces.Mid-pipeline retry warnings demoted to debug messages.
pakRetryLoopandpakSerialInstallwere emittingwarning(... immediate. = TRUE)for every transient install failure — but those layers are early stages of a multi-layer retry pipeline (parallel batch → identify-and-defer → serial → CRAN-archive fallback) and the failure is routinely repaired by a downstream layer. Users were told inlineWarning: could not be installed: qs@0.27.3then watched qs install successfully via the archive pass two seconds later. Those emissions are nowmessageVerbose(... verboseLevel = 2)prefixed with the source layer (pakRetryLoop:/pakSerialInstall:) for diagnostics. The post-installsilentlyFailedwarning remains the authoritative end-state report — it inspects the actual lib state and only fires for packages that did NOT make it in by the end.
Install summary’s canonical
installFailuresparse now runs AFTER the archive-fallback pass so per-packageFailed to build Xlines emitted during the archive pass are picked up rather than falling through to the catch-allstill-missingbranch. Rows are also filtered byfinalMissing, so packages that failed in iter 1 but succeeded in a deferred-culprit serial pass don’t leak into the summary as build-errors when in fact they ended up installed.
Require 1.1.0.9029 (development version)
bug fixes
- identify-and-defer iter check now strips pak’s
any::CRAN prefix (andowner/GitHub prefix) frompassNamesbefore comparing withinstalled.packages(). Without this,extractPkgName("any::cli")returns"any::cli"whileinstalled.packages()returns"cli", so every successfully-installed CRAN ref in the iter pass-list looked “still missing” — sending the loop into the no-parseable-culprits serial-install fallback every single time, even on a cleanRequire::Install(devtools)with all CRAN deps. Symptom: a 3-minute parallel install followed by another 3 minutes of pointless serial pak calls that all report “kept N”. Same transformation as thepkgNamesAllcomputation in the final-missing check above; the iter check just forgot to apply it. The 1.1.0.9027noCache = TRUEfix was real but secondary — the cache wasn’t the problem; the prefix mismatch was.
Require 1.1.0.9028 (development version)
bug fixes
pakBuildFailReason()now actually surfaces pak’s real failure cause. Two issues in 1.1.0.9025: (a) the filter did not strip pak’s own wrapper lineError : ! error in pak subprocessor theCaused by error:chain delimiter, so when pak’stry()-string already chained to the real reason, the fallback returned the wrapper line and the cause was never seen; (b) the diagnostic regex did not includeCould not solve package dependenciesorCan't find package called, two of pak’s most common cause-line patterns. Both fixed. The bullet!prefix that pak adds is now stripped from the fallback line so the warning reads cleanly.pakRetryLoop()no longer fires the duplicate “could not be installed:” warning. ThealreadyWarned <<- TRUEsuper-assignment inpakRetryLoop’s own body walked past the local declaration topakInstallFiltered’s enclosing scope (where no such variable exists), leaving the localFALSEand triggering the post-loop fallback warning every time. Changed toalreadyWarned <-so the local actually gets set. (warnedDroppedlegitimately uses<<-because it really is in the enclosing scope — onlyalreadyWarnedwas wrong.) This was a pre-existing bug that 1.1.0.9025 reproduced in the newidentical(packages, pkgsIn)branch.
Require 1.1.0.9027 (development version)
bug fixes
- Post-install
installed.packages()checks now passnoCache = TRUE. pak runs each install in a subprocess; the parent R session’sinstalled.packages()cache is not invalidated when the subprocess writes to the lib. Without this, freshly-installed packages looked “still missing” to the strategy loop inpakInstallFiltered, falling into the “no parseable culprits; falling back to serial install” branch and re-running pak unnecessarily — visible as e.g. a simpleRequire::Install(pkgload)taking ~12s instead of ~3s, with bogus “still missing after iter 1” messages.
Require 1.1.0.9026 (development version)
new features
-
Require()now skips reinstall when a package is already loaded in the current R session with a version that satisfies the requested constraint. Previously, even when the loaded version was sufficient, Require would still ask pak (orinstall.packages()) to install/upgrade the package — which fails when the loaded namespace is imported by another loaded package (e.g.reproducible<-climateData), surfacing as the generic “Error : ! error in pak subprocess”. The newuseLoadedIfSufficient()helper runs afterwhichToInstall()and, for any candidate flagged for install, checksgetNamespaceVersion()andcompareVersion2()against the row’sversionSpec/inequality. When the loaded version satisfies, the row is markedinstalled = TRUE,installedVersionOK = TRUE,needInstall = .txtDontInstall, plus a newloadedSufficient = TRUEflag.doLoads()consults the flag and attaches viarequire(x, character.only = TRUE)(nolib.loc) to avoid R’s “cannot be unloaded becauseis imported by ” error path. Honoured for HEAD-checked GitHub refs too — version pin trumps HEAD when the user’s spec is a (>= ...)constraint. Skipped wheninstall = "force", since that explicitly asks for reinstall.
Require 1.1.0.9025 (development version)
bug fixes
- pak install warnings now surface the actual subprocess failure reason instead of the generic “Error : ! error in pak subprocess” wrapper.
pakBuildFailReason()now also accepts the captured pak-subprocess message stream andpakRetryLoop()/pakSerialInstall()slice and pass it through, so warnings include the real cause — e.g. “namespace ‘reproducible’ is imported by ‘climateData’ so cannot be unloaded”. The reason-extractor’s diagnostic regex was extended to recognise unload-blocked-by-import and locked-package patterns. Also fixed a duplicate-warning bug: theidentical(packages, pkgsIn)branch inpakRetryLoopwarned without settingalreadyWarned, so the post-loop!alreadyWarnedblock fired a second, less-informative warning with no package names.
Require 1.1.0.9024 (development version)
bug fixes
-
Require()now recovers from R’s “cannot be unloaded becauseis imported by ” failure. Previously, when require(x, lib.loc = libPaths)failed for this reason — typical when a package (e.g.reproducible,Rcpp,dplyr) is already loaded from a different lib and its dependents (SpaDES.core,LandR,terra, …) have imported it — Require warned “package will not be attached” and leftxoff the search path. Modules calling unqualified functions fromx(e.g.prepInputs(...)inside a SpaDESinitevent) then failed with “object ‘prepInputs’ not found”. The recovery detects the situation vialoadedNamespaces()(the failed-unload kept the namespace loaded) and retriesrequire(x, character.only = TRUE)withoutlib.loc, which attaches the already-loaded namespace tosearch(). R prints the “Failed with error: … cannot be unloaded” text directly to stderr rather than as a condition, so awithCallingHandlers(warning=...)capture would not have seen it.
Require 1.1.0.9023 (development version)
bug fixes
-
pakGetArchive()now returns the inputpackagesunchanged whenoptions(repos)has no concrete CRAN URL (e.g. only an r-universe is configured, or only@CRAN@placeholder). Previously,paste0("url::", character(0))collapsed to a length-1"url::"string; downstreampak::pak("url::")then aborted the whole archive batch with an opaque “All URLs failed”. The archive-fallback call site additionally rejects any ref that is not a fully-formedurl::https?://...URL.
Require 1.1.0.9022 (development version)
bug fixes
- Archive fallback now passes all archive URLs to pak in a single batch call so cross-archive dependencies resolve correctly. Previously, the fallback installed each archive ref serially: this worked for archived packages whose deps were on current CRAN, but failed for cross-archive cases like
disk.frame(which depends onpryr, itself archived) — pak would emit “Can’t find package called pryr” because the pryr archive URL wasn’t in the same install plan. Verified end-to-end on the (disk.frame, pryr) pair: 2 pkgs + 54 transitive deps install in a single ~30s pak call. If the batch call fails for any reason, falls back to per-ref serial install (which recovers archives without cross-archive deps).
Require 1.1.0.9021 (development version)
new features
-
pakInstallFiltered()now runs an archive fallback pass at the end of install. For any still-missing packages whose failure pak did not attribute (i.e. no per-packageFailed to buildline — typical of archived-from-CRAN refs that the current CRAN mirror can’t resolve), Require constructs aurl::https://.../Archive/<pkg>/<pkg>_<ver>.tar.gzref via the existingpakGetArchive()helper and attempts a serial install of each. Confirmed working for archived CRAN packages such aspryrthat pak wouldn’t resolve viaany::pryr. Packages that still fail (e.g. genuine source-build issues, transitive deps no longer available) remain in the install-failure summary.
Require 1.1.0.9020 (development version)
new features
-
pakInstallFiltered()now emits an end-of-install summary listing each package that did not end up in the project library, with a parsed reason where pak’s output was specific enough to attribute one. The reason is one of:-
missing-build-deps— R CMD INSTALL pre-flight check refused to build the package because someImportswere not yet in the library at build time (typical cascade culprit). Brief includes the dep names parsed from pak’sERROR: dependencies '...' are not available for package '...'line. -
compile-error— gcc/Fortran error during source build. -
version-conflict— pak refused with an unsatisfiable version pin in the dep tree. -
build-error— generic “Failed to build” with no parseable ERROR: line. -
still-missing— package wasn’t in.libPaths()at the end of all install passes, but pak emitted no specific failure for it (typical cascade casualty when pak’s subprocess crashed during dep resolution). The full structured table is also stored inpakEnv()$.lastInstallFailuresfor programmatic access.
-
- New helpers
extractInstallFailures()andreportInstallFailures()expose the parser and reporter independently of the install loop.
bug fixes
-
pakInstallFiltered()post-install loop: the lazy initialisation ofnowInstalledAllused<<-rather than<-, so the assignment leaked into the global environment instead of updating the local variable declared earlier in the function. SubsequentnowInstalledAll[Package == pkg]then errored with “object ‘Package’ not found” when the package wasn’t inlibPaths[1](the common case after a partial install with cascade casualties). Fixed by switching to<-.
new features
-
pakInstallFiltered()gains a fallback serial install path: when the iterative identify-and-defer loop has packages still missing but no further build-failure culprits are parseable from pak’s output — typically because pak’s subprocess crashed during dep resolution on a large casualty batch — Require now invokespakSerialInstall()on the remaining missing refs. Each per-ref pak call has a tiny dep graph pak resolves cleanly, and a single ref’s failure no longer aborts the rest. Slow but reliable; usually the only step that gets full LandR- scale workflows installable end-to-end. - New helper
pakResetSubprocess()force-restarts pak’s persistent callrr_session(the one held inpak:::pkg_data$remote). Called between identify-and-defer iterations and before the deferred-culprit serial install, so each phase starts with a clean pak subprocess. Necessary because pak can wedge after a large failed install plan in a way that makes every subsequent call emit “Error : ! error in pak subprocess” without naming a build culprit.
Require 1.1.0.9018 (development version)
new features
-
pakInstallFiltered()gains an iterative identify-and-defer install strategy (now the default) that handles pak’s cascade-abort behaviour on large transitive dep graphs. When pak emits per-packageFailed to build <pkg>lines, those packages are treated as the authoritative culprits; the rest of the unbuilt packages — cascade casualties from pak aborting the install plan — get a clean parallel retry without the culprits in the batch. Culprits are then installed one-by-one at the end via the newpakSerialInstall(), when their build-time deps are present in the project lib so R CMD INSTALL’s pre-flight check passes. - New helper
extractBuildFailures(output)parses pak’s stderr/messages forFailed to build <pkg>lines. - New helper
pakSerialInstall(pkgs, lib, repos, verbose)installs refs one at a time; used by the deferred phase of identify-and-defer. - Strategy is selectable via
options(Require.pakInstallStrategy = ...):-
"identify-and-defer"(default) -
"original"(legacy single-pass behaviour)
-
- Per-call install timing is recorded in
pakEnv()$.lastPakInstallTimings.
Require 1.1.0.9017 (development version)
bug fixes
-
pakErrorHandling()no longer crashes whenpak’s error output contains characters that, when spliced into a regex, form an invalid pattern (e.g. TRE “Unknown collating element” from stray brackets, or dots in package names likepaws.application.integration). Symptoms were a misleading warningcould not be installed: invalid regular expression '...', followed byError: object 'Package' not foundfrompakInstallFiltered(), with the realpakbuild-failure reason silently swallowed. Three fixes:- New
regexEscape()helper escapes regex metacharacters inpkgNoVersion/versbefore splicing them into apaste0()pattern; the surroundinggrepis also wrapped intryCatchso a still-malformed pattern returnsinteger(0)rather than aborting. - When
pakErrorHandling()itself errors, the surroundingtryCatchinpakRetryLoop()now also reportspakBuildFailReason()of the originalpakerror andmessage()s the full rawpakerror (truncated at 8 kB) so the underlying build-failure cause is no longer hidden. -
pakInstallFiltered()’s post-install loop guards againstinstalled.packages()returning an empty matrix without the expected columns, which previously surfaced asobject 'Package' not foundand masked the real build failure.
dependencies=NAcommit (1.1.0.9016) but were not separately documented; this entry records them retroactively. - New
Require 1.1.0.9016 (development version)
bug fixes
- CRAN-like packages installed via
pakInstall()now usedependencies = NA(wasFALSE). Withdependencies = FALSE, pak parallelises source builds without waiting for build-time hard deps to finish — e.g.htmlwidgetswould start building whilehtmltoolswas still mid-install and fail with “dependencies are not available”.dependencies = NAlets pak topologically order builds by the hard-dep graph. Combined withupgrade = FALSE, this still avoids upgrading already-installed packages beyond what Require requested.
Require 1.1.0.9015 (development version)
dependencies
-
pakis now anImports(wasSuggests). TheusePakbranch requirespakfor all GitHub/url-style installs, and isolated project libraries (e.g., those created bySpaDES.project::setupProject()) do not always inherit the user’s default library wherepakmight be installed. Declaringpakas a hard dependency ensures it is present wherever Require is.
Require 1.1.0.9013 (development version)
bug fixes
- GitHub and
url::packages are now installed withupgrade = TRUE,dependencies = FALSEso pak always fetches the latest commit from the requested branch without upgrading transitive CRAN dependencies. Previously,upgrade = FALSEcaused pak to “keep” any already-installed version of a GitHub package even when a newer version was required, because pak treats a bareowner/repo@branchref as satisfied by whatever version is already in the library. CRAN-like packages are still installed withupgrade = FALSE,dependencies = FALSEto avoid unnecessary upgrades of already-satisfied dependencies.
Require 1.1.0.9011 (development version)
bug fixes
-
pak::pak()is now called withdependencies = NA(pak’s default) instead ofdependencies = FALSE. Previously,dependencies = FALSEcaused installation failures for GitHub dev packages whose latest DESCRIPTION had new or updated dep requirements that were not captured in Require’s earlier dep-tree snapshot. Usingdependencies = NAlets pak satisfy any such requirements automatically, matching the behaviour of a directpak::pak()call. - “Please change required version” is no longer emitted spuriously when pak fails to install a package that was not previously present in the library (first-time install failure). Previously, a
NApre-install version was compared with the post-attempt installed version, incorrectly signalling that pak had installed a different version.
Require 1.1.0.9010 (development version)
bug fixes
- When pak fails to install a package with an error that Require does not recognise as retryable (e.g. a subprocess crash, network timeout, or GitHub API error), the install attempt now stops immediately and the actual pak error reason is included in the
"could not be installed"warning. Previously the retry loop would silently repeat the same failed call 15 times and then emit a bare"could not be installed: <pkg>"with no explanation.
Require 1.1.0.9009 (development version)
bug fixes
- When pak fails to install a newer version of a package but an older version is already installed, Require now loads the installed version as a fallback (with a warning) instead of refusing to load at all. Previously this produced confusing downstream errors (e.g. “object ‘sppEquivalencies_CA’ not found”) because the package was silently not attached, even though a usable version was present in the library.
Require 1.1.0.9008 (development version)
bug fixes
-
require()failures are now always visible regardless ofRequire.verbosesetting. Previously, whenRequire.verbose <= 0, a package that failed to attach (e.g. a missing dependency, wrong library path) was silently ignored, producing confusing downstream errors like “object ‘sppEquivalencies_CA’ not found”. Now awarning()withimmediate. = TRUEis always emitted whenrequire()returns FALSE, including the underlying R message and the library paths that were searched.
Require 1.1.0.9007 (development version)
Enhancements
-
pakis now the default dependency-resolver and install backend (options(Require.usePak = TRUE)is set by default).pak::pkg_deps()replaces Require’s internalpkgDep()pipeline for full transitive dependency resolution, while Require’s version-priority logic (whichToInstall,trimRedundancies,confirmEqualsDontViolateInequalitiesThenTrim) still governs which packages actually get installed. Archived CRAN packages, GitHub references, and CRAN/GitHub conflicts are all handled via retry loops inpakDepsToPkgDT()andpakInstallFiltered(). - When pak fails to build or install a package, the warning now includes the actual reason (e.g., namespace version mismatch, file locked on Windows, compilation failure) rather than a bare “could not be installed” message.
- Misleading “Please change required version” warnings are now suppressed when a package build fails and the installed version is unchanged; the warning is only shown when pak successfully installed a different (but still insufficient) version.
- When pak detects a CRAN/GitHub conflict caused by a
Remotes:entry in another package’sDESCRIPTION(e.g.,spvsspviaSpaDES.coreRemotes), the conflict table now clearly shows both sides:sp (CRAN) vs sp (via PredictiveEcology/SpaDES.core@development Remotes). Previously this displayed the misleadingsp vs PredictiveEcology/SpaDES.core@development. - The pak dependency-tree cache (in-memory and disk) now reports cache hits at the default
verbose = 1level, making it visible that subsequentRequire()calls are served from cache rather than querying pak/CRAN again. - When a non-pak install log contains a namespace version error (
namespace 'X' Y is being loaded, but >= Z is required), Require now automatically installs the required version ofXand retries, rather than failing silently.
Bugfixes
- When a GitHub package fails to build (e.g.
mapcompilation error) and is permanently removed from the pak retry list, Require now emits a warning naming the package and, where extractable, the reason (namespace mismatch, compilation failure, etc.). Previously the failure was silent when other packages succeeded. Cascade failures — packages that depend on the failed package and therefore also fail to install — are similarly reported after the update loop. - Fixed
require()not being called for packages (e.g.LandR) when usingRequire.usePak = TRUE. The root cause:pakDepsToPkgDT()step-3b compared pak’s CRAN-resolved version against the user’s version constraint. When the user had a dev version installed (satisfying the constraint) but pak’s CRAN resolution returned an older version, the package was incorrectly removed frompkgDT. BecauserecordLoadOrder()could not find the package inpkgDT,base::require()was never called. The fix checks the actually-installed version before classifying a package as unsatisfiable. - Fixed a second
require()failure mode: a user-requested package (e.g.LandR) could end up completely absent frompkgDTif step-3b removed it from the local package list AND it was not a transitive dependency of any other requested package. In this caserecordLoadOrder()had no row to match, soloadOrderwas never set andbase::require()was never called. The fix adds a recovery pass after the main pipeline: any user-requested package that is absent frompkgDTbut installed at a satisfying version is rbind-ed back withloadOrderset andinstalledVersionOK = TRUE. Also adds verbose ≥ 1 diagnostics indoLoads()to report when packages withloadOrderset are skipped (and why) or whenbase::require()itself returnsFALSE. - Fixed
file:////URL error when downloading archived packages that were previously cached locally;basename()is now used forfile://repository URLs to match the flat cache layout.
Require 1.1.0
Breaking changes
- Package cache now uses per-repository subdirectories (e.g.,
cloudr-projectorg/) instead of a flat directory. This prevents cross-repository cache contamination (e.g., an r-universe package being used when only CRAN is specified). Old flat-cache files will be ignored and packages re-downloaded as needed. AremoveOldFlatCachePkgs()function is provided to clean up legacy flat-cache files (#143).
New functions
-
removeOldFlatCachePkgs(): migrates users from the pre-#143 flat package cache by removing old.tar.gzfiles from the top-level cache directory. -
cachePkgDirForRepo(): returns (and optionally creates) the per-repository cache subdirectory for a given repository URL.
Enhancements
- Default for
getOption("Require.usePak")changed fromTRUEtoFALSEfor consistency with the documented default. -
CODECOV_TOKENadded to the test-coverage GitHub Actions workflow to avoid rate limiting on Codecov. - Expanded test suite with targeted unit tests for many previously uncovered internal functions, including message helpers, cache helpers, environment accessors, and
pkgDepTopoSort.
Bugfixes
- fixes on MacOS that were preventing many types of packages from installing.
- several minor.
- better fails when status is 403 for package dependency checking.
-
updatePackageshad 2 minor bugs that prevented some mixtures of necessary updates from being correctly identified. - resolved failure to install when using
(HEAD)in some cases for packages in custom repositories - use
R_REQUIRE_CACHEenvironment variable for setting the cache directory instead of modifyingR_USER_CACHE_DIR(#124). -
extractVersionNumber()no longer returnscharacter(0)for empty filename inputs. - Fixed
data.tablerecycling warning insysInstallAndDownload. -
fileRenameOrMove()now catches errors fromdirname(to)on Windows when paths exceed MAX_PATH limits. - Fixed
rbindlist(fill=TRUE)column-mismatch errors on R-devel for Windows inavailable.packagesCached(). - Broadened download failure warning pattern to handle more cases on older Windows R versions.
Require 1.0.1
CRAN release: 2024-08-17
enhancements
-
offlineMode, gained improved functionality; though it is still experimental. It can be set usingoptions(Require.offlineMode = TRUE), but it will be automatically set if internet is not available, has now been widely tested. If packages are available in the local caches, and all elements of package versioning (e.g.,available.packages()and github packages) have been previously run, then installations should occur as if the internet were available.
Require 1.0.0
CRAN release: 2024-07-27
major changes
- Installation, package downloading, and package building from source now occur in an external process using
syspackage. This allows for more control over messaging during installations, and it also allows of installation of many packages that are already loaded (with a message that the session will need restarting). This can be turned off with This is turned on withoption(Require.installPackagesSys = FALSE). - All internals for
pkgDephave been changed. The new algorithms are faster and more reliable, with far fewer lines of code. - All testing has been converted from using
testitto usingtestthat. This change adds many dependencies toSuggests, but the benefits, e.g., usingwithrto control loading and unloading of options, packages etc., outweigh the drawbacks.
enhancements
-
packagesargument forRequireandInstallcan now be unquoted names length == 1 or if length > 1 usingc()orlist(), in addition to a character string, e.g.,Install(ggplot2); - Now, if a
GitHub.compackage has a fieldAdditional_repositoriesin the DESCRIPTION file,Requirewill search there for packages that it does not find in thereposargument. This does not affectCRANpackages, as this information is not contained within theavailable.packages()data base, which is what is used to identify dependencies, rather than reading eachDESCRIPTIONfile individually; -
verbosenow propagates better through all internal functions, so e.g.,verbose = -2will make installing very silent; - Better automatic cleaning of Cached packages that are corrupt;
- experimental use of
pakas the backend installer of packages instead ofinstall.packages. A user can attempt to use this backend withoptions(Require.usePak = TRUE). There are a number of cases (specifically when needing exact versions) that do not work; but for “normal” package installations it is widely tested.pakbackend tends to be similar speed for first installations, but much slower for subsequent calls toInstall/Require; - Better recovery from installation failures e.g., if the local cached copy is corrupt, it will be automatically cleaned;
-
Require.Rmdvignette for “Getting Started” is new; - many speed enhancements in cases where e.g., a download is not necessary;
- when downloads from
GitHub.comare done,Requirenow usesgitcredsto getgitcredentials andhttrto download the files with the token;
Function name changes
- all functions related to
cachenow start withcache, e.g.,cacheClearPackagesreplacesclearRequirePackageCache. Previous names are kept for backwards compatibility.
bugfixes
- If a GitHub packages was attempted to be installed, but failed because the package was already loaded in the session,
Requirewould incorrectly think it had successfully installed (#87); - Warning occurred if a package was no longer on CRAN and user had supplied multiple
reposorgetOption('repos'). The result was unaffected by the warning, but warning is now removed; - allow user-specified path in
pkgSnapshot()(#93); - a number of new cases have been added to
teststhat previously would have hit errors; - many other small bugs fixed;
- Some issues specific to macOS have been fixed.
- fixes or implemented other issues #91, #96, #97, #102, #105
Require 0.3.1
CRAN release: 2023-05-22
enhancements
- minor modifications for when internet is not available
- deal with more edge cases for package snapshots that are not internally consistent, i.e., violate package versions, or skip missing branches on GitHub, if not needed (#81).
Require 0.3.0
CRAN release: 2023-03-14
enhancements
- Moved from MRAN archives for binaries to https://packagemanager.posit.co/
- because of the move from MRAN to posit package manager, attempts are made to use archived binary packages for Linux also.
- improved messaging in several places
- improved error catching in several places
- a number of cases that were annoying for users were identified and addressed.
-
setupOffandsetLibPathsenhanced to be fully functioning in a wide diversity of cases. - When setting
install = "force"inRequire, now only the user-specified packages are forced to be installed; the rest are installed if required, mimickinginstall.packages - small efficiency gains in many places
-
(HEAD)is now more robust as a way to keep a package up to date.
advanced changes
- several functions now exported,
.downloadFileMasterMainAuth,messageVerbose,messageDFas they were deemed useful enough for other packages.
bugfixes
- slow assessment of package dependencies on CRAN packages because of stale
available.packagesCached()object. Now, catches this condition and refreshesavailable.packages() - corrected support for multiple repos that each offer the same packages. Now works like
install.packages, i.e., first one first. - base packages can now be installed as previous issues about installing them were dealt with.
Require 0.2.6
CRAN release: 2023-01-05
enhancements
- attempts to deal with more cases of failed installations
-
Installdid not have aninstallargument; this has now been introduced, allowing the (most likely) use case ofInstall(pkg, install = "force") - examples now use
Installmore often thanRequire(..., require = FALSE)for simplicity.
bugfixes
- Cases of multiple user-specified
.libPaths()were treated incorrectly; they are now all respected. - when git repo was not installed because it was identical to the SHA already installed, it would not be loaded, thinking it failed to install; fixed
- can now deal with case when
reposhas multiple, non-binary CRAN-like repositories, when there is also at least one binary repository supplied e.g., the rstudio package manager, i.e., there are at least 3 repositories supplied, 1 of which is binary. - other minor
Require 0.2.5
CRAN release: 2022-11-24
enhancements
- several modifications to enable CRAN-policy violations all addressed, notably keeping all temporary and (package and personal) cache directories clean after examples and tests
- This is a major overhaul of the inner workings of
Require. It now downloads and buildsArchiveandGitHubpackages prior to installation, then installs all packages (CRAN,Archive,GitHub,MRANon Windows) with oneinstall.packagescall (Linux-alikes) or up to twoinstall.packagescalls (binary and source), allowing efficient parallel installs. This results in very fast installs for all combinations of packages. newoptions("Require.offlineMode")can be set toFALSEto stopRequireandpkgDepfrom checking the internet. This will fail, unless the cached packages are available locally (i.e., it was run once with all packages installed previously). If they are, then they will be installed without needing the internet. This option will also be set automatically on the first attempt to get a file from the internet, which fails, triggering a test of the internet. If that fails, then the option will be set toFALSEuntil next call toRequireorpkgDepwhen it will be reset. This is experimental still. - many more edge cases found and dealt with
- experimental use of
(HEAD)to keep a package “up to date” with the HEAD of a GitHub branch. The behaviour still uses version numbering, so will not update based on SHA, but if the HEAD is ahead of the locally installed package and the(HEAD)is specified, then it will update. Specifically, use this instead of a version number, e.g.,"PredictiveEcology/Require@development (HEAD)" -
modifyList2now followsmodifyListby adding thekeep.nullargument. -
setdiffNamedwill compare 2 named lists or vectors and keep on those elements that are in the first list (or vector), keeping in mind the name as well as the element. - package messaging is not sorted alphabetically during installation
- all
messagecalls nowmessageVerbose, so verbosity can be fully controlled with the argumentverboseoroptions("Require.verbose"). See?RequireOptions. - tests clean up more completely after themselves
- if
options(Require.cachePkgDir = FALSE)(or environment variable"R_REQUIRE_PKGCACHE"), then no cache folder will be created; previously a nearly empty folder was created by default. See?RequireOptions - Remove option
Require.persistentPkgEnvas it was deemed superfluous. - numerous enhancements for speed
- new function
Install, which isRequire(..., require = FALSE) -
(HEAD)has now been tested for CRAN repositories and works as expected. - Updated README to show new functionality
- will attempt to use local cached packages from
crancacheif the user setsoptions(Require.useCranCache = TRUE). This is experimental and is still being tested. - A new function,
clearRequirePackageCache, for clearing the package cache. - The cache has been developed to be able to be shared across Operating Systems, if there is a shared file system.
- GitHub packages require the SHA to be assessed; now this is Cached to disk as well as RAM, so that it persists even if there is an R restart.
- All non-package cache files (
available.packages,pkgDep,GitHubSHA) will be refreshed (purged) every 1 hour. - Much improved messaging, including identifying
MRANpackage installs explicitly (instead of just “Archive”)
bugfixes
-
pkgDepwas using localDESCRIPTIONfile to establish package dependencies for a package, if it was available. When the local package is ahead of CRAN (a developer’s case), then this is desirable. But, when the local installed version is behind CRAN (a common user’s case), then this is not desirable.pkgDepnow uses CRAN’s version (usingavailable.packages) as developers can handle this situation on their own. - several minor
- bugfix for
defaultCacheDir, which would default torunneradminunder some conditions and did not allow installing packages due to permissions.
Require 0.1.6
enhancements
-
pkgSnapshotexamples brought up to present usage & simplified -
pkgSnapshotnow uses a default filename that is an optionRequire.packageVersionFile. -
Requirecan now acceptpackageVersionFile = TRUE, meaning use the package version file that is set in theRequire.packageVersionFileoption.
Require 0.1.5
enhancements
- package caching for packages that need sources installs (i.e., identified with
sourcePkgs(), which tend to occur when R packages require idiosyncratic system dependencies) cache the binary version and reuse that on the same system with subsequent re-installs.
bugfix
-
pkgDepwas misidentifying the correct package dependencies. This would manifest when a user had a version of package “A” installed as well as all its dependencies, e.g., “B”. When the user updated “A” to a new version that required a new version of “B”, it would not correctly identify the new dependency requirement, and not update “B”, causing “A” update to fail. This is fixed.
Require 0.1.4
CRAN release: 2022-10-07
- Make corrections for 2 failing architectures on CRAN
- MUCH less verbose during automated testing
enhancement
-
verboseargument is now widespread, with -1, 0, 1, 2 all valid and correctly inherited values. See argument description in e.g.,?Require - improved warning handling
Require 0.1.2
CRAN release: 2022-09-23
enhancements
The
Requireargument,require, can now be a character string, indicating which packages should be attached viarequireNow can use
GITHUB_PATenvironment variable, if set, when it accesses GitHub.com repositories (files or entire repository)Attempt to capture and correct cases where GitHub.com branches are incorrectly labelled
masterinstead ofmain(or vice versa)much quieter messaging by default (can increase with verbose = 1)
requireargument inRequirecan now be a character vector indicating which packages should be attached, not just installed. Note: by default, all packages that are passed topackagesare attached ifrequire = TRUE-
much faster installations:
- When source packages, they are grouped and installed together using the internal parallelism of
install.packages(settingNcpusoption to 4) - when binary, passes vectors to install.packages so much faster.
- all packages are installed in install-safe groups for speed
- When source packages, they are grouped and installed together using the internal parallelism of
can use pak package under the hood when
options("Require.usepak" = TRUE), though there are still many cases that pak cannot deal with. Users should try and determine if this option delivers as expected. pak installs tend to be slightly faster if they work correctly.binary package caching is turned in by default in a user-specific standard directory, making repeat installations (on same system, or shared drive systems) much faster.
MRAN installs for Windows are now much more robust under many conditions.
archived packages (i.e., no longer on CRAN) will now be found and installed (latest available version)
more robust dependency identification even for archived or older packages or package versions (including their dependencies)
MRAN binaries will be used in macOS.
improved installation of older packages (e.g. when dependencies are removed from CRAN, or source versions can’t be easily compiled)
several other minor improvements in package dependency resolution and installation.
bugfixes
- fix issue with ‘dot directories’ in
normPath(). - identified possible bug with
install.packageswhenoptions(Ncpus = XX)where XX is a number > 1. Some packages are skipped.Requirenow captures this and attempts to install the ones that did not get correctly installed. - multiple fixes for certain edge cases.
Require 0.1.1
Require 0.1.0
enhancements
- install CRAN packages using vectorized
install.packages–> much faster - now uses internal
installGithubPackageinstead ofremotes::install_github - this previous means that all installations use
install.packagesdirectly - remove dependency on
remotes
bugfixes
-
Requirewould silently fail to install a GitHub package if there was a warning during the installation. These warnings are now correctly captured, without stopping the installation. - bugfix where a package being installed from GitHub directly had a
Remotesfield for a package that was inSuggests(in its DESCRIPTION file). It would install thisRemotespackage even though it was only inSuggests - bugfix when user supplies a non-CRAN
reposargument toRequire. It was not correctly using. Thanks to @CeresBarros for identifying issue #30 - bugfix “All packages appear to have installed correctly” was misreporting under some cases.
-
reposargument not correctly passed intodoInstallsfromRequire. This meant that installs would not respect a user supplied repos, but would use theoptions("repos")instead. -
extractPkgNamesnow allows GitHub packages that have the repository omitted, i.e., they only have@. This is useful if there is a default expectation for a github repository - better handling of GitHub package install issues
Require 0.0.13
CRAN release: 2021-05-31
- fix CRAN policy violation – dealt with extraneous folder created during testing
Require 0.0.12
CRAN release: 2021-05-26
Dependency changes
- with the release of R 4.1, we dropped support for R 3.5. R 3.6 (
oldrel) and newer are supported.
New features
-
setup: new function for creating a new project. Seereadme.md -
setLibPathand package caching (viaoptions("RPackageCache")) now automatically create and use a subfolder of user-provided path with the R major & minor version number (as with normal R behaviour) to allow multiple R versions to coexist on the same machine. -
setLibPathsgains a new argument,updateRprofile, which allows a user’s changes to.libPaths()to persist through an R restart. Set togetOption("Require.updateRprofile", FALSE), at start
Bug fixes
- several edge cases with complex loading of many packages
- was incorrectly (not) loading base packages, e.g.,
parallel - small minor bugfixes
- In cases where a DESCRIPTION file had both a package with a minimum version (e.g., in Imports) and a REMOTES: for that package (without a minimum version, but with a branch, say),
Requirewould use the REMOTES: entry. But since that means there is no minimum package version, andRequiredoes not automatically install a package that is not violating a minimum version number, it would not install anything. Now, it harmonizes the 2 entries for a given package, and uses both the minimum version number and the git branch as the potential source to find that version number. - allow either
masterormainbranches to be installed from GitHub, without needing to specify (#26) - fix use of options in
setup()
Require 0.0.9
CRAN release: 2020-11-30
New features
-
modifyList2, a generalization ofutils::modifyListfor >2 lists. Also, can handle NULL lists. - slight improvements in speed for some internal functions
-
detachAllnow unloads reverse depends of the depends, if they are loaded
Bug fixes
- deals with more cases of installing arbitrary packages from a
packageVersion.txtfile - Does not mistakenly create a new, empty directory of packages to accommodate 2
LibPathsfrompackageVersion.txtfile, if the second (or more)LibPathis full of base packages. - Handles better false positives (packages did not install properly when they did) and some false negatives (no error collected at end when there was an error in installing)
- better suggestion of what to do in some edge cases of failed package installs
- captures and deals with a bug in
install.packages(argument "av2" is missing, with no default) on R-devel for Windows (on Sept 09, 2020). May be transient. - Was, by default, installing from
sourceon Windows. Fixed.
Require 0.0.8
CRAN release: 2020-09-10
New features
- GitHub SHA is now stored during
pkgSnapshot, meaning that a new system can be built with exact versions and SHAs of GitHub packages. - For GitHub packages, now uses both DESCRIPTION and NAMESPACE files to determine dependencies. GitHub packages are generally for packages in some state of development. This may include missing declarations in DESCRIPTION. NAMESPACE is what R uses to actually determine package dependencies upon installation.
- Now keeps the binary/source package locally if
options("Require.cachePkgDir" = "someLocalDir")is set to a local folder. Currently defaults to NULL, meaning no local cache. -
RequireandpkgSnapshotcan now understand and work with GitHub SHAs and thus packages installed from GitHub, e.g.,Require("PredictiveEcology/Require@development")will install the development version. When usingpkgSnapshot, the exact SHA will be used to restore that package at the exact version withRequire(packageVersionFile = "packageVersions.txt"). - If a package is already loaded prior to changing running
setLibPaths, it is possible to create a version conflict.base::requirewill error if the version in the.libPaths()is older than the version whose namespace is already loaded. To accommodate this, there is a check for this error, and if the newer version (that is already loaded) does not violate theRequire('package (versionSpecification)'), then it will install the newer version. If it does violate the version specification, it will error cleanly with a message describing the possible solutions. - Much better messaging and reporting
- New function:
detachAllthat attempts to detach and unload packages and all their dependencies, in reverse topological order. - Speed improvements, especially with
pkgDepandpkgDepTopoSort - New function
pkgDepAltwhich is an alternative topkgDep, yet easier to maintain and still experimental. It is not yet the workhorse insideRequire, but it may become that. - Now correctly removes spaces and tab characters within a package version description – this was creating an error such as
Error: invalid version specification ' 3.3-13'
Require 0.0.7
CRAN release: 2020-08-18
Require 0.0.5
CRAN release: 2020-07-17
New features
- moved several functions that have to do with package loading and installing from
reproducibletoRequire, includingpkgDep,pkgDepTopoSort.
Bug fixes
- recursive
pkgDepdid not correctly resolve multiple instances of the same package, each with different minimum version numbering. Now it reports minimum version required for all package dependencies. - minor changes in non-exported functions
- handling of bugs in
base::available.packagesfor old Mac machines and R versions
Require 0.0.1
New features
- This is a rewrite of the function,
Require(and helpers) which will be removed from packagereproducible - This function is intended to be a tool for package management used within a “reproducible” workflow
- It differs from all other attempts at achieving this goal by having the trait that the first and subsequent times the function
Requireis run, the result will be the same