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

Fix corner cases in Bash runfiles library #16988

Merged

Conversation

fmeum
Copy link
Collaborator

@fmeum fmeum commented Dec 12, 2022

Due to tests not actually verifying the exit code of rlocation calls, a few special cases were not handled correctly. In particular, absolute paths still went through regular rlocation lookup and could fail there even after the absolute path had been printed to stdout.

Also adds a missing newline in the (very rare) case that a manifest entry is found, but doesn't point to an existing file (e.g. if it is an unresolved symlink), and rlocation is not used with command substitution, but some other mechanism that doesn't strip trailing newlines.

The tests now assert the expected exit code (== 0 or != 0).

Fixes #16933

Closes #16945.

PiperOrigin-RevId: 494609104
Change-Id: I30333219176a61bda51f08c2c6bc927ce653d681

Due to tests not actually verifying the exit code of rlocation calls, a few special cases were not handled correctly. In particular, absolute paths still went through regular rlocation lookup and could fail there even after the absolute path had been printed to stdout.

Also adds a missing newline in the (very rare) case that a manifest entry is found, but doesn't point to an existing file (e.g. if it is an unresolved symlink), and `rlocation` is not used with command substitution, but some other mechanism that doesn't strip trailing newlines.

The tests now assert the expected exit code (== 0 or != 0).

Fixes bazelbuild#16933

Closes bazelbuild#16945.

PiperOrigin-RevId: 494609104
Change-Id: I30333219176a61bda51f08c2c6bc927ce653d681
@fmeum fmeum requested a review from ShreeM01 as a code owner December 12, 2022 08:26
@fmeum
Copy link
Collaborator Author

fmeum commented Dec 12, 2022

@meteorcloudy

@sgowroji sgowroji added team-ExternalDeps External dependency handling, remote repositiories, WORKSPACE file. awaiting-review PR is awaiting review from an assigned reviewer labels Dec 12, 2022
@meteorcloudy meteorcloudy merged commit 229372a into bazelbuild:release-6.0.0 Dec 12, 2022
@fmeum fmeum deleted the fix-runfiles-corner-cases branch December 12, 2022 10:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
awaiting-review PR is awaiting review from an assigned reviewer team-ExternalDeps External dependency handling, remote repositiories, WORKSPACE file.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants