All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/5] Follow-up on meson
@ 2020-12-07 13:00 marcandre.lureau-H+wXaHxf7aLQT0dZR+AlfA
       [not found] ` <20201207130055.462734-1-marcandre.lureau-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
  0 siblings, 1 reply; 12+ messages in thread
From: marcandre.lureau-H+wXaHxf7aLQT0dZR+AlfA @ 2020-12-07 13:00 UTC (permalink / raw)
  To: devicetree-compiler-u79uwXL29TY76Z2rM5mHXA
  Cc: david-xT8FGy+AXnRB3Ne2BGzF6laj5H9X9Tb+, Marc-André Lureau

From: Marc-André Lureau <marcandre.lureau-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>

Hi,

Some v4 patches of the series "Add meson subsystem" were pushed, while v5 and v6
were posted on the list. Here is the remaining changes I have on top of
upstream. There are a few misc fixes, and the last patch removes the
Makefile-based system, while keeping the traditional make all/check/install/clean
interface to ease the transition.

Marc-André Lureau (5):
  meson: fix -Wall warning
  meson: do not assume python is installed, skip tests
  meson: increase default timeout for tests
  travis: install meson
  build-sys: replace makefiles to wrap meson/ninja

 .travis.yml                |   6 +
 Makefile                   | 380 ++-----------------------------------
 Makefile.convert-dtsv0     |  14 --
 Makefile.dtc               |  23 ---
 Makefile.utils             |  31 ---
 README                     |  24 ++-
 libfdt/Makefile.libfdt     |  18 --
 meson.build                |  22 ++-
 pylibfdt/Makefile.pylibfdt |  30 ---
 tests/Makefile.tests       | 100 ----------
 tests/meson.build          |  13 +-
 tests/run_tests.sh         |  10 +-
 12 files changed, 71 insertions(+), 600 deletions(-)
 delete mode 100644 Makefile.convert-dtsv0
 delete mode 100644 Makefile.dtc
 delete mode 100644 Makefile.utils
 delete mode 100644 libfdt/Makefile.libfdt
 delete mode 100644 pylibfdt/Makefile.pylibfdt
 delete mode 100644 tests/Makefile.tests

-- 
2.29.0



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

* [PATCH 1/5] meson: fix -Wall warning
       [not found] ` <20201207130055.462734-1-marcandre.lureau-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
@ 2020-12-07 13:00   ` marcandre.lureau-H+wXaHxf7aLQT0dZR+AlfA
  2020-12-07 13:00   ` [PATCH 2/5] meson: do not assume python is installed, skip tests marcandre.lureau-H+wXaHxf7aLQT0dZR+AlfA
                     ` (4 subsequent siblings)
  5 siblings, 0 replies; 12+ messages in thread
From: marcandre.lureau-H+wXaHxf7aLQT0dZR+AlfA @ 2020-12-07 13:00 UTC (permalink / raw)
  To: devicetree-compiler-u79uwXL29TY76Z2rM5mHXA
  Cc: david-xT8FGy+AXnRB3Ne2BGzF6laj5H9X9Tb+, Marc-André Lureau

From: Marc-André Lureau <marcandre.lureau-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>

Meson already handles Wall via the built-in warning_level option.

Signed-off-by: Marc-André Lureau <marcandre.lureau-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
---
 meson.build | 22 ++++++++++++----------
 1 file changed, 12 insertions(+), 10 deletions(-)

diff --git a/meson.build b/meson.build
index 2c65104..b23ea1b 100644
--- a/meson.build
+++ b/meson.build
@@ -6,16 +6,18 @@ project('dtc', 'c',
 
 cc = meson.get_compiler('c')
 
-add_project_arguments(cc.get_supported_arguments([
-  '-Wall',
-  '-Wpointer-arith',
-  '-Wcast-qual',
-  '-Wnested-externs',
-  '-Wstrict-prototypes',
-  '-Wmissing-prototypes',
-  '-Wredundant-decls',
-  '-Wshadow'
-]),language: 'c')
+add_project_arguments(
+  cc.get_supported_arguments([
+    '-Wpointer-arith',
+    '-Wcast-qual',
+    '-Wnested-externs',
+    '-Wstrict-prototypes',
+    '-Wmissing-prototypes',
+    '-Wredundant-decls',
+    '-Wshadow'
+  ]),
+  language: 'c'
+)
 
 if host_machine.system() == 'windows'
   add_project_arguments(
-- 
2.29.0


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

* [PATCH 2/5] meson: do not assume python is installed, skip tests
       [not found] ` <20201207130055.462734-1-marcandre.lureau-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
  2020-12-07 13:00   ` [PATCH 1/5] meson: fix -Wall warning marcandre.lureau-H+wXaHxf7aLQT0dZR+AlfA
@ 2020-12-07 13:00   ` marcandre.lureau-H+wXaHxf7aLQT0dZR+AlfA
  2020-12-07 13:00   ` [PATCH 3/5] meson: increase default timeout for tests marcandre.lureau-H+wXaHxf7aLQT0dZR+AlfA
                     ` (3 subsequent siblings)
  5 siblings, 0 replies; 12+ messages in thread
From: marcandre.lureau-H+wXaHxf7aLQT0dZR+AlfA @ 2020-12-07 13:00 UTC (permalink / raw)
  To: devicetree-compiler-u79uwXL29TY76Z2rM5mHXA
  Cc: david-xT8FGy+AXnRB3Ne2BGzF6laj5H9X9Tb+, Marc-André Lureau

From: Marc-André Lureau <marcandre.lureau-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>

Signed-off-by: Marc-André Lureau <marcandre.lureau-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
---
 tests/meson.build | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/tests/meson.build b/tests/meson.build
index 8976dc1..9d3a4e7 100644
--- a/tests/meson.build
+++ b/tests/meson.build
@@ -108,14 +108,14 @@ endforeach
 
 run_tests = find_program('run_tests.sh')
 
-
-env = [
-  'PYTHON=' + py.path(),
-  'PYTHONPATH=' + meson.source_root() / 'pylibfdt',
-]
-
+env = []
 if not py.found()
   env += 'NO_PYTHON=1'
+else
+  env += [
+    'PYTHON=' + py.path(),
+    'PYTHONPATH=' + meson.source_root() / 'pylibfdt',
+  ]
 endif
 if not yaml.found()
   env += 'NO_YAML=1'
-- 
2.29.0


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

* [PATCH 3/5] meson: increase default timeout for tests
       [not found] ` <20201207130055.462734-1-marcandre.lureau-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
  2020-12-07 13:00   ` [PATCH 1/5] meson: fix -Wall warning marcandre.lureau-H+wXaHxf7aLQT0dZR+AlfA
  2020-12-07 13:00   ` [PATCH 2/5] meson: do not assume python is installed, skip tests marcandre.lureau-H+wXaHxf7aLQT0dZR+AlfA
@ 2020-12-07 13:00   ` marcandre.lureau-H+wXaHxf7aLQT0dZR+AlfA
  2020-12-07 13:00   ` [PATCH 4/5] travis: install meson marcandre.lureau-H+wXaHxf7aLQT0dZR+AlfA
                     ` (2 subsequent siblings)
  5 siblings, 0 replies; 12+ messages in thread
From: marcandre.lureau-H+wXaHxf7aLQT0dZR+AlfA @ 2020-12-07 13:00 UTC (permalink / raw)
  To: devicetree-compiler-u79uwXL29TY76Z2rM5mHXA
  Cc: david-xT8FGy+AXnRB3Ne2BGzF6laj5H9X9Tb+, Marc-André Lureau

From: Marc-André Lureau <marcandre.lureau-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>

Signed-off-by: Marc-André Lureau <marcandre.lureau-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
---
 tests/meson.build | 1 +
 1 file changed, 1 insertion(+)

diff --git a/tests/meson.build b/tests/meson.build
index 9d3a4e7..fa06824 100644
--- a/tests/meson.build
+++ b/tests/meson.build
@@ -127,4 +127,5 @@ test(
   workdir: meson.current_build_dir(),
   depends: dumptrees_dtb,
   env: env,
+  timeout: 1800, # mostly for valgrind
 )
-- 
2.29.0


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

