debug-action-cache

|link|: Debug-action-cache

|link|: Debug-action-cache

: Always provide a fallback pattern using restore-keys . If an exact match for package-lock.json fails, falling back to a generic $ runner.os -node- prefix allows the runner to download most dependencies, updating only the newly added packages.

Two different machines run the "same" code but produce different outputs, or a build passes locally but fails remotely.

The "paper" or primary documentation for this feature describes a method for investigating why two seemingly identical build actions produce different cache hashes. In Bazel, this is often handled via the --experimental_remote_cache_eviction_retries or specifically by generating to compare inputs. Key Functions debug-action-cache

To find out why a build missed the cache, you need to compare the cache keys of two consecutive runs that should have matched.

Run your build with execution logging enabled: bazel build //... --execution_log_json_file=/tmp/exec_log.json : Always provide a fallback pattern using restore-keys

The ability to see the exact key being generated, the internal version of the cache, and the step-by-step restore and save process is the difference between guessing at a problem and solving it. So, the next time your CI pipeline slows down or fails without explanation, don't just stare at the green checkmark. Remember to flip the debug switch, dive into the logs, and let debug-action-cache guide you to the solution.

Run the build in a clean environment and save the execution log. Make a trivial change or run the build a second time. Export the second execution log. The "paper" or primary documentation for this feature

Enviroment variables are notorious for busting caches covertly. System updates might change your local PATH or add variables like USER or LANG .

Ensure your build actions don't access the internet or arbitrary file system locations.