On Thu, 26 Feb 2026 23:03:52 GMT, Erik Joelsson <[email protected]> wrote:

>> GNU Make 4.4.1 changed the behavior of the variable MAKEFLAGS. This is 
>> causing our makefiles to behave weirdly in certain situations. We need to 
>> check for certain options in MAKEFLAGS to adjust behavior, and the way we do 
>> it is not compatible with GNU Make 4.4.1. In the GNU Make manual, it's 
>> [documented how you should query MAKEFLAGS for 
>> options](https://www.gnu.org/software/make/manual/make.html#Testing-Flags) 
>> and this patch is applying this recommendation. With this patch, I can 
>> successfully run the failing examples given in the bug using 4.4.1. I have 
>> also verified that tab completion still works and that the output of `make 
>> -p -q` looks the same before and after.
>> 
>> Big thanks to Jaikiran who found the solution to this!
>
> Erik Joelsson has updated the pull request incrementally with one additional 
> commit since the last revision:
> 
>   Handle corner case with make 3.x

Very specifically, with the change proposed in this PR, the following works 
fine on make 4.4.1:


make test TEST=test/jdk/java/sql/

(the presence of q doesn't cause any issue)

however, the following continues to run into problem:


make test TEST=test/jdk/java/beans/PropertyChangeSupport/TestEquals.java
make: Nothing to be done for 'test'.

(notice the presence of a lower case p and a lower case q in the value for TEST)

`MAKEFLAGS` evaluates to `-- 
TEST=test/jdk/java/beans/PropertyChangeSupport/TestEquals.java` and 
`MAKEFLAGS_SINGLE` evaluates to 
`-TEST=test/jdk/java/beans/PropertyChangeSupport/TestEquals.java` and thus


ifeq ($(findstring p, $(MAKEFLAGS_SINGLE))$(findstring q, $(MAKEFLAGS_SINGLE)), 
pq)
  SKIP_SPEC := true
...  

continues to evaluate to true and enters that if block.

-------------

PR Comment: https://git.openjdk.org/jdk/pull/29942#issuecomment-3971478841

Reply via email to