Skip to content
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

Use ctime in file digest cache key #18115

Merged
merged 1 commit into from
Apr 17, 2023

Commits on Apr 17, 2023

  1. Use ctime in file digest cache key

    File digests are now additionally keyed by ctime for supported file system implementations. Since Bazel has a non-zero default for `--cache_computed_file_digests`, this may be required for correctness in cases where different files have identical mtime and inode number. For example, this can happen on Linux when files are extracted from a tar file with fixed mtime and are then replaced with `mv`, which preserves inodes.
    
    Since Java (N)IO doesn't have support for reading file ctimes on Windows, a new method backed by a native implementation is added to `WindowsFileOperation`. Adding a call to this function to `stat` uncovered previously silent bugs where Unix-style `PathFragment`s were created on Windows:
    
    1. Bzlmod's `createLocalRepoSpec` did not correctly extract the path from a registry's `file://` URI on Windows.
    2. `--package_path` isn't usable with absolute paths on Windows as it splits on `:`. Since the flag is deprecated, this commit fixes the tests rather than the implementation.
    
    Fixes bazelbuild#14723
    
    Closes bazelbuild#18003.
    
    PiperOrigin-RevId: 524297459
    Change-Id: I96bfc0210e2f71bf8603c7b7cc5eb06a04048c85
    fmeum committed Apr 17, 2023
    Configuration menu
    Copy the full SHA
    7e1719d View commit details
    Browse the repository at this point in the history