* [PATCH 4/5] travis: install meson
       [not found] ` <20201207130055.462734-1-marcandre.lureau-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
                     ` (2 preceding siblings ...)
  2020-12-07 13:00   ` [PATCH 3/5] meson: increase default timeout for tests marcandre.lureau-H+wXaHxf7aLQT0dZR+AlfA
@ 2020-12-07 13:00   ` marcandre.lureau-H+wXaHxf7aLQT0dZR+AlfA
       [not found]     ` <20201207130055.462734-5-marcandre.lureau-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
  2020-12-07 13:00   ` [PATCH 5/5] build-sys: replace makefiles to wrap meson/ninja marcandre.lureau-H+wXaHxf7aLQT0dZR+AlfA
  2020-12-08  4:33   ` [PATCH 0/5] Follow-up on meson David Gibson
  5 siblings, 1 reply; 12+ messages in thread
From: marcandre.lureau-H+wXaHxf7aLQT0dZR+AlfA @ 2020-12-07 13:00 UTC (permalink / raw)
  To: devicetree-compiler-u79uwXL29TY76Z2rM5mHXA
  Cc: david-xT8FGy+AXnRB3Ne2BGzF6laj5H9X9Tb+, Marc-André Lureau

From: Marc-André Lureau <marcandre.lureau-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>

The next patch is going to switch the build-sys to meson.

Signed-off-by: Marc-André Lureau <marcandre.lureau-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
---
 .travis.yml | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/.travis.yml b/.travis.yml
index a5163de..aad9f68 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -6,6 +6,12 @@ env:
   # COVERITY_SCAN_TOKEN (dgibson/dtc)
   - secure: "vlHvXe618//IM9LQaKzqsrUbjs7ng0L9UCST4kJbJnFQDXvVe5JiSmJGd4ef7mm0NUv5bMRl2W3xCiu6BYAu/NvU3tMNHoLG+JgCJs0+wLJXbWOwji/NmH7olqgJG+CmpaCMXjARF6+nrTnBYHJL6cYyf4KVoV4B0I/hLUW91+s="
 
+before_install:
+  - '[ $TRAVIS_CPU_ARCH = amd64 ] && sudo add-apt-repository -y "deb http://archive.ubuntu.com/ubuntu xenial-backports main universe" || sudo add-apt-repository -y "deb http://ports.ubuntu.com xenial-backports main universe"'
+  - sudo apt-get -q update
+  - sudo apt-get -t xenial-backports install -y python3 python3-setuptools python3-pip ninja-build
+  - sudo pip3 install meson
+
 matrix:
   include:
     - addons:
-- 
2.29.0


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

* [PATCH 5/5] build-sys: replace makefiles to wrap meson/ninja
       [not found] ` <20201207130055.462734-1-marcandre.lureau-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
                     ` (3 preceding siblings ...)
  2020-12-07 13:00   ` [PATCH 4/5] travis: install meson marcandre.lureau-H+wXaHxf7aLQT0dZR+AlfA
