Repository navigation
Use dev pak on Windows CI in order to get binaries on ARM - #1467
Conversation
On windows-11-arm, pak rebuilds every R package from source on each run, even after a cache hit. Cache the library with actions/cache and install only missing packages instead. Add a temporary job showing whether pak reinstalls a package it just installed from r-universe.
|
Note Outcome: this PR ends up as a one-line change, The windows-11-arm job is slow because of R package installationData from 7 recent completed The arm job's median is 34 minutes. Every other test job's median is 12 minutes or less. Nearly all of the gap is the "Install R Packages Required For Tests" step: 21 minutes on arm vs. under a minute everywhere else. Every test job
* A Linux job occasionally spikes, with arm vs. x64 Windows, step by step (medians)
The build is no slower on arm, and the tests are actually faster. The extra 20+ minutes is all package installation, and because the arm job finishes last, it sets the wall-clock time for the whole test run. WhyOn windows-11-arm, Three things combine. 1. The arm R installation points CRAN at r-universe, and marks it as having Windows binariesA temporary debug step (job 128082526113, step "Show where the default repos come from") printed the R installation's
2. pak treats that repo as source-onlyWith pak 0.11.1, 3. pak never reuses source packages installed from r-universeFor a CRAN-type lockfile entry with Evidence from another temporary debug job on arm (pak 0.11.1). Each variant installed glue with
These fields match the pkgdepends check, but we haven't reproduced the reinstall itself in isolation. The debug job also tried reinstalling from a fresh lockfile, but that lockfile pointed at the already-installed glue ( Pointing setup-r at a real CRAN mirror would probably fix the caching, but CRAN has no arm64 Windows binaries, so every cold cache would still mean a ~20 minute source build. What we tried along the way
During these experiments, the other CI jobs and the x64 Windows entry were temporarily switched off on this branch, so the runs only used the arm runner. That's all reverted now. We also found, after the fact, that someone else had already reported this exact situation: r-lib/pkgdepends#486, from cmdstanr's windows-11-arm job, using the same Where we ended up
The only change in this PR is |
install.packages() fetches r-universe's arm64 Windows binaries in seconds, so the library cache isn't needed. Remove it along with the temporary pak debug job.
on the advice of Gabor
Release pak builds every R package from source on windows-11-arm (~20 min). Dev pak installs r-universe's arm64 binaries (~1 min). See #1471 for details and when to switch back.
The Windows ARM job took ~34 min, ~21 min of which was building every R package from source, on every run. Dev pak installs r-universe's Windows arm64 binaries instead, which takes under a minute.
So this PR just sets
pak-version: develinsetup-r-dependenciesfor Windows CI. #1471 tracks switching back to release pak once it has the fix.Thanks @gaborcsardi for pointing us at dev pak! The investigation is in the comment below.