[PATCH v1] xen: Use MFLAGS for silent-mode detection

Bertrand Marquis posted 1 patch 1 day, 17 hours ago
Patches applied successfully (tree, apply log)
git fetch https://gitlab.com/xen-project/patchew/xen tags/patchew/3ab39249c788fd0463e73df9464d482fefe8516b.1770290975.git.bertrand.marquis@arm.com
xen/Makefile | 9 +++++----
1 file changed, 5 insertions(+), 4 deletions(-)
[PATCH v1] xen: Use MFLAGS for silent-mode detection
Posted by Bertrand Marquis 1 day, 17 hours ago
GNU make 4.4+ exposes variable overrides in MAKEFLAGS after "--" (e.g.
O=/path, FOO=bar). The silent-mode check searches for "s" and can match
an override value, forcing silent output even without -s.

Use MFLAGS for short options and filter out any long options before
searching for "s". This preserves -s detection while avoiding false
positives from overrides.

Fixes: 4fdb4b71b152 ("xen/build: introduce if_changed and if_changed_rule")

Signed-off-by: Bertrand Marquis <bertrand.marquis@arm.com>
---
 xen/Makefile | 9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)

diff --git a/xen/Makefile b/xen/Makefile
index 13e336ba5484..5fc725fb02db 100644
--- a/xen/Makefile
+++ b/xen/Makefile
@@ -113,10 +113,11 @@ else
     Q := @
 endif
 
-# If the user is running make -s (silent mode), suppress echoing of
-# commands
-
-ifneq ($(findstring s,$(filter-out --%,$(MAKEFLAGS))),)
+# If the user is running make -s (silent mode), suppress echoing of commands.
+# Use MFLAGS (short options only). MAKEFLAGS may include variable overrides
+# after “--” (GNU make greater than 4.4), which can contain an “s” and falsely
+# trigger silent mode.
+ifneq ($(findstring s,$(filter-out --%,$(MFLAGS))),)
     quiet := silent_
 endif
 
-- 
2.52.0


Re: [PATCH v1] xen: Use MFLAGS for silent-mode detection
Posted by Jan Beulich 1 day, 17 hours ago
On 05.02.2026 12:33, Bertrand Marquis wrote:
> GNU make 4.4+ exposes variable overrides in MAKEFLAGS after "--" (e.g.
> O=/path, FOO=bar). The silent-mode check searches for "s" and can match
> an override value, forcing silent output even without -s.
> 
> Use MFLAGS for short options and filter out any long options before
> searching for "s". This preserves -s detection while avoiding false
> positives from overrides.
> 
> Fixes: 4fdb4b71b152 ("xen/build: introduce if_changed and if_changed_rule")

I don't think this is quite right: make 4.4 post-dates that commit by about
2.5 years.

> 
> Signed-off-by: Bertrand Marquis <bertrand.marquis@arm.com>

Nit: No blank lines between tags, please.

> --- a/xen/Makefile
> +++ b/xen/Makefile
> @@ -113,10 +113,11 @@ else
>      Q := @
>  endif
>  
> -# If the user is running make -s (silent mode), suppress echoing of
> -# commands
> -
> -ifneq ($(findstring s,$(filter-out --%,$(MAKEFLAGS))),)
> +# If the user is running make -s (silent mode), suppress echoing of commands.
> +# Use MFLAGS (short options only). MAKEFLAGS may include variable overrides

Why "short options only"? It looks you mean to describe the macro here, not
what's done in the ifeq(); at the very least it can be read both ways.

> +# after “--” (GNU make greater than 4.4), which can contain an “s” and falsely

4.4 and newer really, as 4.4 itself is included in the affected range. I'm
not quite sure anyway whether the comment really needs to go this far. This
kind of detail can be had from the commit message of this change, if needed.

Happy to make adjustments while committing, yet I'm not sure whether you
agree in all regards.

Jan

Re: [PATCH v1] xen: Use MFLAGS for silent-mode detection
Posted by Bertrand Marquis 1 day, 17 hours ago
Hi Jan,

> On 5 Feb 2026, at 12:45, Jan Beulich <jbeulich@suse.com> wrote:
> 
> On 05.02.2026 12:33, Bertrand Marquis wrote:
>> GNU make 4.4+ exposes variable overrides in MAKEFLAGS after "--" (e.g.
>> O=/path, FOO=bar). The silent-mode check searches for "s" and can match
>> an override value, forcing silent output even without -s.
>> 
>> Use MFLAGS for short options and filter out any long options before
>> searching for "s". This preserves -s detection while avoiding false
>> positives from overrides.
>> 
>> Fixes: 4fdb4b71b152 ("xen/build: introduce if_changed and if_changed_rule")
> 
> I don't think this is quite right: make 4.4 post-dates that commit by about
> 2.5 years.

True, we can remove the fixes tag.

> 
>> 
>> Signed-off-by: Bertrand Marquis <bertrand.marquis@arm.com>
> 
> Nit: No blank lines between tags, please.

Ack

> 
>> --- a/xen/Makefile
>> +++ b/xen/Makefile
>> @@ -113,10 +113,11 @@ else
>>     Q := @
>> endif
>> 
>> -# If the user is running make -s (silent mode), suppress echoing of
>> -# commands
>> -
>> -ifneq ($(findstring s,$(filter-out --%,$(MAKEFLAGS))),)
>> +# If the user is running make -s (silent mode), suppress echoing of commands.
>> +# Use MFLAGS (short options only). MAKEFLAGS may include variable overrides
> 
> Why "short options only"? It looks you mean to describe the macro here, not
> what's done in the ifeq(); at the very least it can be read both ways.

True should be.
Filter short options from MFLAGS.

> 
>> +# after “--” (GNU make greater than 4.4), which can contain an “s” and falsely
> 
> 4.4 and newer really, as 4.4 itself is included in the affected range. I'm
> not quite sure anyway whether the comment really needs to go this far. This
> kind of detail can be had from the commit message of this change, if needed.
> 
> Happy to make adjustments while committing, yet I'm not sure whether you
> agree in all regards.

Agree.

If you agree and can do that on commit, i would just put:

Filter short options from MFLAGS as MAKEFLAGS may include variable overrides.

Cheers
Bertrand

> 
> Jan

Re: [PATCH v1] xen: Use MFLAGS for silent-mode detection
Posted by Bertrand Marquis 21 hours ago
Hi Jan,

> On 5 Feb 2026, at 12:59, Bertrand Marquis <Bertrand.Marquis@arm.com> wrote:
> 
> Hi Jan,
> 
>> On 5 Feb 2026, at 12:45, Jan Beulich <jbeulich@suse.com> wrote:
>> 
>> On 05.02.2026 12:33, Bertrand Marquis wrote:
>>> GNU make 4.4+ exposes variable overrides in MAKEFLAGS after "--" (e.g.
>>> O=/path, FOO=bar). The silent-mode check searches for "s" and can match
>>> an override value, forcing silent output even without -s.
>>> 
>>> Use MFLAGS for short options and filter out any long options before
>>> searching for "s". This preserves -s detection while avoiding false
>>> positives from overrides.
>>> 
>>> Fixes: 4fdb4b71b152 ("xen/build: introduce if_changed and if_changed_rule")
>> 
>> I don't think this is quite right: make 4.4 post-dates that commit by about
>> 2.5 years.
> 
> True, we can remove the fixes tag.
> 
>> 
>>> 
>>> Signed-off-by: Bertrand Marquis <bertrand.marquis@arm.com>
>> 
>> Nit: No blank lines between tags, please.
> 
> Ack
> 
>> 
>>> --- a/xen/Makefile
>>> +++ b/xen/Makefile
>>> @@ -113,10 +113,11 @@ else
>>>    Q := @
>>> endif
>>> 
>>> -# If the user is running make -s (silent mode), suppress echoing of
>>> -# commands
>>> -
>>> -ifneq ($(findstring s,$(filter-out --%,$(MAKEFLAGS))),)
>>> +# If the user is running make -s (silent mode), suppress echoing of commands.
>>> +# Use MFLAGS (short options only). MAKEFLAGS may include variable overrides
>> 
>> Why "short options only"? It looks you mean to describe the macro here, not
>> what's done in the ifeq(); at the very least it can be read both ways.
> 
> True should be.
> Filter short options from MFLAGS.
> 
>> 
>>> +# after “--” (GNU make greater than 4.4), which can contain an “s” and falsely
>> 
>> 4.4 and newer really, as 4.4 itself is included in the affected range. I'm
>> not quite sure anyway whether the comment really needs to go this far. This
>> kind of detail can be had from the commit message of this change, if needed.
>> 
>> Happy to make adjustments while committing, yet I'm not sure whether you
>> agree in all regards.
> 
> Agree.
> 
> If you agree and can do that on commit, i would just put:
> 
> Filter short options from MFLAGS as MAKEFLAGS may include variable overrides.

Are you ok to give a reviewed-by and do the changes on commit or do you want me to
push a v2 with those fixes ?

Cheers
Bertrand

Re: [PATCH v1] xen: Use MFLAGS for silent-mode detection
Posted by Jan Beulich 21 hours ago
On 06.02.2026 08:53, Bertrand Marquis wrote:
> Hi Jan,
> 
>> On 5 Feb 2026, at 12:59, Bertrand Marquis <Bertrand.Marquis@arm.com> wrote:
>>
>> Hi Jan,
>>
>>> On 5 Feb 2026, at 12:45, Jan Beulich <jbeulich@suse.com> wrote:
>>>
>>> On 05.02.2026 12:33, Bertrand Marquis wrote:
>>>> GNU make 4.4+ exposes variable overrides in MAKEFLAGS after "--" (e.g.
>>>> O=/path, FOO=bar). The silent-mode check searches for "s" and can match
>>>> an override value, forcing silent output even without -s.
>>>>
>>>> Use MFLAGS for short options and filter out any long options before
>>>> searching for "s". This preserves -s detection while avoiding false
>>>> positives from overrides.
>>>>
>>>> Fixes: 4fdb4b71b152 ("xen/build: introduce if_changed and if_changed_rule")
>>>
>>> I don't think this is quite right: make 4.4 post-dates that commit by about
>>> 2.5 years.
>>
>> True, we can remove the fixes tag.
>>
>>>
>>>>
>>>> Signed-off-by: Bertrand Marquis <bertrand.marquis@arm.com>
>>>
>>> Nit: No blank lines between tags, please.
>>
>> Ack
>>
>>>
>>>> --- a/xen/Makefile
>>>> +++ b/xen/Makefile
>>>> @@ -113,10 +113,11 @@ else
>>>>    Q := @
>>>> endif
>>>>
>>>> -# If the user is running make -s (silent mode), suppress echoing of
>>>> -# commands
>>>> -
>>>> -ifneq ($(findstring s,$(filter-out --%,$(MAKEFLAGS))),)
>>>> +# If the user is running make -s (silent mode), suppress echoing of commands.
>>>> +# Use MFLAGS (short options only). MAKEFLAGS may include variable overrides
>>>
>>> Why "short options only"? It looks you mean to describe the macro here, not
>>> what's done in the ifeq(); at the very least it can be read both ways.
>>
>> True should be.
>> Filter short options from MFLAGS.
>>
>>>
>>>> +# after “--” (GNU make greater than 4.4), which can contain an “s” and falsely
>>>
>>> 4.4 and newer really, as 4.4 itself is included in the affected range. I'm
>>> not quite sure anyway whether the comment really needs to go this far. This
>>> kind of detail can be had from the commit message of this change, if needed.
>>>
>>> Happy to make adjustments while committing, yet I'm not sure whether you
>>> agree in all regards.
>>
>> Agree.
>>
>> If you agree and can do that on commit, i would just put:
>>
>> Filter short options from MFLAGS as MAKEFLAGS may include variable overrides.
> 
> Are you ok to give a reviewed-by and do the changes on commit or do you want me to
> push a v2 with those fixes ?