@ 2020-12-07 13:00   ` marcandre.lureau-H+wXaHxf7aLQT0dZR+AlfA
       [not found]     ` <20201207130055.462734-6-marcandre.lureau-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
  2020-12-08  4:33   ` [PATCH 0/5] Follow-up on meson David Gibson
  5 siblings, 1 reply; 12+ messages in thread
From: marcandre.lureau-H+wXaHxf7aLQT0dZR+AlfA @ 2020-12-07 13:00 UTC (permalink / raw)
  To: devicetree-compiler-u79uwXL29TY76Z2rM5mHXA
  Cc: david-xT8FGy+AXnRB3Ne2BGzF6laj5H9X9Tb+, Marc-André Lureau

From: Marc-André Lureau <marcandre.lureau-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>

This avoids maintaining two build systems, and update the documentation.

Makefile now wrap meson, so that make all/check/checkm/clean/install
continue working as they used to.

Signed-off-by: Marc-André Lureau <marcandre.lureau-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
---
 Makefile                   | 380 ++-----------------------------------
 Makefile.convert-dtsv0     |  14 --
 Makefile.dtc               |  23 ---
 Makefile.utils             |  31 ---
 README                     |  24 ++-
 libfdt/Makefile.libfdt     |  18 --
 pylibfdt/Makefile.pylibfdt |  30 ---
 tests/Makefile.tests       | 100 ----------
 tests/run_tests.sh         |  10 +-
 9 files changed, 46 insertions(+), 584 deletions(-)
 delete mode 100644 Makefile.convert-dtsv0
 delete mode 100644 Makefile.dtc
 delete mode 100644 Makefile.utils
 delete mode 100644 libfdt/Makefile.libfdt
 delete mode 100644 pylibfdt/Makefile.pylibfdt
 delete mode 100644 tests/Makefile.tests

diff --git a/Makefile b/Makefile
index c187d5f..9f0424e 100644
--- a/Makefile
+++ b/Makefile
@@ -3,286 +3,22 @@
 # Device Tree Compiler
 #
 
-#
-# Version information will be constructed in this order:
-# EXTRAVERSION might be "-rc", for example.
-# LOCAL_VERSION is likely from command line.
-# CONFIG_LOCALVERSION from some future config system.
-#
-VERSION = 1
-PATCHLEVEL = 6
-SUBLEVEL = 0
-EXTRAVERSION =
-LOCAL_VERSION =
-CONFIG_LOCALVERSION =
-
-# Control the assumptions made (e.g. risking security issues) in the code.
-# See libfdt_internal.h for details
-ASSUME_MASK ?= 0
-
-CPPFLAGS = -I libfdt -I . -DFDT_ASSUME_MASK=$(ASSUME_MASK)
-WARNINGS = -Wall -Wpointer-arith -Wcast-qual -Wnested-externs \
-	-Wstrict-prototypes -Wmissing-prototypes -Wredundant-decls -Wshadow
-CFLAGS = -g -Os $(SHAREDLIB_CFLAGS) -Werror $(WARNINGS) $(EXTRA_CFLAGS)
-
-BISON = bison
-LEX = flex
-SWIG = swig
-PKG_CONFIG ?= pkg-config
-PYTHON ?= python3
-
-INSTALL = /usr/bin/install
-INSTALL_PROGRAM = $(INSTALL)
-INSTALL_LIB = $(INSTALL)
-INSTALL_DATA = $(INSTALL) -m 644
-INSTALL_SCRIPT = $(INSTALL)
-DESTDIR =
-PREFIX = $(HOME)
-BINDIR = $(PREFIX)/bin
-LIBDIR = $(PREFIX)/lib
-INCLUDEDIR = $(PREFIX)/include
-
-HOSTOS := $(shell uname -s | tr '[:upper:]' '[:lower:]' | \
-	    sed -e 's/\(cygwin\|msys\).*/\1/')
-
-NO_PYTHON ?= 0
-
-NO_VALGRIND := $(shell $(PKG_CONFIG) --exists valgrind; echo $$?)
-ifeq ($(NO_VALGRIND),1)
-	CPPFLAGS += -DNO_VALGRIND
-else
-	CFLAGS += $(shell $(PKG_CONFIG) --cflags valgrind)
-endif
-
-NO_YAML := $(shell $(PKG_CONFIG) --exists yaml-0.1; echo $$?)
-ifeq ($(NO_YAML),1)
-	CFLAGS += -DNO_YAML
-else
-	LDLIBS_dtc += $(shell $(PKG_CONFIG) --libs yaml-0.1)
-	CFLAGS += $(shell $(PKG_CONFIG) --cflags yaml-0.1)
-endif
-
-ifeq ($(HOSTOS),darwin)
-SHAREDLIB_EXT     = dylib
-SHAREDLIB_CFLAGS  = -fPIC
-SHAREDLIB_LDFLAGS = -fPIC -dynamiclib -Wl,-install_name -Wl,
-else ifeq ($(HOSTOS),$(filter $(HOSTOS),msys cygwin))
-SHAREDLIB_EXT     = so
-SHAREDLIB_CFLAGS  =
-SHAREDLIB_LDFLAGS = -shared -Wl,--version-script=$(LIBFDT_version) -Wl,-soname,
-else
-SHAREDLIB_EXT     = so
-SHAREDLIB_CFLAGS  = -fPIC
-SHAREDLIB_LDFLAGS = -fPIC -shared -Wl,--version-script=$(LIBFDT_version) -Wl,-soname,
-endif
-
-#
-# Overall rules
-#
-ifdef V
-VECHO = :
-else
-VECHO = echo "	"
-ARFLAGS = rc
-.SILENT:
-endif
-
-NODEPTARGETS = clean
-ifeq ($(MAKECMDGOALS),)
-DEPTARGETS = all
-else
-DEPTARGETS = $(filter-out $(NODEPTARGETS),$(MAKECMDGOALS))
-endif
-
-#
-# Rules for versioning
-#
-
-DTC_VERSION = $(VERSION).$(PATCHLEVEL).$(SUBLEVEL)$(EXTRAVERSION)
-VERSION_FILE = version_gen.h
-
-CONFIG_SHELL := $(shell if [ -x "$$BASH" ]; then echo $$BASH; \
-	  else if [ -x /bin/bash ]; then echo /bin/bash; \
-	  else echo sh; fi ; fi)
+BUILD_DIR=build
 
-nullstring :=
-space	:= $(nullstring) # end of line
+all: $(BUILD_DIR)/build.ninja
+	ninja -C build
 
-localver_config = $(subst $(space),, $(string) \
-			      $(patsubst "%",%,$(CONFIG_LOCALVERSION)))
+$(BUILD_DIR)/build.ninja:
+	meson $(BUILD_DIR)
 
-localver_cmd = $(subst $(space),, $(string) \
-			      $(patsubst "%",%,$(LOCALVERSION)))
+check:
+	meson test -C $(BUILD_DIR) -v
 
-localver_scm = $(shell $(CONFIG_SHELL) ./scripts/setlocalversion)
-localver_full  = $(localver_config)$(localver_cmd)$(localver_scm)
+checkm:
+	WITH_VALGRIND=1 meson test -C $(BUILD_DIR) -v
 
-dtc_version = $(DTC_VERSION)$(localver_full)
-
-# Contents of the generated version file.
-define filechk_version
-	(echo "#define DTC_VERSION \"DTC $(dtc_version)\""; )
-endef
-
-define filechk
-	set -e;					\
-	echo '	CHK $@';			\
-	mkdir -p $(dir $@);			\
-	$(filechk_$(1)) < $< > $@.tmp;		\
-	if [ -r $@ ] && cmp -s $@ $@.tmp; then	\
-		rm -f $@.tmp;			\
-	else					\
-		echo '	UPD $@';		\
-		mv -f $@.tmp $@;		\
-	fi;
-endef
-
-
-include Makefile.convert-dtsv0
-include Makefile.dtc
-include Makefile.utils
-
-BIN += convert-dtsv0
-BIN += dtc
-BIN += fdtdump
-BIN += fdtget
-BIN += fdtput
-BIN += fdtoverlay
-
-SCRIPTS = dtdiff
-
-all: $(BIN) libfdt
-
-# We need both Python and swig to build/install pylibfdt.
-# This builds the given make ${target} if those deps are found.
-check_python_deps = \
-	if $(PKG_CONFIG) --cflags $(PYTHON) >/dev/null 2>&1; then \
-		if which swig >/dev/null 2>&1; then \
-			can_build=yes; \
-		fi; \
-	fi; \
-	if [ "$${can_build}" = "yes" ]; then \
-		$(MAKE) $${target}; \
-	else \
-		echo "\#\# Skipping pylibfdt (install python dev and swig to build)"; \
-	fi ;
-
-.PHONY: maybe_pylibfdt
-maybe_pylibfdt: FORCE
-	target=pylibfdt; $(check_python_deps)
-
-ifeq ($(NO_PYTHON),0)
-all: maybe_pylibfdt
-endif
-
-
-ifneq ($(DEPTARGETS),)
-ifneq ($(MAKECMDGOALS),libfdt)
--include $(DTC_OBJS:%.o=%.d)
--include $(CONVERT_OBJS:%.o=%.d)
--include $(FDTDUMP_OBJS:%.o=%.d)
--include $(FDTGET_OBJS:%.o=%.d)
--include $(FDTPUT_OBJS:%.o=%.d)
--include $(FDTOVERLAY_OBJS:%.o=%.d)
-endif
-endif
-
-
-
-#
-# Rules for libfdt
-#
-LIBFDT_dir = libfdt
-LIBFDT_archive = $(LIBFDT_dir)/libfdt.a
-LIBFDT_lib = $(LIBFDT_dir)/$(LIBFDT_LIB)
-LIBFDT_include = $(addprefix $(LIBFDT_dir)/,$(LIBFDT_INCLUDES))
-LIBFDT_version = $(addprefix $(LIBFDT_dir)/,$(LIBFDT_VERSION))
-
-include $(LIBFDT_dir)/Makefile.libfdt
-
-.PHONY: libfdt
-libfdt: $(LIBFDT_archive) $(LIBFDT_lib)
-
-$(LIBFDT_archive): $(addprefix $(LIBFDT_dir)/,$(LIBFDT_OBJS))
-
-$(LIBFDT_lib): $(addprefix $(LIBFDT_dir)/,$(LIBFDT_OBJS)) $(LIBFDT_version)
-	@$(VECHO) LD $@
-	$(CC) $(LDFLAGS) $(SHAREDLIB_LDFLAGS)$(LIBFDT_soname) -o $(LIBFDT_lib) \
-		$(addprefix $(LIBFDT_dir)/,$(LIBFDT_OBJS))
-	ln -sf $(LIBFDT_LIB) $(LIBFDT_dir)/$(LIBFDT_soname)
-
-ifneq ($(DEPTARGETS),)
--include $(LIBFDT_OBJS:%.o=$(LIBFDT_dir)/%.d)
-endif
-
-# This stops make from generating the lex and bison output during
-# auto-dependency computation, but throwing them away as an
-# intermediate target and building them again "for real"
-.SECONDARY: $(DTC_GEN_SRCS) $(CONVERT_GEN_SRCS)
-
-install-bin: all $(SCRIPTS)
-	@$(VECHO) INSTALL-BIN
-	$(INSTALL) -d $(DESTDIR)$(BINDIR)
-	$(INSTALL_PROGRAM) $(BIN) $(DESTDIR)$(BINDIR)
-	$(INSTALL_SCRIPT) $(SCRIPTS) $(DESTDIR)$(BINDIR)
-
-install-lib: all
-	@$(VECHO) INSTALL-LIB
-	$(INSTALL) -d $(DESTDIR)$(LIBDIR)
-	$(INSTALL_LIB) $(LIBFDT_lib) $(DESTDIR)$(LIBDIR)
-	ln -sf $(notdir $(LIBFDT_lib)) $(DESTDIR)$(LIBDIR)/$(LIBFDT_soname)
-	ln -sf $(LIBFDT_soname) $(DESTDIR)$(LIBDIR)/libfdt.$(SHAREDLIB_EXT)
-	$(INSTALL_DATA) $(LIBFDT_archive) $(DESTDIR)$(LIBDIR)
-
-install-includes:
-	@$(VECHO) INSTALL-INC
-	$(INSTALL) -d $(DESTDIR)$(INCLUDEDIR)
-	$(INSTALL_DATA) $(LIBFDT_include) $(DESTDIR)$(INCLUDEDIR)
-
-install: install-bin install-lib install-includes
-
-.PHONY: maybe_install_pylibfdt
-maybe_install_pylibfdt: FORCE
-	target=install_pylibfdt; $(check_python_deps)
-
-ifeq ($(NO_PYTHON),0)
-install: maybe_install_pylibfdt
-endif
-
-$(VERSION_FILE): Makefile FORCE
-	$(call filechk,version)
-
-
-dtc: $(DTC_OBJS)
-
-convert-dtsv0: $(CONVERT_OBJS)
-	@$(VECHO) LD $@
-	$(LINK.c) -o $@ $^
-
-fdtdump:	$(FDTDUMP_OBJS)
-
-fdtget:	$(FDTGET_OBJS) $(LIBFDT_lib)
-
-fdtput:	$(FDTPUT_OBJS) $(LIBFDT_lib)
-
-fdtoverlay: $(FDTOVERLAY_OBJS) $(LIBFDT_lib)
-
-dist:
-	git archive --format=tar --prefix=dtc-$(dtc_version)/ HEAD \
-		> ../dtc-$(dtc_version).tar
-	cat ../dtc-$(dtc_version).tar | \
-		gzip -9 > ../dtc-$(dtc_version).tar.gz
-
-
-#
-# Rules for pylibfdt
-#
-PYLIBFDT_dir = pylibfdt
-
-include $(PYLIBFDT_dir)/Makefile.pylibfdt
-
-.PHONY: pylibfdt
-pylibfdt: $(PYLIBFDT_dir)/_libfdt.so
+%::
+	ninja -C $(BUILD_DIR) $@
 
 #
 # Release signing and uploading
@@ -294,91 +30,11 @@ KUP = kup
 KUPDIR = /pub/software/utils/dtc
 
 kup: dist
-	$(GPG) --detach-sign --armor -o ../dtc-$(dtc_version).tar.sign \
-		../dtc-$(dtc_version).tar
-	$(KUP) put ../dtc-$(dtc_version).tar.gz ../dtc-$(dtc_version).tar.sign \
-		$(KUPDIR)/dtc-$(dtc_version).tar.gz
+	dtc_version=`meson introspect --projectinfo build | jq -r '.version'` && \
+	xz -d build/meson-dist/dtc-$$dtc_version.tar.xz && \
+	$(GPG) --detach-sign --armor -o dtc-$$dtc_version.tar.sign \
+		build/meson-dist/dtc-$$dtc_version.tar && \
+	gzip build/meson-dist/dtc-$$dtc_version.tar && \
+	$(KUP) put build/meson-dist/dtc-$$dtc_version.tar.gz dtc-$$dtc_version.tar.sign \
+		$(KUPDIR)/dtc-$$dtc_version.tar.gz
 endif
-
-tags: FORCE
-	rm -f tags
-	find . \( -name tests -type d -prune \) -o \
-	       \( ! -name '*.tab.[ch]' ! -name '*.lex.c' \
-	       -name '*.[chly]' -type f -print \) | xargs ctags -a
-
-#
-# Testsuite rules
-#
-TESTS_PREFIX=tests/
-
-TESTS_BIN += dtc
-TESTS_BIN += convert-dtsv0
-TESTS_BIN += fdtput
-TESTS_BIN += fdtget
-TESTS_BIN += fdtdump
-TESTS_BIN += fdtoverlay
-ifeq ($(NO_PYTHON),0)
-TESTS_PYLIBFDT += maybe_pylibfdt
-endif
-
-ifneq ($(MAKECMDGOALS),libfdt)
-include tests/Makefile.tests
-endif
-
-#
-# Clean rules
-#
-STD_CLEANFILES = *~ *.o *.$(SHAREDLIB_EXT) *.d *.a *.i *.s core a.out vgcore.* \
-	*.tab.[ch] *.lex.c *.output
-
-clean: libfdt_clean pylibfdt_clean tests_clean
-	@$(VECHO) CLEAN
-	rm -f $(STD_CLEANFILES)
-	rm -f $(VERSION_FILE)
-	rm -f $(BIN)
-	rm -f dtc-*.tar dtc-*.tar.sign dtc-*.tar.asc
-
-#
-# Generic compile rules
-#
-%: %.o
-	@$(VECHO) LD $@
-	$(LINK.c) -o $@ $^ $(LDLIBS_$*)
-
-%.o: %.c
-	@$(VECHO) CC $@
-	$(CC) $(CPPFLAGS) $(CFLAGS) -o $@ -c $<
-
-%.o: %.S
-	@$(VECHO) AS $@
-	$(CC) $(CPPFLAGS) $(AFLAGS) -D__ASSEMBLY__ -o $@ -c $<
-
-%.d: %.c
-	@$(VECHO) DEP $<
-	$(CC) $(CPPFLAGS) $(CFLAGS) -MM -MG -MT "$*.o $@" $< > $@
-
-%.d: %.S
-	@$(VECHO) DEP $<
-	$(CC) $(CPPFLAGS) -MM -MG -MT "$*.o $@" $< > $@
-
-%.i:	%.c
-	@$(VECHO) CPP $@
-	$(CC) $(CPPFLAGS) -E $< > $@
-
-%.s:	%.c
-	@$(VECHO) CC -S $@
-	$(CC) $(CPPFLAGS) $(CFLAGS) -o $@ -S $<
-
-%.a:
-	@$(VECHO) AR $@
-	$(AR) $(ARFLAGS) $@ $^
-
-%.lex.c: %.l
-	@$(VECHO) LEX $@
-	$(LEX) -o$@ $<
-
-%.tab.c %.tab.h %.output: %.y
-	@$(VECHO) BISON $@
-	$(BISON) -b $(basename $(basename $@)) -d $<
-
-FORCE:
diff --git a/Makefile.convert-dtsv0 b/Makefile.convert-dtsv0
deleted file mode 100644
index c12ed40..0000000
--- a/Makefile.convert-dtsv0
+++ /dev/null
@@ -1,14 +0,0 @@
-# SPDX-License-Identifier: GPL-2.0-or-later
-#
-# This is not a complete Makefile of itself.
-# Instead, it is designed to be easily embeddable
-# into other systems of Makefiles.
-#
-
-CONVERT_SRCS = \
-	srcpos.c \
-	util.c
-
-CONVERT_GEN_SRCS = convert-dtsv0-lexer.lex.c
-
-CONVERT_OBJS = $(CONVERT_SRCS:%.c=%.o) $(CONVERT_GEN_SRCS:%.c=%.o)
diff --git a/Makefile.dtc b/Makefile.dtc
deleted file mode 100644
index 9c467b0..0000000
--- a/Makefile.dtc
+++ /dev/null
@@ -1,23 +0,0 @@
-# SPDX-License-Identifier: GPL-2.0-or-later
-# Makefile.dtc
-#
-# This is not a complete Makefile of itself.  Instead, it is designed to
-# be easily embeddable into other systems of Makefiles.
-#
-DTC_SRCS = \
-	checks.c \
-	data.c \
-	dtc.c \
-	flattree.c \
-	fstree.c \
-	livetree.c \
-	srcpos.c \
-	treesource.c \
-	util.c
-
-ifneq ($(NO_YAML),1)
-DTC_SRCS += yamltree.c
-endif
-
-DTC_GEN_SRCS = dtc-lexer.lex.c dtc-parser.tab.c
-DTC_OBJS = $(DTC_SRCS:%.c=%.o) $(DTC_GEN_SRCS:%.c=%.o)
diff --git a/Makefile.utils b/Makefile.utils
deleted file mode 100644
index 9436b34..0000000
--- a/Makefile.utils
+++ /dev/null
@@ -1,31 +0,0 @@
-# SPDX-License-Identifier: GPL-2.0-or-later
-#
-# This is not a complete Makefile of itself.  Instead, it is designed to
-# be easily embeddable into other systems of Makefiles.
-#
-
-FDTDUMP_SRCS = \
-	fdtdump.c \
-	util.c
-
-FDTDUMP_OBJS = $(FDTDUMP_SRCS:%.c=%.o)
-
-
-FDTGET_SRCS = \
-	fdtget.c \
-	util.c
-
-FDTGET_OBJS = $(FDTGET_SRCS:%.c=%.o)
-
-
-FDTPUT_SRCS = \
-	fdtput.c \
-	util.c
-
-FDTPUT_OBJS = $(FDTPUT_SRCS:%.c=%.o)
-
-FDTOVERLAY_SRCS = \
-	fdtoverlay.c \
-	util.c
-
-FDTOVERLAY_OBJS = $(FDTOVERLAY_SRCS:%.c=%.o)
diff --git a/README b/README
index 9465ee5..68a06f6 100644
--- a/README
+++ b/README
@@ -7,6 +7,21 @@ DTC and LIBFDT are maintained by:
 David Gibson <david-xT8FGy+AXnRB3Ne2BGzF6laj5H9X9Tb+@public.gmane.org>
 Jon Loeliger <jdl-CYoMK+44s/E@public.gmane.org>
 
+Building
+--------
+
+This project is built with meson. See the manual for detailed usages:
+https://mesonbuild.com/Running-Meson.html
+
+In short, from the source directory, you can configure, build and test the
+project with those commands:
+$ meson builddir
+$ ninja -C builddir
+$ ninja -C builddir test
+
+For convenience, a Makefile wraps meson for you with the regular "make", "make
+check" and "make install" targets. Although further build tweaking will require
+you to invoke meson manually.
 
 Python library
 --------------
@@ -58,13 +73,12 @@ also install via the Makefile if you like, but the above is more common.
 
 To install both libfdt and pylibfdt you can use:
 
-    make install [SETUP_PREFIX=/path/to/install_dir] \
-            [PREFIX=/path/to/install_dir]
+    meson -C builddir install
 
 To disable building the python library, even if swig and Python are available,
 use:
 
-    make NO_PYTHON=1
+    meson configure builddir -Dpython=disabled
 
 
 More work remains to support all of libfdt, including access to numeric
@@ -74,8 +88,8 @@ values.
 Tests
 -----
 
-Test files are kept in the tests/ directory. Use 'make check' to build and run
-all tests.
+Test files are kept in the tests/ directory. Use 'ninja test' to build and run
+all tests (or 'make check' in the source directory).
 
 If you want to adjust a test file, be aware that tree_tree1.dts is compiled
 and checked against a binary tree from assembler macros in trees.S. So
diff --git a/libfdt/Makefile.libfdt b/libfdt/Makefile.libfdt
deleted file mode 100644
index b6d8fc0..0000000
--- a/libfdt/Makefile.libfdt
+++ /dev/null
@@ -1,18 +0,0 @@
-# SPDX-License-Identifier: (GPL-2.0-or-later OR BSD-2-Clause)
-# Makefile.libfdt
-#
-# This is not a complete Makefile of itself.  Instead, it is designed to
-# be easily embeddable into other systems of Makefiles.
-#
-LIBFDT_soname = libfdt.$(SHAREDLIB_EXT).1
-LIBFDT_INCLUDES = fdt.h libfdt.h libfdt_env.h
-LIBFDT_VERSION = version.lds
-LIBFDT_SRCS = fdt.c fdt_ro.c fdt_wip.c fdt_sw.c fdt_rw.c fdt_strerror.c fdt_empty_tree.c \
-	fdt_addresses.c fdt_overlay.c fdt_check.c
-LIBFDT_OBJS = $(LIBFDT_SRCS:%.c=%.o)
-LIBFDT_LIB = libfdt-$(DTC_VERSION).$(SHAREDLIB_EXT)
-
-libfdt_clean:
-	@$(VECHO) CLEAN "(libfdt)"
-	rm -f $(STD_CLEANFILES:%=$(LIBFDT_dir)/%)
-	rm -f $(LIBFDT_dir)/$(LIBFDT_soname)
diff --git a/pylibfdt/Makefile.pylibfdt b/pylibfdt/Makefile.pylibfdt
deleted file mode 100644
index 1b5f236..0000000
--- a/pylibfdt/Makefile.pylibfdt
+++ /dev/null
@@ -1,30 +0,0 @@
-# SPDX-License-Identifier: (GPL-2.0-or-later OR BSD-2-Clause)
-# Makefile.pylibfdt
-#
-
-PYLIBFDT_srcs = $(PYLIBFDT_dir)/libfdt.i
-PYMODULE = $(PYLIBFDT_dir)/_libfdt.so
-PYLIBFDT_CLEANFILES_L = libfdt_wrap.c libfdt.py *.pyc *.so
-PYLIBFDT_CLEANFILES = $(PYLIBFDT_CLEANFILES_L:%=$(PYLIBFDT_dir)/%)
-PYLIBFDT_CLEANDIRS_L = build __pycache__
-PYLIBFDT_CLEANDIRS = $(PYLIBFDT_CLEANDIRS_L:%=$(PYLIBFDT_dir)/%)
-
-SETUP = $(PYLIBFDT_dir)/setup.py
-SETUPFLAGS = --top-builddir .
-
-ifndef V
-SETUPFLAGS += --quiet
-endif
-
-$(PYMODULE): $(PYLIBFDT_srcs) $(LIBFDT_archive) $(SETUP) $(VERSION_FILE)
-	@$(VECHO) PYMOD $@
-	$(PYTHON) $(SETUP) $(SETUPFLAGS) build_ext --build-lib=$(PYLIBFDT_dir)
-
-install_pylibfdt: $(PYMODULE)
-	@$(VECHO) INSTALL-PYLIB
-	$(PYTHON) $(SETUP) $(SETUPFLAGS) install --prefix=$(PREFIX)
-
-pylibfdt_clean:
-	@$(VECHO) CLEAN "(pylibfdt)"
-	rm -f $(PYLIBFDT_CLEANFILES)
-	rm -rf $(PYLIBFDT_CLEANDIRS)
diff --git a/tests/Makefile.tests b/tests/Makefile.tests
deleted file mode 100644
index cb66c9f..0000000
--- a/tests/Makefile.tests
+++ /dev/null
@@ -1,100 +0,0 @@
-LIB_TESTS_L = get_mem_rsv \
-	root_node find_property subnode_offset path_offset \
-	get_name getprop get_prop_offset get_phandle \
-	get_path supernode_atdepth_offset parent_offset \
-	node_offset_by_prop_value node_offset_by_phandle \
-	node_check_compatible node_offset_by_compatible \
-	get_alias \
-	char_literal \
-	sized_cells \
-	notfound \
-	addr_size_cells \
-	addr_size_cells2 \
-	appendprop_addrrange \
-	stringlist \
-	setprop_inplace nop_property nop_node \
-	sw_tree1 sw_states \
-	move_and_save mangle-layout nopulate \
-	open_pack rw_tree1 rw_oom set_name setprop del_property del_node \
-	appendprop1 appendprop2 propname_escapes \
-	string_escapes references path-references phandle_format \
-	boot-cpuid incbin \
-	extra-terminating-null \
-	dtbs_equal_ordered \
-	dtb_reverse dtbs_equal_unordered \
-	add_subnode_with_nops path_offset_aliases \
-	utilfdt_test \
-	integer-expressions \
-	property_iterate \
-	subnode_iterate \
-	overlay overlay_bad_fixup \
-	check_path check_header check_full \
-	fs_tree1
-LIB_TESTS = $(LIB_TESTS_L:%=$(TESTS_PREFIX)%)
-
-LIBTREE_TESTS_L = truncated_property truncated_string truncated_memrsv
-LIBTREE_TESTS = $(LIBTREE_TESTS_L:%=$(TESTS_PREFIX)%)
-
-DL_LIB_TESTS_L = asm_tree_dump value-labels
-DL_LIB_TESTS = $(DL_LIB_TESTS_L:%=$(TESTS_PREFIX)%)
-
-TESTS = $(LIB_TESTS) $(LIBTREE_TESTS) $(DL_LIB_TESTS)
-
-TESTS_TREES_L = test_tree1.dtb
-TESTS_TREES = $(TESTS_TREES_L:%=$(TESTS_PREFIX)%)
-
-TESTS_TARGETS = $(TESTS) $(TESTS_TREES)
-
-TESTS_DEPFILES = $(TESTS:%=%.d) \
-	$(addprefix $(TESTS_PREFIX),testutils.d trees.d dumptrees.d)
-
-TESTS_CLEANFILES_L = $(STD_CLEANFILES) \
-	*.dtb *.test.dts *.test.dt.yaml *.dtsv1 tmp.* *.bak \
-	dumptrees
-TESTS_CLEANFILES = $(TESTS) $(TESTS_CLEANFILES_L:%=$(TESTS_PREFIX)%)
-TESTS_CLEANDIRS_L = fs
-TESTS_CLEANDIRS = $(TESTS_CLEANDIRS_L:%=$(TESTS_PREFIX)%)
-
-.PHONY: tests
-tests:	$(TESTS) $(TESTS_TREES)
-
-$(LIB_TESTS): %: $(TESTS_PREFIX)testutils.o util.o $(LIBFDT_lib)
-
-# Not necessary on all platforms; allow -ldl to be excluded instead of forcing
-# other platforms to patch it out.
-LIBDL = -ldl
-$(DL_LIB_TESTS): %: %.o $(TESTS_PREFIX)testutils.o util.o $(LIBFDT_lib)
-	@$(VECHO) LD [libdl] $@
-	$(LINK.c) -o $@ $^ $(LIBDL)
-
-$(LIBTREE_TESTS): %: $(TESTS_PREFIX)testutils.o $(TESTS_PREFIX)trees.o \
-		util.o $(LIBFDT_lib)
-
-$(TESTS_PREFIX)dumptrees: $(TESTS_PREFIX)trees.o
-
-$(TESTS_TREES): $(TESTS_PREFIX)dumptrees
-	@$(VECHO) DUMPTREES
-	cd $(TESTS_PREFIX); ./dumptrees . >/dev/null
-
-tests_clean:
-	@$(VECHO) CLEAN "(tests)"
-	rm -f $(TESTS_CLEANFILES)
-	rm -rf $(TESTS_CLEANDIRS)
-
-check:	tests ${TESTS_BIN} $(TESTS_PYLIBFDT)
-	cd $(TESTS_PREFIX); ./run_tests.sh
-
-ifeq ($(NO_VALGRIND),1)
-checkm:
-	@echo "make checkm requires valgrind, but NO_VALGRIND=1"
-else
-checkm: tests ${TESTS_BIN} $(TESTS_PYLIBFDT)
-	cd $(TESTS_PREFIX); ./run_tests.sh -m
-endif
-
-checkv:	tests ${TESTS_BIN} $(TESTS_PYLIBFDT)
-	cd $(TESTS_PREFIX); ./run_tests.sh -v
-
-ifneq ($(DEPTARGETS),)
--include $(TESTS_DEPFILES)
-endif
diff --git a/tests/run_tests.sh b/tests/run_tests.sh
index 294585b..535f6e0 100755
--- a/tests/run_tests.sh
+++ b/tests/run_tests.sh
@@ -1027,6 +1027,10 @@ pylibfdt_tests () {
     tot_tests=$((tot_tests + $total_tests))
 }
 
+setup_valgrind () {
+    VALGRIND="valgrind --tool=memcheck -q --error-exitcode=$VGCODE"
+}
+
 while getopts "vt:me" ARG ; do
     case $ARG in
 	"v")
@@ -1036,7 +1040,7 @@ while getopts "vt:me" ARG ; do
 	    TESTSETS=$OPTARG
 	    ;;
 	"m")
-	    VALGRIND="valgrind --tool=memcheck -q --error-exitcode=$VGCODE"
+	    setup_valgrind
 	    ;;
 	"e")
 	    STOP_ON_FAIL=1
@@ -1044,6 +1048,10 @@ while getopts "vt:me" ARG ; do
     esac
 done
 
+if [ -n "$WITH_VALGRIND" ]; then
+    setup_valgrind
+fi
+
 if [ -z "$TESTSETS" ]; then
     TESTSETS="libfdt utilfdt dtc dtbs_equal fdtget fdtput fdtdump fdtoverlay"
 
-- 
2.29.0


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

* Re: [PATCH 0/5] Follow-up on meson
       [not found] ` <20201207130055.462734-1-marcandre.lureau-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
                     ` (4 preceding siblings ...)
  2020-12-07 13:00   ` [PATCH 5/5] build-sys: replace makefiles to wrap meson/ninja marcandre.lureau-H+wXaHxf7aLQT0dZR+AlfA
