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

Find runfiles in directories that are themselves runfiles #14737

Merged
merged 1 commit into from
Feb 7, 2022

Commits on Feb 7, 2022

  1. Find runfiles in directories that are themselves runfiles

    When a target has a runfile that is contained in a directory that is itself one of its runfiles, the runfile will be shadowed by the `SymlinkEntry` for the directory. While this still allows to resolve the file in the runfiles symlink tree, a manifest-based lookup will fail. Since the manifest is used to create the symlink tree for which it is important that no path is a prefix of another, this can only be fixed in the runfiles libraries.
    
    This PR extends the lookup logic of the Bash, C++, Java, and Python runfiles libraries to also find runfiles contained within directories that are themselves runfiles. It does so by searching the manifest not only for the exact provided rlocation path, but also for all path prefixes. If a prefix is looked up successfully, the corresponding suffix is resolved relative to the looked up path.
    
    Fixes bazelbuild#14336.
    
    Closes bazelbuild#14335.
    
    PiperOrigin-RevId: 426894517
    fmeum committed Feb 7, 2022
    Configuration menu
    Copy the full SHA
    c8e9964 View commit details
    Browse the repository at this point in the history