Repository navigation
Use Python for nanosecond-accurate source timestamp caching - #1
Merged
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
On macOS, system Ruby's
File.utimetruncates source mtimes to microseconds: a cached timestamp ending in.123456789is restored as.123456000. Unchanged build inputs then have timestamps that differ from the cached Xcode build records.Move both timestamp operations into one Python standard-library script. Storage reads
st_mtime_ns; restoration usesos.utime(ns=...), preserving exact integer nanoseconds throughout. Cache transport still usesactions/cachethrough the composite action.The metadata filename, schema, and content hashes remain compatible with existing caches. Preserve the default source patterns, custom brace alternatives, hidden-directory and symlink behavior, and cache-directory exclusions. File hashes are streamed, and recursive scans skip excluded cache directories.
Validation: reproduced file and directory precision failures with macOS system Ruby 2.6.10, then verified the Python implementation with local checks on Python 3.9.6 and 3.15.2. Checks covered exact timestamp restoration, legacy metadata compatibility, glob behavior, cache-directory exclusions, and changed or missing inputs. Action YAML parsing and
git diff --checkalso pass.The action now requires
python3on the runner, available through Xcode's command-line tools on macOS, with no third-party Python packages. Once this fix is released throughv1, consumers such as Pub can remove their separate timestamp-restoration workaround.