@ 2020-12-08  4:33   ` David Gibson
  5 siblings, 0 replies; 12+ messages in thread
From: David Gibson @ 2020-12-08  4:33 UTC (permalink / raw)
  To: marcandre.lureau-H+wXaHxf7aLQT0dZR+AlfA
  Cc: devicetree-compiler-u79uwXL29TY76Z2rM5mHXA

[-- Attachment #1: Type: text/plain, Size: 1925 bytes --]

On Mon, Dec 07, 2020 at 05:00:50PM +0400, marcandre.lureau-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org wrote:
> From: Marc-André Lureau <marcandre.lureau-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
> 
> Hi,
> 
> Some v4 patches of the series "Add meson subsystem" were pushed, while v5 and v6
> were posted on the list. Here is the remaining changes I have on top of
> upstream. There are a few misc fixes, and the last patch removes the
> Makefile-based system, while keeping the traditional make all/check/install/clean
> interface to ease the transition.

I've applied 1..3, 4 & 5 I'll need a bit more time to look over.

> 
> Marc-André Lureau (5):
>   meson: fix -Wall warning
>   meson: do not assume python is installed, skip tests
>   meson: increase default timeout for tests
>   travis: install meson
>   build-sys: replace makefiles to wrap meson/ninja
> 
>  .travis.yml                |   6 +
>  Makefile                   | 380 ++-----------------------------------
>  Makefile.convert-dtsv0     |  14 --
>  Makefile.dtc               |  23 ---
>  Makefile.utils             |  31 ---
>  README                     |  24 ++-
>  libfdt/Makefile.libfdt     |  18 --
>  meson.build                |  22 ++-
>  pylibfdt/Makefile.pylibfdt |  30 ---
>  tests/Makefile.tests       | 100 ----------
>  tests/meson.build          |  13 +-
>  tests/run_tests.sh         |  10 +-
>  12 files changed, 71 insertions(+), 600 deletions(-)
>  delete mode 100644 Makefile.convert-dtsv0
>  delete mode 100644 Makefile.dtc
>  delete mode 100644 Makefile.utils
>  delete mode 100644 libfdt/Makefile.libfdt
>  delete mode 100644 pylibfdt/Makefile.pylibfdt
>  delete mode 100644 tests/Makefile.tests
> 

-- 
David Gibson			| I'll have my music baroque, and my code
david AT gibson.dropbear.id.au	| minimalist, thank you.  NOT _the_ _other_
				| _way_ _around_!
http://www.ozlabs.org/~dgibson

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

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

* Re: [PATCH 5/5] build-sys: replace makefiles to wrap meson/ninja
       [not found]     ` <20201207130055.462734-6-marcandre.lureau-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
