[PATCH] build: fix make distclean

Juergen Gross posted 1 patch 2 years, 3 months ago
Test gitlab-ci passed
Patches applied successfully (tree, apply log)
git fetch https://gitlab.com/xen-project/patchew/xen tags/patchew/20220109100133.19731-1-jgross@suse.com
tools/debugger/gdbsx/Makefile | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
[PATCH] build: fix make distclean
Posted by Juergen Gross 2 years, 3 months ago
"make distclean" will complain that "-c" is no supported flag for make.

Fix that by using "-C".

The error has been present for a long time, but it was uncovered only
recently.

Fixes: 2400a9a365c5619 ("tools/debugger: Allow make to recurse into debugger/")
Fixes: f9c9b127753e9ed ("tools: fix make distclean")
Signed-off-by: Juergen Gross <jgross@suse.com>
---
 tools/debugger/gdbsx/Makefile | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tools/debugger/gdbsx/Makefile b/tools/debugger/gdbsx/Makefile
index 8d7cd94a31..5571450a89 100644
--- a/tools/debugger/gdbsx/Makefile
+++ b/tools/debugger/gdbsx/Makefile
@@ -14,7 +14,7 @@ clean:
 
 .PHONY: distclean
 distclean: clean
-	set -e; for d in xg gx; do $(MAKE) -c $$d distclean; done
+	set -e; for d in xg gx; do $(MAKE) -C $$d distclean; done
 
 .PHONY: install
 install: all
-- 
2.26.2


Re: [PATCH] build: fix make distclean
Posted by Jan Beulich 2 years, 3 months ago
On 09.01.2022 11:01, Juergen Gross wrote:
> "make distclean" will complain that "-c" is no supported flag for make.
> 
> Fix that by using "-C".
> 
> The error has been present for a long time, but it was uncovered only
> recently.

And that's because the rule simply was unreachable before? Or it was
reachable, but only via special (non-default) $(MAKE) invocations?

> Fixes: 2400a9a365c5619 ("tools/debugger: Allow make to recurse into debugger/")
> Fixes: f9c9b127753e9ed ("tools: fix make distclean")

To distinguish from this commit's title and to also identify the affected
component, how about having "gdbsx" somewhere in the subject? (To be
honest, with this title I wouldn't even have expected the issue is in the
tool stack part of the tree.)

> Signed-off-by: Juergen Gross <jgross@suse.com>

Preferably with the above taken care of (which could be done while
committing, provided suitable adjustment suggestions),
Reviewed-by: Jan Beulich <jbeulich@suse.com>

Jan

> --- a/tools/debugger/gdbsx/Makefile
> +++ b/tools/debugger/gdbsx/Makefile
> @@ -14,7 +14,7 @@ clean:
>  
>  .PHONY: distclean
>  distclean: clean
> -	set -e; for d in xg gx; do $(MAKE) -c $$d distclean; done
> +	set -e; for d in xg gx; do $(MAKE) -C $$d distclean; done
>  
>  .PHONY: install
>  install: all


Re: [PATCH] build: fix make distclean
Posted by Juergen Gross 2 years, 3 months ago
On 10.01.22 09:42, Jan Beulich wrote:
> On 09.01.2022 11:01, Juergen Gross wrote:
>> "make distclean" will complain that "-c" is no supported flag for make.
>>
>> Fix that by using "-C".
>>
>> The error has been present for a long time, but it was uncovered only
>> recently.
> 
> And that's because the rule simply was unreachable before? Or it was
> reachable, but only via special (non-default) $(MAKE) invocations?

I just hit the bug during a top level "make distclean" and looked which
commit introduced it. As it was really old, I looked for a more recent
commit which could trigger the bug and found the rather recent one,
making me believe that the wrong rule was never reached (other than by
a "make" in the local directory of that rule).

I didn't spend more time on digging out whether the problem could have
happened in other cases, too.

>> Fixes: 2400a9a365c5619 ("tools/debugger: Allow make to recurse into debugger/")
>> Fixes: f9c9b127753e9ed ("tools: fix make distclean")
> 
> To distinguish from this commit's title and to also identify the affected
> component, how about having "gdbsx" somewhere in the subject? (To be
> honest, with this title I wouldn't even have expected the issue is in the
> tool stack part of the tree.)

Hmm, yes, the prefix could be changed to "tools/debugger".

> 
>> Signed-off-by: Juergen Gross <jgross@suse.com>
> 
> Preferably with the above taken care of (which could be done while
> committing, provided suitable adjustment suggestions),
> Reviewed-by: Jan Beulich <jbeulich@suse.com>

Thanks,

Juergen
Re: [PATCH] build: fix make distclean
Posted by Anthony PERARD 2 years, 3 months ago
On Mon, Jan 10, 2022 at 10:04:56AM +0100, Juergen Gross wrote:
> On 10.01.22 09:42, Jan Beulich wrote:
> > On 09.01.2022 11:01, Juergen Gross wrote:
> > > "make distclean" will complain that "-c" is no supported flag for make.
> > > 
> > > Fix that by using "-C".
> > > 
> > > The error has been present for a long time, but it was uncovered only
> > > recently.
> > 
> > And that's because the rule simply was unreachable before? Or it was
> > reachable, but only via special (non-default) $(MAKE) invocations?
> 
> I just hit the bug during a top level "make distclean" and looked which
> commit introduced it. As it was really old, I looked for a more recent
> commit which could trigger the bug and found the rather recent one,
> making me believe that the wrong rule was never reached (other than by
> a "make" in the local directory of that rule).
> 
> I didn't spend more time on digging out whether the problem could have
> happened in other cases, too.
> 
> > > Fixes: 2400a9a365c5619 ("tools/debugger: Allow make to recurse into debugger/")
> > > Fixes: f9c9b127753e9ed ("tools: fix make distclean")
> > 
> > To distinguish from this commit's title and to also identify the affected
> > component, how about having "gdbsx" somewhere in the subject? (To be
> > honest, with this title I wouldn't even have expected the issue is in the
> > tool stack part of the tree.)
> 
> Hmm, yes, the prefix could be changed to "tools/debugger".

With that:
Acked-by: Anthony PERARD <anthony.perard@citrix.com>

Thanks,

-- 
Anthony PERARD

Re: [PATCH] build: fix make distclean
Posted by Jason Andryuk 2 years, 3 months ago
On Sun, Jan 9, 2022 at 5:02 AM Juergen Gross <jgross@suse.com> wrote:
>
> "make distclean" will complain that "-c" is no supported flag for make.
>
> Fix that by using "-C".
>
> The error has been present for a long time, but it was uncovered only
> recently.
>
> Fixes: 2400a9a365c5619 ("tools/debugger: Allow make to recurse into debugger/")
> Fixes: f9c9b127753e9ed ("tools: fix make distclean")
> Signed-off-by: Juergen Gross <jgross@suse.com>

Reviewed-by: Jason Andryuk <jandryuk@gmail.com>
Tested-by: Jason Andryuk <jandryuk@gmail.com>

I just hit this.  Thanks.

-Jason