fix: "Not a Target" logic bug in make helper awk script#1577
Open
rnvannatta wants to merge 1 commit intoscop:mainfrom
Open
fix: "Not a Target" logic bug in make helper awk script#1577rnvannatta wants to merge 1 commit intoscop:mainfrom
rnvannatta wants to merge 1 commit intoscop:mainfrom
Conversation
Author
|
Fixed the lint issues with the commit message |
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.
In some obscure cases,
target: VAR = valcan causemake tto autocomplete to the incorrect result.This is happening in one of my projects with a somewhat complex set of makefiles, such that
make wreturns windows, webgl, and a random build file. A silly, though minimal repro is:where
make fwill erroneously list completion possibilitiesall fluffThe root cause is that the foobar 'block' looks like this
the script matches f against foobar, setting the target flag true, then it encounters
# Not a targetover and over and over again until it hits the all target, and because the target flag is true, it accepts that. The solution is to make# Not a targetreset the flag as it skips.You can test the script in isolation with:
make -npq __BASH_MAKE_COMPLETION__=1 -C . .DEFAULT 2>/dev/null | prefix="f" prefix_replace="f" awk -f make-extract-targets.awkTested on Debian Trixie with GNU Make 4.4.1, the latest in Debian.
Here is the output of make -nqp on the minimal repro makefile for your convenience: make-nqp-output.txt