I'm intending to make adjustments while committing. That will now be next week only,
though.

Jan

Re: [PATCH v1] xen: Use MFLAGS for silent-mode detection
Posted by Bertrand Marquis 20 hours ago
Hi,

> On 6 Feb 2026, at 08:58, Jan Beulich <jbeulich@suse.com> wrote:
> 
> On 06.02.2026 08:53, Bertrand Marquis wrote:
>> Hi Jan,
>> 
>>> On 5 Feb 2026, at 12:59, Bertrand Marquis <Bertrand.Marquis@arm.com> wrote:
>>> 
>>> Hi Jan,
>>> 
>>>> On 5 Feb 2026, at 12:45, Jan Beulich <jbeulich@suse.com> wrote:
>>>> 
>>>> On 05.02.2026 12:33, Bertrand Marquis wrote:
>>>>> GNU make 4.4+ exposes variable overrides in MAKEFLAGS after "--" (e.g.
>>>>> O=/path, FOO=bar). The silent-mode check searches for "s" and can match
>>>>> an override value, forcing silent output even without -s.
>>>>> 
>>>>> Use MFLAGS for short options and filter out any long options before
>>>>> searching for "s". This preserves -s detection while avoiding false
>>>>> positives from overrides.
>>>>> 
>>>>> Fixes: 4fdb4b71b152 ("xen/build: introduce if_changed and if_changed_rule")
>>>> 
>>>> I don't think this is quite right: make 4.4 post-dates that commit by about
>>>> 2.5 years.
>>> 
>>> True, we can remove the fixes tag.
>>> 
>>>> 
>>>>> 
>>>>> Signed-off-by: Bertrand Marquis <bertrand.marquis@arm.com>
>>>> 
>>>> Nit: No blank lines between tags, please.
>>> 
>>> Ack
>>> 
>>>> 
>>>>> --- a/xen/Makefile
>>>>> +++ b/xen/Makefile
>>>>> @@ -113,10 +113,11 @@ else
>>>>>   Q := @
>>>>> endif
>>>>> 
>>>>> -# If the user is running make -s (silent mode), suppress echoing of
>>>>> -# commands
>>>>> -
>>>>> -ifneq ($(findstring s,$(filter-out --%,$(MAKEFLAGS))),)
>>>>> +# If the user is running make -s (silent mode), suppress echoing of commands.
>>>>> +# Use MFLAGS (short options only). MAKEFLAGS may include variable overrides
>>>> 
>>>> Why "short options only"? It looks you mean to describe the macro here, not
>>>> what's done in the ifeq(); at the very least it can be read both ways.
>>> 
>>> True should be.
>>> Filter short options from MFLAGS.
>>> 
>>>> 
>>>>> +# after “--” (GNU make greater than 4.4), which can contain an “s” and falsely
>>>> 
>>>> 4.4 and newer really, as 4.4 itself is included in the affected range. I'm
>>>> not quite sure anyway whether the comment really needs to go this far. This
>>>> kind of detail can be had from the commit message of this change, if needed.
>>>> 
>>>> Happy to make adjustments while committing, yet I'm not sure whether you
>>>> agree in all regards.
>>> 
>>> Agree.
>>> 
>>> If you agree and can do that on commit, i would just put:
>>> 
>>> Filter short options from MFLAGS as MAKEFLAGS may include variable overrides.
>> 
>> Are you ok to give a reviewed-by and do the changes on commit or do you want me to
>> push a v2 with those fixes ?
> 
> I'm intending to make adjustments while committing. That will now be next week only,
> though.

Works for me no rush, it is just that you never send a R-b on the ML on this patch.

Cheers
Bertrand

> 
> Jan