LKML Archive on lore.kernel.org
help / color / mirror / Atom feed
* [PATCH] tools build: Fix feature detect clean for out of source builds
@ 2021-08-16 13:07 James Clark
  2021-08-31 18:46 ` Jiri Olsa
  0 siblings, 1 reply; 3+ messages in thread
From: James Clark @ 2021-08-16 13:07 UTC (permalink / raw)
  To: acme, jolsa, linux-perf-users; +Cc: James Clark, linux-kernel

Currently the clean target when using O= isn't cleaning the feature
detect output. This is because O= and OUTPUT= are set to canonical
paths. For example in tools/perf/Makefile:

  FULL_O := $(shell cd $(PWD); readlink -f $(O) || echo $(O))

This means that OUTPUT ends in a / and most usages prepend it to a file
without adding an extra /. This line that was changed adds an extra /
before the 'feature' folder but not to the end, resulting in a clean
command like this:

  rm -f /tmp/build//featuretest-all.bin ...

After the change the clean command looks like this:

  rm -f /tmp/build/feature/test-all.bin ...

Signed-off-by: James Clark <james.clark@arm.com>
---
 tools/build/Makefile | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tools/build/Makefile b/tools/build/Makefile
index 5ed41b96fcde..6f11e6fc9ffe 100644
--- a/tools/build/Makefile
+++ b/tools/build/Makefile
@@ -32,7 +32,7 @@ all: $(OUTPUT)fixdep
 
 # Make sure there's anything to clean,
 # feature contains check for existing OUTPUT
-TMP_O := $(if $(OUTPUT),$(OUTPUT)/feature,./)
+TMP_O := $(if $(OUTPUT),$(OUTPUT)feature/,./)
 
 clean:
 	$(call QUIET_CLEAN, fixdep)
-- 
2.28.0


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] tools build: Fix feature detect clean for out of source builds
  2021-08-16 13:07 [PATCH] tools build: Fix feature detect clean for out of source builds James Clark
@ 2021-08-31 18:46 ` Jiri Olsa
  2021-09-01 14:26   ` Arnaldo Carvalho de Melo
  0 siblings, 1 reply; 3+ messages in thread
From: Jiri Olsa @ 2021-08-31 18:46 UTC (permalink / raw)
  To: James Clark; +Cc: acme, jolsa, linux-perf-users, linux-kernel

On Mon, Aug 16, 2021 at 02:07:05PM +0100, James Clark wrote:
> Currently the clean target when using O= isn't cleaning the feature
> detect output. This is because O= and OUTPUT= are set to canonical
> paths. For example in tools/perf/Makefile:
> 
>   FULL_O := $(shell cd $(PWD); readlink -f $(O) || echo $(O))
> 
> This means that OUTPUT ends in a / and most usages prepend it to a file
> without adding an extra /. This line that was changed adds an extra /
> before the 'feature' folder but not to the end, resulting in a clean
> command like this:
> 
>   rm -f /tmp/build//featuretest-all.bin ...
> 
> After the change the clean command looks like this:
> 
>   rm -f /tmp/build/feature/test-all.bin ...
> 
> Signed-off-by: James Clark <james.clark@arm.com>

nice catch!

Acked-by: Jiri Olsa <jolsa@redhat.com>

thanks,
jirka

> ---
>  tools/build/Makefile | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/tools/build/Makefile b/tools/build/Makefile
> index 5ed41b96fcde..6f11e6fc9ffe 100644
> --- a/tools/build/Makefile
> +++ b/tools/build/Makefile
> @@ -32,7 +32,7 @@ all: $(OUTPUT)fixdep
>  
>  # Make sure there's anything to clean,
>  # feature contains check for existing OUTPUT
> -TMP_O := $(if $(OUTPUT),$(OUTPUT)/feature,./)
> +TMP_O := $(if $(OUTPUT),$(OUTPUT)feature/,./)
>  
>  clean:
>  	$(call QUIET_CLEAN, fixdep)
> -- 
> 2.28.0
> 


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] tools build: Fix feature detect clean for out of source builds
  2021-08-31 18:46 ` Jiri Olsa
@ 2021-09-01 14:26   ` Arnaldo Carvalho de Melo
  0 siblings, 0 replies; 3+ messages in thread
From: Arnaldo Carvalho de Melo @ 2021-09-01 14:26 UTC (permalink / raw)
  To: Jiri Olsa; +Cc: James Clark, jolsa, linux-perf-users, linux-kernel

Em Tue, Aug 31, 2021 at 08:46:10PM +0200, Jiri Olsa escreveu:
> On Mon, Aug 16, 2021 at 02:07:05PM +0100, James Clark wrote:
> > Currently the clean target when using O= isn't cleaning the feature
> > detect output. This is because O= and OUTPUT= are set to canonical
> > paths. For example in tools/perf/Makefile:
> > 
> >   FULL_O := $(shell cd $(PWD); readlink -f $(O) || echo $(O))
> > 
> > This means that OUTPUT ends in a / and most usages prepend it to a file
> > without adding an extra /. This line that was changed adds an extra /
> > before the 'feature' folder but not to the end, resulting in a clean
> > command like this:
> > 
> >   rm -f /tmp/build//featuretest-all.bin ...
> > 
> > After the change the clean command looks like this:
> > 
> >   rm -f /tmp/build/feature/test-all.bin ...
> > 
> > Signed-off-by: James Clark <james.clark@arm.com>
> 
> nice catch!
> 
> Acked-by: Jiri Olsa <jolsa@redhat.com>

Thanks, applied and added:

Fixes: 762323eb39a257c3 ("perf build: Move feature cleanup under tools/build")

- Arnaldo


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2021-09-01 14:26 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-08-16 13:07 [PATCH] tools build: Fix feature detect clean for out of source builds James Clark
2021-08-31 18:46 ` Jiri Olsa
2021-09-01 14:26   ` Arnaldo Carvalho de Melo

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).