Buildroot Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [Buildroot] [PATCH 1/1] package/pkg-meson: use --clearcache instead of rm -rf
@ 2024-11-04  7:45 Cherniaev Andrei
  2024-11-04 11:30 ` Nicolas Cavallari
  0 siblings, 1 reply; 3+ messages in thread
From: Cherniaev Andrei @ 2024-11-04  7:45 UTC (permalink / raw)
  To: buildroot; +Cc: Eric Le Bihan, Cherniaev Andrei

I encountered a situation where build/ is not empty folder so when all files in build/ was removed by buildroot I was not able to use meson, example https://gitlab.com/buildroot.org/buildroot/-/issues/64

Signed-off-by: Cherniaev Andrei <dungeonlords789@naver.com>
---
 package/pkg-meson.mk | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/package/pkg-meson.mk b/package/pkg-meson.mk
index bc805b799c..2ddf0a95eb 100644
--- a/package/pkg-meson.mk
+++ b/package/pkg-meson.mk
@@ -147,7 +147,6 @@ $(2)_CXXFLAGS ?= $$(TARGET_CXXFLAGS)
 #
 #
 define $(2)_CONFIGURE_CMDS
-	rm -rf $$($$(PKG)_SRCDIR)/build
 	mkdir -p $$($$(PKG)_SRCDIR)/build
 	sed -e "/^\[binaries\]$$$$/s:$$$$:$$(foreach x,$$($(2)_MESON_EXTRA_BINARIES),\n$$(x)):" \
 	    -e "/^\[properties\]$$$$/s:$$$$:$$(foreach x,$$($(2)_MESON_EXTRA_PROPERTIES),\n$$(x)):" \
@@ -163,6 +162,7 @@ define $(2)_CONFIGURE_CMDS
 		--default-library=$(PKG_MESON_DEFAULT_LIBRARY) \
 		--buildtype=$(if $(BR2_ENABLE_RUNTIME_DEBUG),debug,release) \
 		--cross-file=$$($$(PKG)_SRCDIR)/build/cross-compilation.conf \
+		--clearcache \
 		-Db_pie=false \
 		-Db_staticpic=$(if $(BR2_m68k_cf),false,true) \
 		-Dstrip=false \
@@ -175,7 +175,6 @@ else
 
 # Configure package for host
 define $(2)_CONFIGURE_CMDS
-	rm -rf $$($$(PKG)_SRCDIR)/build
 	mkdir -p $$($$(PKG)_SRCDIR)/build
 	$$(HOST_CONFIGURE_OPTS) \
 	$$($$(PKG)_CONF_ENV) $$(MESON) setup \
@@ -186,6 +185,7 @@ define $(2)_CONFIGURE_CMDS
 		--default-library=shared \
 		--buildtype=release \
 		--wrap-mode=nodownload \
+		--clearcache \
 		-Dstrip=true \
 		$$($$(PKG)_CONF_OPTS) \
 		$$($$(PKG)_SRCDIR) $$($$(PKG)_SRCDIR)/build
-- 
2.43.0

_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

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

* Re: [Buildroot] [PATCH 1/1] package/pkg-meson: use --clearcache instead of rm -rf
  2024-11-04  7:45 [Buildroot] [PATCH 1/1] package/pkg-meson: use --clearcache instead of rm -rf Cherniaev Andrei
@ 2024-11-04 11:30 ` Nicolas Cavallari
  2024-11-04 16:19   ` Thomas Petazzoni via buildroot
  0 siblings, 1 reply; 3+ messages in thread
From: Nicolas Cavallari @ 2024-11-04 11:30 UTC (permalink / raw)
  To: Cherniaev Andrei, buildroot; +Cc: Eric Le Bihan

On 04/11/2024 08:45, Cherniaev Andrei wrote:
> I encountered a situation where build/ is not empty folder so when all files in build/ was removed by buildroot I was not able to use meson, example https://gitlab.com/buildroot.org/buildroot/-/issues/64

This is not really the correct fix.

meson needs a non-existing directory for the outputs. Buildroot assumes that 
"build/" does not exist and use it for builds. The problem with openh264 is that 
"build/" already exists in the source and contains various build system files.

The correct fix would be to not use "build/" for openh264 outputs. Either change 
it globally to a more unique name like "buildroot-build/" or add an option to 
configure it per-package.
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

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

* Re: [Buildroot] [PATCH 1/1] package/pkg-meson: use --clearcache instead of rm -rf
  2024-11-04 11:30 ` Nicolas Cavallari
@ 2024-11-04 16:19   ` Thomas Petazzoni via buildroot
  0 siblings, 0 replies; 3+ messages in thread
From: Thomas Petazzoni via buildroot @ 2024-11-04 16:19 UTC (permalink / raw)
  To: Nicolas Cavallari; +Cc: Cherniaev Andrei, buildroot, Eric Le Bihan

On Mon, 4 Nov 2024 12:30:26 +0100
Nicolas Cavallari <Nicolas.Cavallari@green-communications.fr> wrote:

> meson needs a non-existing directory for the outputs. Buildroot assumes that 
> "build/" does not exist and use it for builds. The problem with openh264 is that 
> "build/" already exists in the source and contains various build system files.
> 
> The correct fix would be to not use "build/" for openh264 outputs. Either change 
> it globally to a more unique name like "buildroot-build/" or add an option to 
> configure it per-package.

The former looks like the good solution: use a less "generic" name,
such as buildroot-build/.

Thomas
-- 
Thomas Petazzoni, co-owner and CEO, Bootlin
Embedded Linux and Kernel engineering and training
https://bootlin.com
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

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

end of thread, other threads:[~2024-11-04 16:19 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-11-04  7:45 [Buildroot] [PATCH 1/1] package/pkg-meson: use --clearcache instead of rm -rf Cherniaev Andrei
2024-11-04 11:30 ` Nicolas Cavallari
2024-11-04 16:19   ` Thomas Petazzoni via buildroot

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox