Repository navigation
Conversation
The setup cache only covered packages installed by apt: on a system we publish no valgrind-codspeed package for, the build was repeated on every run and the cache directory was never created, so the action's cache step could only warn and save nothing. Stage that build into the cache directory (`make install DESTDIR=...`) and restore it before the version check, so a warm cache returns the way an already-installed valgrind does.
|
`--setup-cache-dir` was used verbatim: with a relative path, `make install DESTDIR=` staged into the temporary build directory while the restore looked for that directory relative to the runner's working directory. The build was written where nothing read it, was discarded with the temporary directory, and the install failed with "the freshly built valgrind is not usable". Resolve the directory against the current directory where the CLI parses it, and read an empty value as no cache, rather than as the working directory now that it is absolute. Single-quote the directory in the restore command: `cp -r <dir>/* /` splits a path containing a space, and that command now also serves the source build. Check for an installed valgrind before restoring the cache. Restoring over an adequate installation needs root for nothing, and without sudo it aborted a setup that used to succeed. The cache is still restored before the build prompt, so a warm cache keeps a run from building.
|
All three are real, thanks. Fixed in f23530a. 1. Relative cache paths ( 2. Unquoted path in the restore command ( 3. Restore before the installed check ( Verification on 1.88.0: |
The runner-side half of CodSpeedHQ/action#248. Once the cache directory exists, the action-side symptom (the instruments cache step reporting that it has nothing to save) goes away with it, but the rest of that issue is separate from this change.
Today
install_valgrind_from_packageis the only caller that handssetup_cache_dirtoapt::install_cached, so the instruments cache only ever holds the files of apt-installed packages. On a system we publish no valgrind.debfor —ubuntu-26.04right now, any rolling release or non-apt distribution, and the next new Ubuntu release —ValgrindExecutor::setuptakestry_install_from_source, which never receivessetup_cache_dir:Every run repeats that build (about 150 s on a GitHub-hosted runner), and since nothing is ever written to
~/.cache/codspeed-action, the cache directory never exists and the action's cache step can only report that there is nothing to save.Change
src/executor/helpers/apt.rs: the copy-to-root step ofrestore_from_cacheis extracted asrestore_files_to_root. The existing entry point keeps its apt guard and its metadata logging, so the package path is unchanged; the source-build path needs the same copy without that guard, because the distributions that take it are exactly the ones the guard skips.src/executor/valgrind/build_from_source.rs:install_buildstages into the cache withmake install DESTDIR=<cache_dir>(no root needed) and then installs from there through the shared copy, which is what puts the staged files in the root-relative layout a later restore expects.src/executor/valgrind/setup.rs:try_install_from_sourcerestores the cache before the version check, so a warm cache returns the same way an already-installed valgrind does, and the "we publish no package for this system" warning is only logged when a build or a manual install really is next.src/executor/valgrind/executor.rs: passessetup_cache_dirthrough.Verification
cargo fmt --all -- --checkandcargo clippy --all-targets -- -D warningsare clean.cargo test --all --exclude memtrack --exclude exec-harnessfails the same 23 tests as the base commit, with an identical failure list (all of them readtestdata/perf_map/*, git-lfs pointers in my checkout): no new failures. A 24th failure,test_run_wrapper_script, showed up in one run and was gone in the next — a "Text file busy" flake, unrelated to this change../autogen.sh && ./configure && make -j16 && make install DESTDIR=/tmp/vgcache— all green, unprivileged, and the result is the usualusr/local/{bin,libexec/valgrind,lib,include}layout with the executable bits preserved. Its runtime file set matches the published 24.04.deb, the only difference being the Debian rename of the launcher tovalgrind.bin./and a second, warm run. Both need root or a container, so they wantCODSPEED_TEST_BASE_IMAGE=ubuntu:26.04 just test-integ, or a run in CI.Open questions
libexec/, 66 MB of static libraries underlib/, 2.6 MB of headers). Onlybin/andlibexec/valgrind/are needed at runtime; should the staging drop the rest?libc6-dbgis still only installed on the package path, so the "debug info for the system libc" warning remains on this path. That looked out of scope, but it can be added here.