-
Notifications
You must be signed in to change notification settings - Fork 21
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix build caching related error LNK4020
#1553
Comments
The first run of the PR to version lock I would fully expect to encounter this error again when updating the version lock for NAS2D, and then updating the NAS2D submodule. I'm less certain if updating the NAS2D submodule on it's own is likely to make the problem re-appear. I think what we might want to do is cause a cascade failure of cache restores, so we only restore a cache when all prior caches have been successfully restored: |
Despite recent attempts to version lock by setting a baseline, there was still a recent automatic update to After the update, the cache keys for the binary packages had updated hash strings. It's not clear if a new version of the packages were actually installed, or some change to the tooling caused updated hashes. Doing a bit of digging, here are some details on package hashes:
After running find vcpkg_installed/ -name 'vcpkg_abi_info.txt' What's less clear, is if there is a way to calculate this information before installing packages. If we can get accurate hash info before installing packages, then it can become a reliable part of the cache key. To do that, we'd need a hash that depends solely on Another idea, is to use a version identifier for either There is mention of env vars for the GitHub Actions image version here:
Though when attempting to use |
On the topic of version locking and baselines, a recent run showed This is despite having successfully restored a recent cache, and no changes to the tooling:
After that branch was merged, there was no attempt by Again, same cache restore, and no changes to tooling:
Considering branch caches are not visible when building for The binary package caches showed updated hash values: Not really sure what caused Edit: Shortly after,
|
Adding link to a recent run that showed more The first attempt at the run failed, then caches were cleared for that branch, and each job was re-run again. The third attempt shows both runs completed after clearing the cache. The caches restored for the first failed run were:
This resulted in For the 3rd successful re-run of the job:
As can be seen, only the last cache for the OPHD incremental build cache was different. That cache came from an earlier branch build, before a forced push. For the 3rd re-run, all three caches would have come from There was an earlier successful build, before a forced push here:
This appears to be the cache that was restored by the failed build above. Edit: Noticed a possibly relevant finding:
It saved a new cache for NAS2D, but later the next run restored a different cache for NAS2D. It also restored a cache for OPHD based on the NAS2D cache from when the OPHD cache was generated, which didn't match up with the NAS2D cache that was restored when the OPHD cache was later restored. Thus the OPHD was using a cached incremental build from a different cached build of NAS2D. Related, there was a submodule update that was merged into |
Another run failed with Of note was the following:
That cache key should not have been possible. |
Occasionally builds fail with:
This seems to happen when the NAS2D submodule is updated. It's not clear what the exact cause is, though clearing cache entries and re-running the failed workflows can get them to pass. The caches are found at:
Using the filter feature, entries to clear are (note no space after
:
):key:buildCache
key:nas2dCache
key:vcpkgCache
It's possible only a subset of those need to be cleared out.
I suspect this may also be related to new
vcpkg
packages. When the error shows up, there also tend to be newly builtvcpkg
packages.Perhaps what we really need is a way to invalidate build caches when new
vcpkg
packages are available. This might be detected by a version change with:Perhaps the
vcpkg
version string could become part of the cache key.On a possibly related note, maybe the
baseline
value is of interest:We might only care if dependencies we rely on are updated. That may be less often than the version of
vcpkg
is updated. Perhaps using thevcpkg --version
value would cause more frequent cache invalidation than is actually necessary.The text was updated successfully, but these errors were encountered: