refactor: migrate package installation from pak to uvr #147
Loading…
Reference in a new issue
No description provided.
Delete branch "t3code/migrate-pak-to-uvr"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
bincraftdropped pak in favour of uvr (5.0.x, "Dependencies and their system requirements are now installed withuvrinstead of pak duringbuild_binary_package()"), so the pipelines, helper scripts and images in this repo move with it.Approach
uvr is project-scoped in a way pak is not:
uvr addrefuses to run outside a project and always installs into.uvr/library/, and onlyuvr synchonours--library. So there is no one-linepak::pak(...)equivalent.local/uvr-install.shencapsulates the dance — bootstrap a pinned uvr, mint a throwaway project underTMPDIR,uvr add --no-install, thenuvr sync --library <target>. Keeping the project outside the checkout also keepsuvr init's.Rprofilefrom hijacking.libPaths()for every other R call in the pipeline.This matches what bincraft itself does (
uvr sync --install-system-deps --library <lib>), and bincraft requiresuvronPATH, which the bootstrap provides: every pipeline that callsbincraft::runsinstall-bincraft.R(and therefore the bootstrap) first.Changes
local/uvr-install.shpak::pak(...). Bootstraps uvrv0.4.4, resolves the R interpreter fromUVR_R_BIN/R_VERSION/PATH, pins the manifest to that R's exact version, and syncs intoUVR_TARGET_LIB/R_LIBS_USER.local/install-bincraft.Rforgejo::codefloe.com/rpkgs/bincraft@<tag>instead of agit::URL; keeps thegit ls-remotetag resolution. ExportsUVR_R_BIN/UVR_TARGET_LIBfromR.home()/.libPaths()[1]so the per-R-minor passes target their own R and library..crow/auto-apply-patches.yaml,.crow/weekly-patch-proposals.yaml,.crow/weekly-audit-missing.yaml,.crow/weekly-rebuild-missing.yaml,.crow/build-all-versions-install-deps.yamlpak::pak(...)→UVR_R_BIN=/opt/R/$R_VERSION/bin/R local/uvr-install.sh .... The explicitUVR_R_BINmatters inbuild-all-versions-install-deps.yaml, which has noR_VERSIONin its step environment..crow/build-all-versions.yaml,.crow/process-updates.yaml,.crow/weekly-rebuild-missing.yamlR_PKG_CACHE_DIR→UVR_CACHE_DIR+UVR_PACKAGES_DIRon the same/mnt/cachevolume, preserving the amd64-off/arm64-on split. Drops therm -rf .../pkgcache/_metadata/...cleanup.local/r-minor-helpers.R,local/build-all.R,local/tests/test-trim-pkgcache.Rtrim_pkgcache_metadata(), its every-25-packages call and its tests. uvr's cache does not mint a fresh ~70 MB snapshot perPACKAGESchange..crow/build-all-versions-install-deps.yamlpak::sysreqs_db_update(); uvr resolves sysreqs from its vendoredr-system-requirementsrules via--install-system-deps.docker/Containerfile-shiny-appUVR_LIBRARYpointed at the image's R library.docker/build-one.Dockerfileuvr-install.shat/work/local/soinstall-bincraft.Rfinds it.docker/reprex/alpine.shpak::local_install_deps()with DESCRIPTION parsing +uvr add.local/test-package-loading.Rpak::pkg_install().README.mdrenovate.jsonUVR_PINinuvr-install.shviagithub-releases.Behaviour notes
weekly-audit-missingnow pins bincraft to its latest release (second commit). It previously installed from the default branch — the pre-uvrpak::pak("git::...")call did too — so an unreleased commit could change what the weekly audit reported. It now usesinstall-bincraft.Rlike every other pipeline.uvrfromPATHand pins no version of its own, soUVR_PINinuvr-install.shgoverns the whole pipeline.UVR_CACHE_DIR/UVR_PACKAGES_DIRfrom the inherited pipeline environment.uvr syncwill not prune the shared library. Pruning is disabled whenever--libraryis passed (do_prune = prune && library_override.is_none()), so/mnt/cache/R-pkgskeeps bincraft and its dependencies. The wipe-on-ABI-mismatch path is not similarly guarded, which is why the helper pins the manifest to the active R's exact version.plans/andspecs/are untouched — they are dated records of decisions made in June 2026 and describe bincraft's then-pak-based internals; rewriting them would misstate history.Verification
shellcheck, all pre-commit hooks (on this commit's file range) and thelocal/tests/suite (100 assertions) pass.Not yet exercised in CI: the build-env images do not ship
uvr, so the per-stepcurl install.shbootstrap is untested against a real image. Worth a manualbuild-all-versions-install-depsrun before merging.