@ 2021-06-08  3:54       ` David Gibson
       [not found]         ` <CAMxuvaxcwrDiuxKizMjkXZFy6K3X0TSN-Z-=+SNXe53j1pMr1A@mail.gmail.com>
  0 siblings, 1 reply; 12+ messages in thread
From: David Gibson @ 2021-06-08  3:54 UTC (permalink / raw)
  To: marcandre.lureau-H+wXaHxf7aLQT0dZR+AlfA
  Cc: devicetree-compiler-u79uwXL29TY76Z2rM5mHXA

[-- Attachment #1: Type: text/plain, Size: 1900 bytes --]

On Mon, Dec 07, 2020 at 05:00:55PM +0400, marcandre.lureau-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org wrote:
> From: Marc-André Lureau <marcandre.lureau-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
> 
> This avoids maintaining two build systems, and update the documentation.
> 
> Makefile now wrap meson, so that make all/check/checkm/clean/install
> continue working as they used to.
> 
> Signed-off-by: Marc-André Lureau <marcandre.lureau-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>

Sorry I've neglected this so long.  I finally got around to lookup up
a cheatsheet for how to use meson "natively" to understand this
better.

Couple of issues with this path though:

> ---
>  Makefile                   | 380 ++-----------------------------------
>  Makefile.convert-dtsv0     |  14 --
>  Makefile.dtc               |  23 ---
>  Makefile.utils             |  31 ---
>  README                     |  24 ++-
>  libfdt/Makefile.libfdt     |  18 --
>  pylibfdt/Makefile.pylibfdt |  30 ---
>  tests/Makefile.tests       | 100 ----------

First, it no longer applies clean due to some added tests.  Can you
rebase please.

> +checkm:
> +	WITH_VALGRIND=1 meson test -C $(BUILD_DIR) -v

Second, the valgrind stuff doesn't seem to work.  I tried
"WITH_VALGRIND=1 meson test" and it completes much to fast to actually
be using valgrind.  Also it doesn't give any error if valgrind isn't
installed.

It's also not ideal that the output from "meson test" is trivial with
all the content now in the meson log file.  Assuming we can sort out
this first part, would you be willing to help convert the existing
testsuite / testrunner to be more "meson native" so we can improve
that?

-- 
David Gibson			| I'll have my music baroque, and my code
david AT gibson.dropbear.id.au	| minimalist, thank you.  NOT _the_ _other_
				| _way_ _around_!
http://www.ozlabs.org/~dgibson

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

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

* Re: [PATCH 4/5] travis: install meson
       [not found]     ` <20201207130055.462734-5-marcandre.lureau-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
@ 2021-06-08  3:54       ` David Gibson
       [not found]         ` <CAMxuvax=yjONOpay9+CvYvV88MKFu84W8w0SpiDyg3GuQaHA0g@mail.gmail.com>
  0 siblings, 1 reply; 12+ messages in thread
From: David Gibson @ 2021-06-08  3:54 UTC (permalink / raw)
  To: marcandre.lureau-H+wXaHxf7aLQT0dZR+AlfA
  Cc: devicetree-compiler-u79uwXL29TY76Z2rM5mHXA

[-- Attachment #1: Type: text/plain, Size: 1590 bytes --]

On Mon, Dec 07, 2020 at 05:00:54PM +0400, marcandre.lureau-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org wrote:
> From: Marc-André Lureau <marcandre.lureau-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
> 
> The next patch is going to switch the build-sys to meson.

I'd prefer to also convert the Travis scripts to directly invoke meson
rather than going through the Makefile.

> 
> Signed-off-by: Marc-André Lureau <marcandre.lureau-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
> ---
>  .travis.yml | 6 ++++++
>  1 file changed, 6 insertions(+)
> 
> diff --git a/.travis.yml b/.travis.yml
> index a5163de..aad9f68 100644
> --- a/.travis.yml
> +++ b/.travis.yml
> @@ -6,6 +6,12 @@ env:
>    # COVERITY_SCAN_TOKEN (dgibson/dtc)
>    - secure: "vlHvXe618//IM9LQaKzqsrUbjs7ng0L9UCST4kJbJnFQDXvVe5JiSmJGd4ef7mm0NUv5bMRl2W3xCiu6BYAu/NvU3tMNHoLG+JgCJs0+wLJXbWOwji/NmH7olqgJG+CmpaCMXjARF6+nrTnBYHJL6cYyf4KVoV4B0I/hLUW91+s="
>  
> +before_install:
> +  - '[ $TRAVIS_CPU_ARCH = amd64 ] && sudo add-apt-repository -y "deb http://archive.ubuntu.com/ubuntu xenial-backports main universe" || sudo add-apt-repository -y "deb http://ports.ubuntu.com xenial-backports main universe"'
> +  - sudo apt-get -q update
> +  - sudo apt-get -t xenial-backports install -y python3 python3-setuptools python3-pip ninja-build
> +  - sudo pip3 install meson
> +
>  matrix:
>    include:
>      - addons:

-- 
David Gibson			| I'll have my music baroque, and my code
david AT gibson.dropbear.id.au	| minimalist, thank you.  NOT _the_ _other_
				| _way_ _around_!
http://www.ozlabs.org/~dgibson

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

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

* Re: [PATCH 4/5] travis: install meson
       [not found]           ` <CAMxuvax=yjONOpay9+CvYvV88MKFu84W8w0SpiDyg3GuQaHA0g-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
@ 2021-06-10  5:28             ` David Gibson
  0 siblings, 0 replies; 12+ messages in thread
From: David Gibson @ 2021-06-10  5:28 UTC (permalink / raw)
  To: Marc-André Lureau; +Cc: Devicetree Compiler

[-- Attachment #1: Type: text/plain, Size: 1117 bytes --]

On Tue, Jun 08, 2021 at 01:20:03PM +0400, Marc-André Lureau wrote:
> Hi David
> 
> On Tue, Jun 8, 2021 at 7:54 AM David Gibson <david-xT8FGy+AXnRB3Ne2BGzF6laj5H9X9Tb+@public.gmane.org>
> wrote:
> 
> > On Mon, Dec 07, 2020 at 05:00:54PM +0400, marcandre.lureau-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org
> > wrote:
> > > From: Marc-André Lureau <marcandre.lureau-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
> > >
> > > The next patch is going to switch the build-sys to meson.
> >
> > I'd prefer to also convert the Travis scripts to directly invoke meson
> > rather than going through the Makefile.
> >
> 
> Ok, but then we don't need to cover the Makefile wrapping?

Ah, yeah, I guess we do.  And I was recently reminded that
travis-ci.org is shutting down.  I'm confused by the suggested
travis-ci.com move, so I'll probably just move to Gitlab's CI
instead.

So let's just leave it as is until then.

-- 
David Gibson			| I'll have my music baroque, and my code
david AT gibson.dropbear.id.au	| minimalist, thank you.  NOT _the_ _other_
				| _way_ _around_!
http://www.ozlabs.org/~dgibson

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

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

* Re: [PATCH 5/5] build-sys: replace makefiles to wrap meson/ninja
       [not found]           ` <CAMxuvaxcwrDiuxKizMjkXZFy6K3X0TSN-Z-=+SNXe53j1pMr1A-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
@ 2021-06-15  5:58             ` David Gibson
       [not found]               ` <CAMxuvaw2GoT-3CrTmBsiR==N2ZV3yJ--5MeN58DPypbJPrkfHQ@mail.gmail.com>
  0 siblings, 1 reply; 12+ messages in thread
From: David Gibson @ 2021-06-15  5:58 UTC (permalink / raw)
  To: Marc-André Lureau; +Cc: Devicetree Compiler

[-- Attachment #1: Type: text/plain, Size: 3638 bytes --]

On Tue, Jun 08, 2021 at 01:25:03PM +0400, Marc-André Lureau wrote:
> Hi
> 
> On Tue, Jun 8, 2021 at 7:54 AM David Gibson <david-xT8FGy+AXnRB3Ne2BGzF6laj5H9X9Tb+@public.gmane.org>
> wrote:
> 
> > On Mon, Dec 07, 2020 at 05:00:55PM +0400, marcandre.lureau-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org
> > wrote:
> > > From: Marc-André Lureau <marcandre.lureau-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
> > >
> > > This avoids maintaining two build systems, and update the documentation.
> > >
> > > Makefile now wrap meson, so that make all/check/checkm/clean/install
> > > continue working as they used to.
> > >
> > > Signed-off-by: Marc-André Lureau <marcandre.lureau-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
> >
> > Sorry I've neglected this so long.  I finally got around to lookup up
> > a cheatsheet for how to use meson "natively" to understand this
> > better.
> >
> > Couple of issues with this path though:
> >
> > > ---
> > >  Makefile                   | 380 ++-----------------------------------
> > >  Makefile.convert-dtsv0     |  14 --
> > >  Makefile.dtc               |  23 ---
> > >  Makefile.utils             |  31 ---
> > >  README                     |  24 ++-
> > >  libfdt/Makefile.libfdt     |  18 --
> > >  pylibfdt/Makefile.pylibfdt |  30 ---
> > >  tests/Makefile.tests       | 100 ----------
> >
> > First, it no longer applies clean due to some added tests.  Can you
> > rebase please.
> >
> 
> Sure, https://github.com/elmarco/dtc/tree/meson-next
> 
> 
> > > +checkm:
> > > +     WITH_VALGRIND=1 meson test -C $(BUILD_DIR) -v
> >
> > Second, the valgrind stuff doesn't seem to work.  I tried
> > "WITH_VALGRIND=1 meson test" and it completes much to fast to actually
> > be using valgrind.  Also it doesn't give any error if valgrind isn't
> > installed.
> >
> 
> Oh? I get this:
> /home/elmarco/src/dtc/tests/run_tests.sh: line 75: valgrind: command not
> found
> 
> And when valgrind is installed it uses it and takes ages to complete the
> tests.

Huh.  Yet for me it does not

yekko:~/src/dtc/tmp (main)$ time meson test
ninja: Entering directory `/home/dwg/src/dtc/tmp'
[2/2] Generating pylibfdt with a custom command
1/1 run-test OK             2.67s


Ok:                 1   
Expected Fail:      0   
Fail:               0   
Unexpected Pass:    0   
Skipped:            0   
Timeout:            0   

Full log written to /home/dwg/src/dtc/tmp/meson-logs/testlog.txt

real	0m3.015s
user	0m1.862s
sys	0m1.197s
yekko:~/src/dtc/tmp (main)$ time env WITH_VALGRIND=1 meson test
ninja: Entering directory `/home/dwg/src/dtc/tmp'
[2/2] Generating pylibfdt with a custom command
1/1 run-test OK             2.47s


Ok:                 1   
Expected Fail:      0   
Fail:               0   
Unexpected Pass:    0   
Skipped:            0   
Timeout:            0   

Full log written to /home/dwg/src/dtc/tmp/meson-logs/testlog.txt

real	0m2.836s
user	0m1.838s
sys	0m1.163s


I have no idea how to debug that...

> > It's also not ideal that the output from "meson test" is trivial with
> > all the content now in the meson log file.  Assuming we can sort out
> > this first part, would you be willing to help convert the existing
> > testsuite / testrunner to be more "meson native" so we can improve
> > that?
> >
> 
> Certainly, I can eventually take a look when I have time, or help anybody
> in this task.

-- 
David Gibson			| I'll have my music baroque, and my code
david AT gibson.dropbear.id.au	| minimalist, thank you.  NOT _the_ _other_
				| _way_ _around_!
http://www.ozlabs.org/~dgibson

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

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

* Re: [PATCH 5/5] build-sys: replace makefiles to wrap meson/ninja
       [not found]                 ` <CAMxuvaw2GoT-3CrTmBsiR==N2ZV3yJ--5MeN58DPypbJPrkfHQ-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
@ 2021-06-19  9:31                   ` David Gibson
  0 siblings, 0 replies; 12+ messages in thread
From: David Gibson @ 2021-06-19  9:31 UTC (permalink / raw)
  To: Marc-André Lureau; +Cc: Devicetree Compiler

[-- Attachment #1: Type: text/plain, Size: 4320 bytes --]

On Tue, Jun 15, 2021 at 11:19:39AM +0400, Marc-André Lureau wrote:
> Hi
> 
> On Tue, Jun 15, 2021 at 10:26 AM David Gibson <david-xT8FGy+AXnRB3Ne2BGzF6iEOx6SR5NKn@public.gmane.orgu>
> wrote:
> 
> > On Tue, Jun 08, 2021 at 01:25:03PM +0400, Marc-André Lureau wrote:
> > > Hi
> > >
> > > On Tue, Jun 8, 2021 at 7:54 AM David Gibson <david-xT8FGy+AXnRB3Ne2BGzF6ryscVyMRj84@public.gmane.org.au
> > >
> > > wrote:
> > >
> > > > On Mon, Dec 07, 2020 at 05:00:55PM +0400, marcandre.lureau@redhat.com
> > > > wrote:
> > > > > From: Marc-André Lureau <marcandre.lureau-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
> > > > >
> > > > > This avoids maintaining two build systems, and update the
> > documentation.
> > > > >
> > > > > Makefile now wrap meson, so that make all/check/checkm/clean/install
> > > > > continue working as they used to.
> > > > >
> > > > > Signed-off-by: Marc-André Lureau <marcandre.lureau-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
> > > >
> > > > Sorry I've neglected this so long.  I finally got around to lookup up
> > > > a cheatsheet for how to use meson "natively" to understand this
> > > > better.
> > > >
> > > > Couple of issues with this path though:
> > > >
> > > > > ---
> > > > >  Makefile                   | 380
> > ++-----------------------------------
> > > > >  Makefile.convert-dtsv0     |  14 --
> > > > >  Makefile.dtc               |  23 ---
> > > > >  Makefile.utils             |  31 ---
> > > > >  README                     |  24 ++-
> > > > >  libfdt/Makefile.libfdt     |  18 --
> > > > >  pylibfdt/Makefile.pylibfdt |  30 ---
> > > > >  tests/Makefile.tests       | 100 ----------
> > > >
> > > > First, it no longer applies clean due to some added tests.  Can you
> > > > rebase please.
> > > >
> > >
> > > Sure, https://github.com/elmarco/dtc/tree/meson-next
> > >
> > >
> > > > > +checkm:
> > > > > +     WITH_VALGRIND=1 meson test -C $(BUILD_DIR) -v
> > > >
> > > > Second, the valgrind stuff doesn't seem to work.  I tried
> > > > "WITH_VALGRIND=1 meson test" and it completes much to fast to actually
> > > > be using valgrind.  Also it doesn't give any error if valgrind isn't
> > > > installed.
> > > >
> > >
> > > Oh? I get this:
> > > /home/elmarco/src/dtc/tests/run_tests.sh: line 75: valgrind: command not
> > > found
> > >
> > > And when valgrind is installed it uses it and takes ages to complete the
> > > tests.
> >
> > Huh.  Yet for me it does not
> >
> > yekko:~/src/dtc/tmp (main)$ time meson test
> > ninja: Entering directory `/home/dwg/src/dtc/tmp'
> > [2/2] Generating pylibfdt with a custom command
> > 1/1 run-test OK             2.67s
> >
> >
> > Ok:                 1
> > Expected Fail:      0
> > Fail:               0
> > Unexpected Pass:    0
> > Skipped:            0
> > Timeout:            0
> >
> > Full log written to /home/dwg/src/dtc/tmp/meson-logs/testlog.txt
> >
> > real    0m3.015s
> > user    0m1.862s
> > sys     0m1.197s
> > yekko:~/src/dtc/tmp (main)$ time env WITH_VALGRIND=1 meson test
> > ninja: Entering directory `/home/dwg/src/dtc/tmp'
> > [2/2] Generating pylibfdt with a custom command
> > 1/1 run-test OK             2.47s
> >
> >
> > Ok:                 1
> > Expected Fail:      0
> > Fail:               0
> > Unexpected Pass:    0
> > Skipped:            0
> > Timeout:            0
> >
> > Full log written to /home/dwg/src/dtc/tmp/meson-logs/testlog.txt
> >
> > real    0m2.836s
> > user    0m1.838s
> > sys     0m1.163s
> >
> >
> > I have no idea how to debug that...
> >
> >
> What's your version of meson? There has been an environment-related
> regression in 0.58 that was quickly fixed in 0.58.1. (I tried older
> versions as well when I wrote the patch last year)

meson-0.56.2-2.fc34.noarch
ninja-build-1.10.2-2.fc34.x86_64

> You could check your environment by adding an "env" call at the top of
> run_tests.sh and checking it in build/meson-logs/testlog.txt

Tried that, and it showed the WITH_VALGRIND value.  I'm not actually
sure what's supposed to be acting on the WITH_VALGRIND variable.

-- 
David Gibson			| I'll have my music baroque, and my code
david AT gibson.dropbear.id.au	| minimalist, thank you.  NOT _the_ _other_
				| _way_ _around_!
http://www.ozlabs.org/~dgibson

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

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

end of thread, other threads:[~2021-06-19  9:31 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-12-07 13:00 [PATCH 0/5] Follow-up on meson marcandre.lureau-H+wXaHxf7aLQT0dZR+AlfA
     [not found] ` <20201207130055.462734-1-marcandre.lureau-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
2020-12-07 13:00   ` [PATCH 1/5] meson: fix -Wall warning marcandre.lureau-H+wXaHxf7aLQT0dZR+AlfA
2020-12-07 13:00   ` [PATCH 2/5] meson: do not assume python is installed, skip tests marcandre.lureau-H+wXaHxf7aLQT0dZR+AlfA
2020-12-07 13:00   ` [PATCH 3/5] meson: increase default timeout for tests marcandre.lureau-H+wXaHxf7aLQT0dZR+AlfA
2020-12-07 13:00   ` [PATCH 4/5] travis: install meson marcandre.lureau-H+wXaHxf7aLQT0dZR+AlfA
     [not found]     ` <20201207130055.462734-5-marcandre.lureau-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
2021-06-08  3:54       ` David Gibson
     [not found]         ` <CAMxuvax=yjONOpay9+CvYvV88MKFu84W8w0SpiDyg3GuQaHA0g@mail.gmail.com>
     [not found]           ` <CAMxuvax=yjONOpay9+CvYvV88MKFu84W8w0SpiDyg3GuQaHA0g-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2021-06-10  5:28             ` David Gibson
2020-12-07 13:00   ` [PATCH 5/5] build-sys: replace makefiles to wrap meson/ninja marcandre.lureau-H+wXaHxf7aLQT0dZR+AlfA
     [not found]     ` <20201207130055.462734-6-marcandre.lureau-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
2021-06-08  3:54       ` David Gibson
     [not found]         ` <CAMxuvaxcwrDiuxKizMjkXZFy6K3X0TSN-Z-=+SNXe53j1pMr1A@mail.gmail.com>
     [not found]           ` <CAMxuvaxcwrDiuxKizMjkXZFy6K3X0TSN-Z-=+SNXe53j1pMr1A-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2021-06-15  5:58             ` David Gibson
     [not found]               ` <CAMxuvaw2GoT-3CrTmBsiR==N2ZV3yJ--5MeN58DPypbJPrkfHQ@mail.gmail.com>
     [not found]                 ` <CAMxuvaw2GoT-3CrTmBsiR==N2ZV3yJ--5MeN58DPypbJPrkfHQ-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2021-06-19  9:31                   ` David Gibson
2020-12-08  4:33   ` [PATCH 0/5] Follow-up on meson David Gibson

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.