[8.0.1] Add and flip --incompatible_locations_prefers_executable
#24874
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.
Work towards #11820
Fixes #20038
Fixes #23200
Fixes #24613
RELNOTES: Extra targets provided to
ctx.expand_location
now expand to their executable (if any) instead of resulting in an error if they provide a number of files different from one.RELNOTES[INC]: The
--incompatible_locations_prefers_executable
flag has been added and enabled, which makes it so thatctx.expand_location
expands$(locations :x)
to the executable of an extra target:x
if it provides one and the number of files provided by it is not one.Closes #24690.
PiperOrigin-RevId: 713453768
Change-Id: I0d6e052bc70deea029554ab722feb544f9597a23
(cherry picked from commit 457d248)
Fixes #24646