Igt-dev Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [igt-dev] [PATCH i-g-t 1/2] Make GLib mandatory
@ 2018-06-21 11:06 Petri Latvala
  2018-06-21 11:06 ` [igt-dev] [PATCH i-g-t 2/2] meson: Add options to control optional parts Petri Latvala
                   ` (5 more replies)
  0 siblings, 6 replies; 16+ messages in thread
From: Petri Latvala @ 2018-06-21 11:06 UTC (permalink / raw)
  To: igt-dev; +Cc: Daniel Vetter

GLib was originally made optional for Android builds, and Android
support was dropped a while ago due to lack of use and maintenance.

Building without GLib was broken without bug reports anyway.

Signed-off-by: Petri Latvala <petri.latvala@intel.com>
Cc: Daniel Vetter <daniel@ffwll.ch>
Cc: Arkadiusz Hiler <arkadiusz.hiler@intel.com>
---
 configure.ac   |  8 +-------
 lib/igt_core.c | 10 ----------
 lib/igt_rc.h   |  2 --
 meson.build    |  5 +----
 4 files changed, 2 insertions(+), 23 deletions(-)

diff --git a/configure.ac b/configure.ac
index 2f6bc70e..1ee4e90e 100644
--- a/configure.ac
+++ b/configure.ac
@@ -177,10 +177,7 @@ PKG_CHECK_MODULES(XRANDR, xrandr >= 1.3, AC_DEFINE(HAVE_XRANDR, 1, [Have libXran
 # for testdisplay
 PKG_CHECK_MODULES(CAIRO, [cairo >= 1.12.0])
 PKG_CHECK_MODULES(LIBUDEV, [libudev])
-PKG_CHECK_MODULES(GLIB, [glib-2.0], [glib=yes], [glib=no])
-if test x"$glib" = xyes; then
-	AC_DEFINE(HAVE_GLIB,1,[Enable glib support])
-fi
+PKG_CHECK_MODULES(GLIB, [glib-2.0])
 PKG_CHECK_MODULES(GSL, [gsl], [gsl=yes], [gsl=no])
 AM_CONDITIONAL(HAVE_GSL, [test "x$gsl" = xyes])
 
@@ -206,9 +203,6 @@ if test "x$enable_chamelium" = xyes; then
 	fi
 	PKG_CHECK_MODULES(PIXMAN, pixman-1, [],
 			  [AC_MSG_ERROR([Failed to find pixman, required by chamelium.])])
-	if test x"$glib" != xyes; then
-		AC_MSG_ERROR([Failed to find glib, required by chamelium.])
-	fi
 	if test x"$gsl" != xyes; then
 		AC_MSG_ERROR([Failed to find gsl, required by chamelium.])
 	fi
diff --git a/lib/igt_core.c b/lib/igt_core.c
index 06d8b037..3313050c 100644
--- a/lib/igt_core.c
+++ b/lib/igt_core.c
@@ -55,9 +55,7 @@
 #include <limits.h>
 #include <locale.h>
 #include <uwildmat/uwildmat.h>
-#ifdef HAVE_GLIB
 #include <glib.h>
-#endif
 
 #include "drmtest.h"
 #include "intel_chipset.h"
@@ -299,9 +297,7 @@ static struct {
 } log_buffer;
 static pthread_mutex_t log_buffer_mutex = PTHREAD_MUTEX_INITIALIZER;
 
-#ifdef HAVE_GLIB
 GKeyFile *igt_key_file;
-#endif
 
 char *igt_frame_dump_path;
 
@@ -573,7 +569,6 @@ static void oom_adjust_for_doom(void)
 
 }
 
-#ifdef HAVE_GLIB
 static void common_init_config(void)
 {
 	char *key_file_env = NULL;
@@ -624,7 +619,6 @@ out:
 	if (!key_file_env && key_file_loc)
 		free(key_file_loc);
 }
-#endif
 
 static void common_init_env(void)
 {
@@ -778,9 +772,7 @@ static int common_init(int *argc, char **argv,
 		}
 	}
 
-#ifdef HAVE_GLIB
 	common_init_config();
-#endif
 
 out:
 	free(short_opts);
@@ -1435,10 +1427,8 @@ void igt_exit(void)
 {
 	igt_exit_called = true;
 
-#ifdef HAVE_GLIB
 	if (igt_key_file)
 		g_key_file_free(igt_key_file);
-#endif
 
 	if (run_single_subtest && !run_single_subtest_found) {
 		igt_warn("Unknown subtest: %s\n", run_single_subtest);
diff --git a/lib/igt_rc.h b/lib/igt_rc.h
index d7a314c5..53e5ce66 100644
--- a/lib/igt_rc.h
+++ b/lib/igt_rc.h
@@ -25,10 +25,8 @@
 #ifndef IGT_RC_H
 #define IGT_RC_H
 
-#ifdef HAVE_GLIB
 #include <glib.h>
 
 extern GKeyFile *igt_key_file;
 
-#endif /* HAVE_GLIB */
 #endif /* IGT_RC_H */
diff --git a/meson.build b/meson.build
index cd736d8e..98216fc4 100644
--- a/meson.build
+++ b/meson.build
@@ -50,10 +50,7 @@ endif
 
 cairo = dependency('cairo', version : '>1.12.0', required : true)
 libudev = dependency('libudev', required : true)
-glib = dependency('glib-2.0', required : false)
-if glib.found()
-	config.set('HAVE_GLIB', 1)
-endif
+glib = dependency('glib-2.0', required : true)
 
 gsl = dependency('gsl', required : false)
 alsa = dependency('alsa', required : false)
-- 
2.14.1

_______________________________________________
igt-dev mailing list
igt-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/igt-dev

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

* [igt-dev] [PATCH i-g-t 2/2] meson: Add options to control optional parts
  2018-06-21 11:06 [igt-dev] [PATCH i-g-t 1/2] Make GLib mandatory Petri Latvala
@ 2018-06-21 11:06 ` Petri Latvala
  2018-06-21 11:29   ` Petri Latvala
  2018-06-25  7:10   ` [igt-dev] [PATCH i-g-t v3] " Arkadiusz Hiler
  2018-06-21 11:32 ` [igt-dev] ✓ Fi.CI.BAT: success for series starting with [i-g-t,1/2] Make GLib mandatory Patchwork
                   ` (4 subsequent siblings)
  5 siblings, 2 replies; 16+ messages in thread
From: Petri Latvala @ 2018-06-21 11:06 UTC (permalink / raw)
  To: igt-dev; +Cc: Matt Turner, Daniel Vetter

Distributions want explicit control over optional parts so they can
state runtime dependencies before building. Let's restore the
functionality autotools used to provide.

Where possible, the selection is done by choosing whether to build a
particular item and the option name is build_$item. Example:
build_overlay. Where not possible, the option name is
with_$item. Example: with_valgrind.

Note, the old hack for not building docs when cross-compiling is
gone, as doc building can be explicitly controlled now.

v2: glib not optional

Signed-off-by: Petri Latvala <petri.latvala@intel.com>
Cc: Matt Turner <mattst88@gmail.com>
Cc: Daniel Vetter <daniel@ffwll.ch>
Cc: Eric Anholt <eric@anholt.net>
Cc: Arkadiusz Hiler <arkadiusz.hiler@intel.com>
---
 benchmarks/meson.build |   4 +-
 man/meson.build        |  10 +++-
 meson.build            | 142 ++++++++++++++++++++++++++++++++++++++++++-------
 meson_options.txt      |  54 +++++++++++++++++++
 overlay/meson.build    |  46 ++++++++++++----
 tests/meson.build      |   4 +-
 6 files changed, 224 insertions(+), 36 deletions(-)

diff --git a/benchmarks/meson.build b/benchmarks/meson.build
index 27836c1d..baf1243d 100644
--- a/benchmarks/meson.build
+++ b/benchmarks/meson.build
@@ -35,10 +35,10 @@ foreach prog : benchmark_progs
 	executable(prog + '_bench', prog + '.c',
 		   install : true,
 		   install_dir : benchmarksdir,
-		   dependencies : test_deps)
+		   dependencies : igt_deps)
 endforeach
 
 executable('gem_wsim_bench', 'gem_wsim.c',
 	   install : true,
 	   install_dir : benchmarksdir,
-	   dependencies : test_deps + [ lib_igt_perf ])
+	   dependencies : igt_deps + [ lib_igt_perf ])
diff --git a/man/meson.build b/man/meson.build
index 49b0686a..fa01f9dd 100644
--- a/man/meson.build
+++ b/man/meson.build
@@ -22,10 +22,10 @@ defs_rst = configure_file(input : 'defs.rst.in',
 		output : 'defs.rst',
 		configuration : config)
 
-rst2man = find_program('rst2man', required : false)
+rst2man = find_program('rst2man', required : _man_required)
 rst2man_script = find_program('rst2man.sh')
 
-if rst2man.found()
+if _build_man and rst2man.found()
 	foreach manpage : manpages
 		custom_target(manpage + '.1',
 				build_by_default : true,
@@ -36,4 +36,10 @@ if rst2man.found()
 				install : true,
 				install_dir : join_paths(mandir, 'man1'))
 	endforeach
+	build_info += 'Build man pages: Yes'
+else
+	if _man_required
+		error('Cannot build man pages due to missing dependencies')
+	endif
+	build_info += 'Build man pages: No'
 endif
diff --git a/meson.build b/meson.build
index 98216fc4..dd4679cd 100644
--- a/meson.build
+++ b/meson.build
@@ -26,36 +26,118 @@ foreach cc_arg : cc_args
   endif
 endforeach
 
+_build_overlay = false
+_overlay_required = false
+_build_man = false
+_man_required = false
+_build_audio = false
+_audio_required = false
+_build_chamelium = false
+_chamelium_required = false
+_build_docs = false
+_docs_required = false
+_build_tests = false
+_tests_required = false
+
+build_overlay = get_option('build_overlay')
+overlay_backends = get_option('overlay_backends')
+build_man = get_option('build_man')
+with_valgrind = get_option('with_valgrind')
+build_audio = get_option('build_audio')
+build_chamelium = get_option('build_chamelium')
+build_docs = get_option('build_docs')
+build_tests = get_option('build_tests')
+with_libdrm = get_option('with_libdrm')
+
+_build_overlay = build_overlay != 'false'
+_overlay_required = build_overlay == 'true'
+_build_man = build_man != 'false'
+_man_required = build_man == 'true'
+_build_audio = build_audio != 'false'
+_audio_required = build_audio == 'true'
+_build_chamelium = build_chamelium != 'false'
+_chamelium_required = build_chamelium == 'true'
+_build_docs = build_docs != 'false'
+_docs_required = build_docs == 'true'
+_build_tests = build_tests != 'false'
+_tests_required = build_tests == 'true'
+
+build_info = []
+
 inc = include_directories('include/drm-uapi', 'lib', '.')
 
 inc_for_gtkdoc = include_directories('lib')
 
 config = configuration_data()
 
+null_dep = dependency('', required : false)
+
+libdrm_info = []
+libdrm_intel = null_dep
+libdrm_nouveau = null_dep
+libdrm_amdgpu = null_dep
+
 libdrm_version = '>=2.4.82'
 libdrm = dependency('libdrm', version : libdrm_version)
-libdrm_intel = dependency('libdrm_intel', version : libdrm_version, required : false)
-libdrm_nouveau = dependency('libdrm_nouveau', version : libdrm_version, required : false)
-libdrm_amdgpu = dependency('libdrm_amdgpu', version : libdrm_version, required : false)
+if with_libdrm.contains('auto') or with_libdrm.contains('intel')
+	libdrm_intel = dependency('libdrm_intel', version : libdrm_version, required : with_libdrm.contains('intel'))
+	libdrm_info += 'intel'
+endif
+if with_libdrm.contains('auto') or with_libdrm.contains('nouveau')
+	libdrm_nouveau = dependency('libdrm_nouveau', version : libdrm_version, required : with_libdrm.contains('nouveau'))
+	libdrm_info += 'nouveau'
+endif
+if with_libdrm.contains('auto') or with_libdrm.contains('amdgpu')
+	libdrm_amdgpu = dependency('libdrm_amdgpu', version : libdrm_version, required : with_libdrm.contains('amdgpu'))
+	libdrm_info += 'amdgpu'
+endif
+
+build_info += 'With libdrm: ' + ','.join(libdrm_info)
 
 pciaccess = dependency('pciaccess', version : '>=0.10')
 libkmod = dependency('libkmod')
 libprocps = dependency('libprocps', required : true)
 libunwind = dependency('libunwind', required : true)
 
-valgrind = dependency('valgrind', required : false)
-if valgrind.found()
-	config.set('HAVE_VALGRIND', 1)
+valgrind = null_dep
+valgrindinfo = 'No'
+if with_valgrind != 'false'
+	valgrind = dependency('valgrind', required : with_valgrind == 'true')
+	if valgrind.found()
+		config.set('HAVE_VALGRIND', 1)
+		valgrindinfo = 'Yes'
+	endif
 endif
+build_info += 'Valgrind annotations: ' + valgrindinfo
 
 cairo = dependency('cairo', version : '>1.12.0', required : true)
 libudev = dependency('libudev', required : true)
 glib = dependency('glib-2.0', required : true)
 
-gsl = dependency('gsl', required : false)
-alsa = dependency('alsa', required : false)
+gsl = null_dep
+alsa = null_dep
+pixman = null_dep
+if _build_audio or _build_chamelium
+	gsl = dependency('gsl', required : _audio_required or _chamelium_required)
+endif
+if _build_audio
+	alsa = dependency('alsa', required : _audio_required)
+endif
+if _build_chamelium
+	pixman = dependency('pixman-1', required : _chamelium_required)
+endif
+
+audioinfo = 'No'
+if _build_audio and alsa.found() and gsl.found()
+	audioinfo = 'Yes'
+else
+	if _audio_required
+		error('Cannot build audio test due to missing dependencies')
+	endif
+	_build_audio = false
+endif
+build_info += 'Build audio test: ' + audioinfo
 
-pixman = dependency('pixman-1', required : false)
 xmlrpc = dependency('xmlrpc', required : false)
 xmlrpc_util = dependency('xmlrpc_util', required : false)
 xmlrpc_client = dependency('xmlrpc_client', required : false)
@@ -73,13 +155,17 @@ if not xmlrpc.found() and xmlrpc_cmd.found()
 	endif
 endif
 
-if pixman.found() and gsl.found() and xmlrpc.found() and xmlrpc_util.found() and xmlrpc_client.found()
+chamelium = null_dep
+chameliuminfo = 'No'
+if _build_chamelium and pixman.found() and gsl.found() and xmlrpc.found() and xmlrpc_util.found() and xmlrpc_client.found()
 	chamelium = declare_dependency(dependencies : [ pixman, xmlrpc,
-	  xmlrpc_util, xmlrpc_client])
+							xmlrpc_util, xmlrpc_client])
 	config.set('HAVE_CHAMELIUM', 1)
-else
-	chamelium = dependency('', required: false)
+	chameliuminfo = 'Yes'
+elif _chamelium_required
+	error('Cannot build chamelium test due to missing dependencies')
 endif
+build_info += 'Build Chamelium test: ' + chameliuminfo
 
 pthreads = dependency('threads')
 math = cc.find_library('m')
@@ -130,17 +216,33 @@ mandir = get_option('mandir')
 pkgconfigdir = join_paths(libdir, 'pkgconfig')
 
 subdir('lib')
-subdir('tests')
+if _build_tests
+	subdir('tests')
+	build_info += 'Build tests: Yes'
+else
+	build_info += 'Build tests: No'
+endif
 subdir('benchmarks')
 subdir('tools')
 if libdrm_intel.found()
 	subdir('assembler')
-	if ['x86', 'x86_64'].contains(host_machine.cpu_family())
-		subdir('overlay')
-	endif
 endif
+subdir('overlay')
 subdir('man')
-# has_exe_wrapper() is undefined if building natively
-if not meson.is_cross_build() or not meson.has_exe_wrapper()
-	subdir('docs')
+
+docs_info = 'No'
+if _build_docs
+	if _build_tests
+		subdir('docs')
+		docs_info = 'Yes'
+	elif _docs_required
+		error('Documentation requires building tests')
+	endif
 endif
+build_info += 'Build documentation: ' + docs_info
+
+message('Build options')
+message('=============')
+foreach str : build_info
+	message(str)
+endforeach
diff --git a/meson_options.txt b/meson_options.txt
index 41be35e0..05e63463 100644
--- a/meson_options.txt
+++ b/meson_options.txt
@@ -1,3 +1,57 @@
+option('build_overlay',
+       type : 'combo',
+       value : 'auto',
+       choices : ['auto', 'true', 'false'],
+       description : 'Build overlay')
+
+option('overlay_backends',
+       type : 'array',
+       value : ['auto'],
+       choices : [ 'auto', 'x', 'xv' ],
+       description : 'Overlay backends to enable')
+
+option('build_audio',
+       type : 'combo',
+       value : 'auto',
+       choices : ['auto', 'true', 'false'],
+       description : 'Build audio test')
+
+option('build_chamelium',
+       type : 'combo',
+       value : 'auto',
+       choices : ['auto', 'true', 'false'],
+       description : 'Build chamelium test')
+
+option('with_valgrind',
+       type : 'combo',
+       value : 'auto',
+       choices : ['auto', 'true', 'false'],
+       description : 'Build with support for valgrind annotations')
+
+option('build_man',
+       type : 'combo',
+       value : 'auto',
+       choices : ['auto', 'true', 'false'],
+       description : 'Build man pages')
+
+option('build_docs',
+       type : 'combo',
+       value : 'auto',
+       choices : ['auto', 'true', 'false'],
+       description : 'Build documentation')
+
+option('build_tests',
+       type : 'combo',
+       value : 'auto',
+       choices : ['auto', 'true', 'false'],
+       description : 'Build tests')
+
+option('with_libdrm',
+       type : 'array',
+       value : ['auto'],
+       choices : ['', 'auto', 'intel', 'nouveau', 'amdgpu'],
+       description : 'libdrm libraries to be used')
+
 option('use_rpath',
        type : 'boolean',
        value : false,
diff --git a/overlay/meson.build b/overlay/meson.build
index 546c8377..46d2d494 100644
--- a/overlay/meson.build
+++ b/overlay/meson.build
@@ -14,20 +14,35 @@ gpu_overlay_src = [
 	'rc6.c',
 ]
 
-xv = dependency('xv', required : false)
-x11 = dependency('x11', required : false)
-xext = dependency('xext', required : false)
-dri2proto = dependency('dri2proto', version : '>= 2.6', required : false)
-cairo_xlib = dependency('cairo-xlib', required : false)
-xrandr = dependency('xrandr', version : '>=1.3', required : false)
+xv_backend_required = false
+xlib_backend_required = false
+build_xv_backend = overlay_backends.contains('xv') or overlay_backends.contains('auto')
+build_xlib_backend = overlay_backends.contains('x') or overlay_backends.contains('auto')
+if _overlay_required
+	xv_backend_required = overlay_backends.contains('xv')
+	xlib_backend_required = overlay_backends.contains('x')
+endif
+
+xv = dependency('xv', required : xv_backend_required)
+x11 = dependency('x11', required : xv_backend_required)
+xext = dependency('xext', required : xv_backend_required)
+dri2proto = dependency('dri2proto',
+		       version : '>= 2.6',
+		       required : xv_backend_required or xlib_backend_required)
+cairo_xlib = dependency('cairo-xlib', required : xlib_backend_required)
+xrandr = dependency('xrandr', version : '>=1.3', required : _overlay_required)
 
 gpu_overlay_deps = [ realtime, math, cairo, pciaccess, libdrm,
 	libdrm_intel, lib_igt_perf ]
 
 both_x11_src = ''
 
+with_xv_backend = false
+with_xlib_backend = false
+backends_strings = []
+
 gpu_overlay_cflags = []
-if xv.found() and x11.found() and xext.found() and dri2proto.found()
+if build_xv_backend and xv.found() and x11.found() and xext.found() and dri2proto.found()
 	both_x11_src = 'x11/position.c'
 	gpu_overlay_src += [
 		'x11/dri2.c',
@@ -38,20 +53,24 @@ if xv.found() and x11.found() and xext.found() and dri2proto.found()
 	]
 	gpu_overlay_deps += [ xv, x11, xext, dri2proto ]
 	gpu_overlay_cflags += [ '-DHAVE_OVERLAY_XVLIB' ]
+	with_xv_backend = true
+	backends_strings += 'Xv'
 endif
 
-if cairo_xlib.found() and xrandr.found() and dri2proto.found()
+if build_xlib_backend and cairo_xlib.found() and dri2proto.found()
 	both_x11_src = 'x11/position.c'
 	gpu_overlay_src += 'x11/x11-window.c'
 	gpu_overlay_deps += [ cairo_xlib, dri2proto ]
 	gpu_overlay_cflags += [ '-DHAVE_OVERLAY_XLIB' ]
+	with_xlib_backend = true
+	backends_strings += 'X'
 endif
 
 gpu_overlay_src += both_x11_src
 
 gpu_overlay_src += 'kms/kms-overlay.c'
 
-leg = find_program('leg', required : false)
+leg = find_program('leg', required : _overlay_required)
 if leg.found()
 	leg_file = custom_target('tracepoint_format',
 		output: 'tracepoint_format.h',
@@ -62,10 +81,17 @@ else
 	message('WARNING: leg command not found, disabling overlay; try : apt-get install peg')
 endif
 
-if leg.found() and xrandr.found() and cairo.found()
+if _build_overlay and ['x86', 'x86_64'].contains(host_machine.cpu_family()) and libdrm_intel.found() and leg.found() and xrandr.found() and cairo.found() and (with_xlib_backend or with_xv_backend)
 	executable('intel-gpu-overlay', gpu_overlay_src,
 			include_directories : inc,
 			c_args : gpu_overlay_cflags,
 			dependencies : gpu_overlay_deps,
 			install : true)
+	build_info += 'Build overlay: Yes'
+	build_info += 'Overlay backends: ' + ','.join(backends_strings)
+else
+	if _overlay_required
+		error('Cannot build overlay due to missing dependencies')
+	endif
+	build_info += 'Build overlay: No'
 endif
diff --git a/tests/meson.build b/tests/meson.build
index cedb4ff1..9ec39e08 100644
--- a/tests/meson.build
+++ b/tests/meson.build
@@ -232,14 +232,14 @@ if libdrm_nouveau.found()
 	test_deps += libdrm_nouveau
 endif
 
-if chamelium.found()
+if _build_chamelium and chamelium.found()
 	test_progs += [
 		'kms_chamelium',
 	]
 	test_deps += chamelium
 endif
 
-if alsa.found() and gsl.found()
+if _build_audio and alsa.found() and gsl.found()
 	test_progs += [
 		'audio',
 	]
-- 
2.14.1

_______________________________________________
igt-dev mailing list
igt-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/igt-dev

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

* Re: [igt-dev] [PATCH i-g-t 2/2] meson: Add options to control optional parts
  2018-06-21 11:06 ` [igt-dev] [PATCH i-g-t 2/2] meson: Add options to control optional parts Petri Latvala
@ 2018-06-21 11:29   ` Petri Latvala
  2018-06-21 14:27     ` Daniel Vetter
  2018-06-21 16:46     ` Lucas De Marchi
  2018-06-25  7:10   ` [igt-dev] [PATCH i-g-t v3] " Arkadiusz Hiler
  1 sibling, 2 replies; 16+ messages in thread
From: Petri Latvala @ 2018-06-21 11:29 UTC (permalink / raw)
  To: igt-dev; +Cc: Matt Turner, Daniel Vetter

On Thu, Jun 21, 2018 at 02:06:25PM +0300, Petri Latvala wrote:
> Distributions want explicit control over optional parts so they can
> state runtime dependencies before building. Let's restore the
> functionality autotools used to provide.
> 
> Where possible, the selection is done by choosing whether to build a
> particular item and the option name is build_$item. Example:
> build_overlay. Where not possible, the option name is
> with_$item. Example: with_valgrind.

Imagine this paragraph is also here, and the patch having the
corresponding hunk. I missed the part of Daniel's reply that pointed
it out:


Array options require a bump of required meson version to 0.44. Debian
stable has meson 0.37 which is already too old, stable-backports has
0.45, CI uses 0.45. Mesa's meson requirement is 0.44.1, for a
perspective.



> 
> Note, the old hack for not building docs when cross-compiling is
> gone, as doc building can be explicitly controlled now.
> 
> v2: glib not optional
> 
> Signed-off-by: Petri Latvala <petri.latvala@intel.com>
> Cc: Matt Turner <mattst88@gmail.com>
> Cc: Daniel Vetter <daniel@ffwll.ch>
> Cc: Eric Anholt <eric@anholt.net>
> Cc: Arkadiusz Hiler <arkadiusz.hiler@intel.com>
> ---
>  benchmarks/meson.build |   4 +-
>  man/meson.build        |  10 +++-
>  meson.build            | 142 ++++++++++++++++++++++++++++++++++++++++++-------
>  meson_options.txt      |  54 +++++++++++++++++++
>  overlay/meson.build    |  46 ++++++++++++----
>  tests/meson.build      |   4 +-
>  6 files changed, 224 insertions(+), 36 deletions(-)
> 
> diff --git a/benchmarks/meson.build b/benchmarks/meson.build
> index 27836c1d..baf1243d 100644
> --- a/benchmarks/meson.build
> +++ b/benchmarks/meson.build
> @@ -35,10 +35,10 @@ foreach prog : benchmark_progs
>  	executable(prog + '_bench', prog + '.c',
>  		   install : true,
>  		   install_dir : benchmarksdir,
> -		   dependencies : test_deps)
> +		   dependencies : igt_deps)
>  endforeach
>  
>  executable('gem_wsim_bench', 'gem_wsim.c',
>  	   install : true,
>  	   install_dir : benchmarksdir,
> -	   dependencies : test_deps + [ lib_igt_perf ])
> +	   dependencies : igt_deps + [ lib_igt_perf ])
> diff --git a/man/meson.build b/man/meson.build
> index 49b0686a..fa01f9dd 100644
> --- a/man/meson.build
> +++ b/man/meson.build
> @@ -22,10 +22,10 @@ defs_rst = configure_file(input : 'defs.rst.in',
>  		output : 'defs.rst',
>  		configuration : config)
>  
> -rst2man = find_program('rst2man', required : false)
> +rst2man = find_program('rst2man', required : _man_required)
>  rst2man_script = find_program('rst2man.sh')
>  
> -if rst2man.found()
> +if _build_man and rst2man.found()
>  	foreach manpage : manpages
>  		custom_target(manpage + '.1',
>  				build_by_default : true,
> @@ -36,4 +36,10 @@ if rst2man.found()
>  				install : true,
>  				install_dir : join_paths(mandir, 'man1'))
>  	endforeach
> +	build_info += 'Build man pages: Yes'
> +else
> +	if _man_required
> +		error('Cannot build man pages due to missing dependencies')
> +	endif
> +	build_info += 'Build man pages: No'
>  endif
> diff --git a/meson.build b/meson.build
> index 98216fc4..dd4679cd 100644
> --- a/meson.build
> +++ b/meson.build
> @@ -26,36 +26,118 @@ foreach cc_arg : cc_args
>    endif
>  endforeach
>  
> +_build_overlay = false
> +_overlay_required = false
> +_build_man = false
> +_man_required = false
> +_build_audio = false
> +_audio_required = false
> +_build_chamelium = false
> +_chamelium_required = false
> +_build_docs = false
> +_docs_required = false
> +_build_tests = false
> +_tests_required = false
> +
> +build_overlay = get_option('build_overlay')
> +overlay_backends = get_option('overlay_backends')
> +build_man = get_option('build_man')
> +with_valgrind = get_option('with_valgrind')
> +build_audio = get_option('build_audio')
> +build_chamelium = get_option('build_chamelium')
> +build_docs = get_option('build_docs')
> +build_tests = get_option('build_tests')
> +with_libdrm = get_option('with_libdrm')
> +
> +_build_overlay = build_overlay != 'false'
> +_overlay_required = build_overlay == 'true'
> +_build_man = build_man != 'false'
> +_man_required = build_man == 'true'
> +_build_audio = build_audio != 'false'
> +_audio_required = build_audio == 'true'
> +_build_chamelium = build_chamelium != 'false'
> +_chamelium_required = build_chamelium == 'true'
> +_build_docs = build_docs != 'false'
> +_docs_required = build_docs == 'true'
> +_build_tests = build_tests != 'false'
> +_tests_required = build_tests == 'true'
> +
> +build_info = []
> +
>  inc = include_directories('include/drm-uapi', 'lib', '.')
>  
>  inc_for_gtkdoc = include_directories('lib')
>  
>  config = configuration_data()
>  
> +null_dep = dependency('', required : false)
> +
> +libdrm_info = []
> +libdrm_intel = null_dep
> +libdrm_nouveau = null_dep
> +libdrm_amdgpu = null_dep
> +
>  libdrm_version = '>=2.4.82'
>  libdrm = dependency('libdrm', version : libdrm_version)
> -libdrm_intel = dependency('libdrm_intel', version : libdrm_version, required : false)
> -libdrm_nouveau = dependency('libdrm_nouveau', version : libdrm_version, required : false)
> -libdrm_amdgpu = dependency('libdrm_amdgpu', version : libdrm_version, required : false)
> +if with_libdrm.contains('auto') or with_libdrm.contains('intel')
> +	libdrm_intel = dependency('libdrm_intel', version : libdrm_version, required : with_libdrm.contains('intel'))
> +	libdrm_info += 'intel'
> +endif
> +if with_libdrm.contains('auto') or with_libdrm.contains('nouveau')
> +	libdrm_nouveau = dependency('libdrm_nouveau', version : libdrm_version, required : with_libdrm.contains('nouveau'))
> +	libdrm_info += 'nouveau'
> +endif
> +if with_libdrm.contains('auto') or with_libdrm.contains('amdgpu')
> +	libdrm_amdgpu = dependency('libdrm_amdgpu', version : libdrm_version, required : with_libdrm.contains('amdgpu'))
> +	libdrm_info += 'amdgpu'
> +endif
> +
> +build_info += 'With libdrm: ' + ','.join(libdrm_info)
>  
>  pciaccess = dependency('pciaccess', version : '>=0.10')
>  libkmod = dependency('libkmod')
>  libprocps = dependency('libprocps', required : true)
>  libunwind = dependency('libunwind', required : true)
>  
> -valgrind = dependency('valgrind', required : false)
> -if valgrind.found()
> -	config.set('HAVE_VALGRIND', 1)
> +valgrind = null_dep
> +valgrindinfo = 'No'
> +if with_valgrind != 'false'
> +	valgrind = dependency('valgrind', required : with_valgrind == 'true')
> +	if valgrind.found()
> +		config.set('HAVE_VALGRIND', 1)
> +		valgrindinfo = 'Yes'
> +	endif
>  endif
> +build_info += 'Valgrind annotations: ' + valgrindinfo
>  
>  cairo = dependency('cairo', version : '>1.12.0', required : true)
>  libudev = dependency('libudev', required : true)
>  glib = dependency('glib-2.0', required : true)
>  
> -gsl = dependency('gsl', required : false)
> -alsa = dependency('alsa', required : false)
> +gsl = null_dep
> +alsa = null_dep
> +pixman = null_dep
> +if _build_audio or _build_chamelium
> +	gsl = dependency('gsl', required : _audio_required or _chamelium_required)
> +endif
> +if _build_audio
> +	alsa = dependency('alsa', required : _audio_required)
> +endif
> +if _build_chamelium
> +	pixman = dependency('pixman-1', required : _chamelium_required)
> +endif
> +
> +audioinfo = 'No'
> +if _build_audio and alsa.found() and gsl.found()
> +	audioinfo = 'Yes'
> +else
> +	if _audio_required
> +		error('Cannot build audio test due to missing dependencies')
> +	endif
> +	_build_audio = false
> +endif
> +build_info += 'Build audio test: ' + audioinfo
>  
> -pixman = dependency('pixman-1', required : false)
>  xmlrpc = dependency('xmlrpc', required : false)
>  xmlrpc_util = dependency('xmlrpc_util', required : false)
>  xmlrpc_client = dependency('xmlrpc_client', required : false)
> @@ -73,13 +155,17 @@ if not xmlrpc.found() and xmlrpc_cmd.found()
>  	endif
>  endif
>  
> -if pixman.found() and gsl.found() and xmlrpc.found() and xmlrpc_util.found() and xmlrpc_client.found()
> +chamelium = null_dep
> +chameliuminfo = 'No'
> +if _build_chamelium and pixman.found() and gsl.found() and xmlrpc.found() and xmlrpc_util.found() and xmlrpc_client.found()
>  	chamelium = declare_dependency(dependencies : [ pixman, xmlrpc,
> -	  xmlrpc_util, xmlrpc_client])
> +							xmlrpc_util, xmlrpc_client])
>  	config.set('HAVE_CHAMELIUM', 1)
> -else
> -	chamelium = dependency('', required: false)
> +	chameliuminfo = 'Yes'
> +elif _chamelium_required
> +	error('Cannot build chamelium test due to missing dependencies')
>  endif
> +build_info += 'Build Chamelium test: ' + chameliuminfo
>  
>  pthreads = dependency('threads')
>  math = cc.find_library('m')
> @@ -130,17 +216,33 @@ mandir = get_option('mandir')
>  pkgconfigdir = join_paths(libdir, 'pkgconfig')
>  
>  subdir('lib')
> -subdir('tests')
> +if _build_tests
> +	subdir('tests')
> +	build_info += 'Build tests: Yes'
> +else
> +	build_info += 'Build tests: No'
> +endif
>  subdir('benchmarks')
>  subdir('tools')
>  if libdrm_intel.found()
>  	subdir('assembler')
> -	if ['x86', 'x86_64'].contains(host_machine.cpu_family())
> -		subdir('overlay')
> -	endif
>  endif
> +subdir('overlay')
>  subdir('man')
> -# has_exe_wrapper() is undefined if building natively
> -if not meson.is_cross_build() or not meson.has_exe_wrapper()
> -	subdir('docs')
> +
> +docs_info = 'No'
> +if _build_docs
> +	if _build_tests
> +		subdir('docs')
> +		docs_info = 'Yes'
> +	elif _docs_required
> +		error('Documentation requires building tests')
> +	endif
>  endif
> +build_info += 'Build documentation: ' + docs_info
> +
> +message('Build options')
> +message('=============')
> +foreach str : build_info
> +	message(str)
> +endforeach
> diff --git a/meson_options.txt b/meson_options.txt
> index 41be35e0..05e63463 100644
> --- a/meson_options.txt
> +++ b/meson_options.txt
> @@ -1,3 +1,57 @@
> +option('build_overlay',
> +       type : 'combo',
> +       value : 'auto',
> +       choices : ['auto', 'true', 'false'],
> +       description : 'Build overlay')
> +
> +option('overlay_backends',
> +       type : 'array',
> +       value : ['auto'],
> +       choices : [ 'auto', 'x', 'xv' ],
> +       description : 'Overlay backends to enable')
> +
> +option('build_audio',
> +       type : 'combo',
> +       value : 'auto',
> +       choices : ['auto', 'true', 'false'],
> +       description : 'Build audio test')
> +
> +option('build_chamelium',
> +       type : 'combo',
> +       value : 'auto',
> +       choices : ['auto', 'true', 'false'],
> +       description : 'Build chamelium test')
> +
> +option('with_valgrind',
> +       type : 'combo',
> +       value : 'auto',
> +       choices : ['auto', 'true', 'false'],
> +       description : 'Build with support for valgrind annotations')
> +
> +option('build_man',
> +       type : 'combo',
> +       value : 'auto',
> +       choices : ['auto', 'true', 'false'],
> +       description : 'Build man pages')
> +
> +option('build_docs',
> +       type : 'combo',
> +       value : 'auto',
> +       choices : ['auto', 'true', 'false'],
> +       description : 'Build documentation')
> +
> +option('build_tests',
> +       type : 'combo',
> +       value : 'auto',
> +       choices : ['auto', 'true', 'false'],
> +       description : 'Build tests')
> +
> +option('with_libdrm',
> +       type : 'array',
> +       value : ['auto'],
> +       choices : ['', 'auto', 'intel', 'nouveau', 'amdgpu'],
> +       description : 'libdrm libraries to be used')
> +
>  option('use_rpath',
>         type : 'boolean',
>         value : false,
> diff --git a/overlay/meson.build b/overlay/meson.build
> index 546c8377..46d2d494 100644
> --- a/overlay/meson.build
> +++ b/overlay/meson.build
> @@ -14,20 +14,35 @@ gpu_overlay_src = [
>  	'rc6.c',
>  ]
>  
> -xv = dependency('xv', required : false)
> -x11 = dependency('x11', required : false)
> -xext = dependency('xext', required : false)
> -dri2proto = dependency('dri2proto', version : '>= 2.6', required : false)
> -cairo_xlib = dependency('cairo-xlib', required : false)
> -xrandr = dependency('xrandr', version : '>=1.3', required : false)
> +xv_backend_required = false
> +xlib_backend_required = false
> +build_xv_backend = overlay_backends.contains('xv') or overlay_backends.contains('auto')
> +build_xlib_backend = overlay_backends.contains('x') or overlay_backends.contains('auto')
> +if _overlay_required
> +	xv_backend_required = overlay_backends.contains('xv')
> +	xlib_backend_required = overlay_backends.contains('x')
> +endif
> +
> +xv = dependency('xv', required : xv_backend_required)
> +x11 = dependency('x11', required : xv_backend_required)
> +xext = dependency('xext', required : xv_backend_required)
> +dri2proto = dependency('dri2proto',
> +		       version : '>= 2.6',
> +		       required : xv_backend_required or xlib_backend_required)
> +cairo_xlib = dependency('cairo-xlib', required : xlib_backend_required)
> +xrandr = dependency('xrandr', version : '>=1.3', required : _overlay_required)
>  
>  gpu_overlay_deps = [ realtime, math, cairo, pciaccess, libdrm,
>  	libdrm_intel, lib_igt_perf ]
>  
>  both_x11_src = ''
>  
> +with_xv_backend = false
> +with_xlib_backend = false
> +backends_strings = []
> +
>  gpu_overlay_cflags = []
> -if xv.found() and x11.found() and xext.found() and dri2proto.found()
> +if build_xv_backend and xv.found() and x11.found() and xext.found() and dri2proto.found()
>  	both_x11_src = 'x11/position.c'
>  	gpu_overlay_src += [
>  		'x11/dri2.c',
> @@ -38,20 +53,24 @@ if xv.found() and x11.found() and xext.found() and dri2proto.found()
>  	]
>  	gpu_overlay_deps += [ xv, x11, xext, dri2proto ]
>  	gpu_overlay_cflags += [ '-DHAVE_OVERLAY_XVLIB' ]
> +	with_xv_backend = true
> +	backends_strings += 'Xv'
>  endif
>  
> -if cairo_xlib.found() and xrandr.found() and dri2proto.found()
> +if build_xlib_backend and cairo_xlib.found() and dri2proto.found()
>  	both_x11_src = 'x11/position.c'
>  	gpu_overlay_src += 'x11/x11-window.c'
>  	gpu_overlay_deps += [ cairo_xlib, dri2proto ]
>  	gpu_overlay_cflags += [ '-DHAVE_OVERLAY_XLIB' ]
> +	with_xlib_backend = true
> +	backends_strings += 'X'
>  endif
>  
>  gpu_overlay_src += both_x11_src
>  
>  gpu_overlay_src += 'kms/kms-overlay.c'
>  
> -leg = find_program('leg', required : false)
> +leg = find_program('leg', required : _overlay_required)
>  if leg.found()
>  	leg_file = custom_target('tracepoint_format',
>  		output: 'tracepoint_format.h',
> @@ -62,10 +81,17 @@ else
>  	message('WARNING: leg command not found, disabling overlay; try : apt-get install peg')
>  endif
>  
> -if leg.found() and xrandr.found() and cairo.found()
> +if _build_overlay and ['x86', 'x86_64'].contains(host_machine.cpu_family()) and libdrm_intel.found() and leg.found() and xrandr.found() and cairo.found() and (with_xlib_backend or with_xv_backend)
>  	executable('intel-gpu-overlay', gpu_overlay_src,
>  			include_directories : inc,
>  			c_args : gpu_overlay_cflags,
>  			dependencies : gpu_overlay_deps,
>  			install : true)
> +	build_info += 'Build overlay: Yes'
> +	build_info += 'Overlay backends: ' + ','.join(backends_strings)
> +else
> +	if _overlay_required
> +		error('Cannot build overlay due to missing dependencies')
> +	endif
> +	build_info += 'Build overlay: No'
>  endif
> diff --git a/tests/meson.build b/tests/meson.build
> index cedb4ff1..9ec39e08 100644
> --- a/tests/meson.build
> +++ b/tests/meson.build
> @@ -232,14 +232,14 @@ if libdrm_nouveau.found()
>  	test_deps += libdrm_nouveau
>  endif
>  
> -if chamelium.found()
> +if _build_chamelium and chamelium.found()
>  	test_progs += [
>  		'kms_chamelium',
>  	]
>  	test_deps += chamelium
>  endif
>  
> -if alsa.found() and gsl.found()
> +if _build_audio and alsa.found() and gsl.found()
>  	test_progs += [
>  		'audio',
>  	]
> -- 
> 2.14.1
> 
_______________________________________________
igt-dev mailing list
igt-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/igt-dev

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

* [igt-dev] ✓ Fi.CI.BAT: success for series starting with [i-g-t,1/2] Make GLib mandatory
  2018-06-21 11:06 [igt-dev] [PATCH i-g-t 1/2] Make GLib mandatory Petri Latvala
  2018-06-21 11:06 ` [igt-dev] [PATCH i-g-t 2/2] meson: Add options to control optional parts Petri Latvala
@ 2018-06-21 11:32 ` Patchwork
  2018-06-21 13:59 ` [igt-dev] [PATCH i-g-t 1/2] " Daniel Vetter
                   ` (3 subsequent siblings)
  5 siblings, 0 replies; 16+ messages in thread
From: Patchwork @ 2018-06-21 11:32 UTC (permalink / raw)
  To: Petri Latvala; +Cc: igt-dev

== Series Details ==

Series: series starting with [i-g-t,1/2] Make GLib mandatory
URL   : https://patchwork.freedesktop.org/series/45159/
State : success

== Summary ==

= CI Bug Log - changes from CI_DRM_4348 -> IGTPW_1494 =

== Summary - SUCCESS ==

  No regressions found.

  External URL: https://patchwork.freedesktop.org/api/1.0/series/45159/revisions/1/mbox/

== Known issues ==

  Here are the changes found in IGTPW_1494 that come from known issues:

  === IGT changes ===

    ==== Possible fixes ====

    igt@drv_module_reload@basic-reload:
      fi-glk-j4005:       DMESG-WARN (fdo#106248, fdo#106725) -> PASS

    
  fdo#106248 https://bugs.freedesktop.org/show_bug.cgi?id=106248
  fdo#106725 https://bugs.freedesktop.org/show_bug.cgi?id=106725


== Participating hosts (44 -> 37) ==

  Additional (1): fi-hsw-peppy 
  Missing    (8): fi-ilk-m540 fi-hsw-4200u fi-glk-dsi fi-byt-squawks fi-bsw-cyan fi-ctg-p8600 fi-cnl-psr fi-kbl-x1275 


== Build changes ==

    * IGT: IGT_4526 -> IGTPW_1494

  CI_DRM_4348: 3a2fbf8fe32d909c5d44e61e7d212ae694e9e473 @ git://anongit.freedesktop.org/gfx-ci/linux
  IGTPW_1494: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_1494/
  IGT_4526: 4bbfb4fb14b3deab9bc4db9911280b35c22b718c @ git://anongit.freedesktop.org/xorg/app/intel-gpu-tools

== Logs ==

For more details see: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_1494/issues.html
_______________________________________________
igt-dev mailing list
igt-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/igt-dev

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

* Re: [igt-dev] [PATCH i-g-t 1/2] Make GLib mandatory
  2018-06-21 11:06 [igt-dev] [PATCH i-g-t 1/2] Make GLib mandatory Petri Latvala
  2018-06-21 11:06 ` [igt-dev] [PATCH i-g-t 2/2] meson: Add options to control optional parts Petri Latvala
  2018-06-21 11:32 ` [igt-dev] ✓ Fi.CI.BAT: success for series starting with [i-g-t,1/2] Make GLib mandatory Patchwork
@ 2018-06-21 13:59 ` Daniel Vetter
  2018-06-21 14:00   ` Daniel Vetter
  2018-06-21 15:30 ` [igt-dev] ✓ Fi.CI.IGT: success for series starting with [i-g-t,1/2] " Patchwork
                   ` (2 subsequent siblings)
  5 siblings, 1 reply; 16+ messages in thread
From: Daniel Vetter @ 2018-06-21 13:59 UTC (permalink / raw)
  To: Petri Latvala; +Cc: igt-dev, Daniel Vetter

On Thu, Jun 21, 2018 at 02:06:24PM +0300, Petri Latvala wrote:
> GLib was originally made optional for Android builds, and Android
> support was dropped a while ago due to lack of use and maintenance.
> 
> Building without GLib was broken without bug reports anyway.
> 
> Signed-off-by: Petri Latvala <petri.latvala@intel.com>
> Cc: Daniel Vetter <daniel@ffwll.ch>
> Cc: Arkadiusz Hiler <arkadiusz.hiler@intel.com>

Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch>

> ---
>  configure.ac   |  8 +-------
>  lib/igt_core.c | 10 ----------
>  lib/igt_rc.h   |  2 --
>  meson.build    |  5 +----
>  4 files changed, 2 insertions(+), 23 deletions(-)
> 
> diff --git a/configure.ac b/configure.ac
> index 2f6bc70e..1ee4e90e 100644
> --- a/configure.ac
> +++ b/configure.ac
> @@ -177,10 +177,7 @@ PKG_CHECK_MODULES(XRANDR, xrandr >= 1.3, AC_DEFINE(HAVE_XRANDR, 1, [Have libXran
>  # for testdisplay
>  PKG_CHECK_MODULES(CAIRO, [cairo >= 1.12.0])
>  PKG_CHECK_MODULES(LIBUDEV, [libudev])
> -PKG_CHECK_MODULES(GLIB, [glib-2.0], [glib=yes], [glib=no])
> -if test x"$glib" = xyes; then
> -	AC_DEFINE(HAVE_GLIB,1,[Enable glib support])
> -fi
> +PKG_CHECK_MODULES(GLIB, [glib-2.0])
>  PKG_CHECK_MODULES(GSL, [gsl], [gsl=yes], [gsl=no])
>  AM_CONDITIONAL(HAVE_GSL, [test "x$gsl" = xyes])
>  
> @@ -206,9 +203,6 @@ if test "x$enable_chamelium" = xyes; then
>  	fi
>  	PKG_CHECK_MODULES(PIXMAN, pixman-1, [],
>  			  [AC_MSG_ERROR([Failed to find pixman, required by chamelium.])])
> -	if test x"$glib" != xyes; then
> -		AC_MSG_ERROR([Failed to find glib, required by chamelium.])
> -	fi
>  	if test x"$gsl" != xyes; then
>  		AC_MSG_ERROR([Failed to find gsl, required by chamelium.])
>  	fi
> diff --git a/lib/igt_core.c b/lib/igt_core.c
> index 06d8b037..3313050c 100644
> --- a/lib/igt_core.c
> +++ b/lib/igt_core.c
> @@ -55,9 +55,7 @@
>  #include <limits.h>
>  #include <locale.h>
>  #include <uwildmat/uwildmat.h>
> -#ifdef HAVE_GLIB
>  #include <glib.h>
> -#endif
>  
>  #include "drmtest.h"
>  #include "intel_chipset.h"
> @@ -299,9 +297,7 @@ static struct {
>  } log_buffer;
>  static pthread_mutex_t log_buffer_mutex = PTHREAD_MUTEX_INITIALIZER;
>  
> -#ifdef HAVE_GLIB
>  GKeyFile *igt_key_file;
> -#endif
>  
>  char *igt_frame_dump_path;
>  
> @@ -573,7 +569,6 @@ static void oom_adjust_for_doom(void)
>  
>  }
>  
> -#ifdef HAVE_GLIB
>  static void common_init_config(void)
>  {
>  	char *key_file_env = NULL;
> @@ -624,7 +619,6 @@ out:
>  	if (!key_file_env && key_file_loc)
>  		free(key_file_loc);
>  }
> -#endif
>  
>  static void common_init_env(void)
>  {
> @@ -778,9 +772,7 @@ static int common_init(int *argc, char **argv,
>  		}
>  	}
>  
> -#ifdef HAVE_GLIB
>  	common_init_config();
> -#endif
>  
>  out:
>  	free(short_opts);
> @@ -1435,10 +1427,8 @@ void igt_exit(void)
>  {
>  	igt_exit_called = true;
>  
> -#ifdef HAVE_GLIB
>  	if (igt_key_file)
>  		g_key_file_free(igt_key_file);
> -#endif
>  
>  	if (run_single_subtest && !run_single_subtest_found) {
>  		igt_warn("Unknown subtest: %s\n", run_single_subtest);
> diff --git a/lib/igt_rc.h b/lib/igt_rc.h
> index d7a314c5..53e5ce66 100644
> --- a/lib/igt_rc.h
> +++ b/lib/igt_rc.h
> @@ -25,10 +25,8 @@
>  #ifndef IGT_RC_H
>  #define IGT_RC_H
>  
> -#ifdef HAVE_GLIB
>  #include <glib.h>
>  
>  extern GKeyFile *igt_key_file;
>  
> -#endif /* HAVE_GLIB */
>  #endif /* IGT_RC_H */
> diff --git a/meson.build b/meson.build
> index cd736d8e..98216fc4 100644
> --- a/meson.build
> +++ b/meson.build
> @@ -50,10 +50,7 @@ endif
>  
>  cairo = dependency('cairo', version : '>1.12.0', required : true)
>  libudev = dependency('libudev', required : true)
> -glib = dependency('glib-2.0', required : false)
> -if glib.found()
> -	config.set('HAVE_GLIB', 1)
> -endif
> +glib = dependency('glib-2.0', required : true)
>  
>  gsl = dependency('gsl', required : false)
>  alsa = dependency('alsa', required : false)
> -- 
> 2.14.1
> 

-- 
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch
_______________________________________________
igt-dev mailing list
igt-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/igt-dev

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

* Re: [igt-dev] [PATCH i-g-t 1/2] Make GLib mandatory
  2018-06-21 13:59 ` [igt-dev] [PATCH i-g-t 1/2] " Daniel Vetter
@ 2018-06-21 14:00   ` Daniel Vetter
  0 siblings, 0 replies; 16+ messages in thread
From: Daniel Vetter @ 2018-06-21 14:00 UTC (permalink / raw)
  To: Petri Latvala; +Cc: igt-dev, Daniel Vetter

On Thu, Jun 21, 2018 at 03:59:14PM +0200, Daniel Vetter wrote:
> On Thu, Jun 21, 2018 at 02:06:24PM +0300, Petri Latvala wrote:
> > GLib was originally made optional for Android builds, and Android
> > support was dropped a while ago due to lack of use and maintenance.
> > 
> > Building without GLib was broken without bug reports anyway.
> > 
> > Signed-off-by: Petri Latvala <petri.latvala@intel.com>
> > Cc: Daniel Vetter <daniel@ffwll.ch>
> > Cc: Arkadiusz Hiler <arkadiusz.hiler@intel.com>
> 
> Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch>

Hit send too early: There's a bunch more occurences of glib.found() in
various meson.build that you leave there, and the next patch doesn't seem
to remove them either. Please git grep glib.found, fix up, and then my r-b
should hold.
-Daniel

> 
> > ---
> >  configure.ac   |  8 +-------
> >  lib/igt_core.c | 10 ----------
> >  lib/igt_rc.h   |  2 --
> >  meson.build    |  5 +----
> >  4 files changed, 2 insertions(+), 23 deletions(-)
> > 
> > diff --git a/configure.ac b/configure.ac
> > index 2f6bc70e..1ee4e90e 100644
> > --- a/configure.ac
> > +++ b/configure.ac
> > @@ -177,10 +177,7 @@ PKG_CHECK_MODULES(XRANDR, xrandr >= 1.3, AC_DEFINE(HAVE_XRANDR, 1, [Have libXran
> >  # for testdisplay
> >  PKG_CHECK_MODULES(CAIRO, [cairo >= 1.12.0])
> >  PKG_CHECK_MODULES(LIBUDEV, [libudev])
> > -PKG_CHECK_MODULES(GLIB, [glib-2.0], [glib=yes], [glib=no])
> > -if test x"$glib" = xyes; then
> > -	AC_DEFINE(HAVE_GLIB,1,[Enable glib support])
> > -fi
> > +PKG_CHECK_MODULES(GLIB, [glib-2.0])
> >  PKG_CHECK_MODULES(GSL, [gsl], [gsl=yes], [gsl=no])
> >  AM_CONDITIONAL(HAVE_GSL, [test "x$gsl" = xyes])
> >  
> > @@ -206,9 +203,6 @@ if test "x$enable_chamelium" = xyes; then
> >  	fi
> >  	PKG_CHECK_MODULES(PIXMAN, pixman-1, [],
> >  			  [AC_MSG_ERROR([Failed to find pixman, required by chamelium.])])
> > -	if test x"$glib" != xyes; then
> > -		AC_MSG_ERROR([Failed to find glib, required by chamelium.])
> > -	fi
> >  	if test x"$gsl" != xyes; then
> >  		AC_MSG_ERROR([Failed to find gsl, required by chamelium.])
> >  	fi
> > diff --git a/lib/igt_core.c b/lib/igt_core.c
> > index 06d8b037..3313050c 100644
> > --- a/lib/igt_core.c
> > +++ b/lib/igt_core.c
> > @@ -55,9 +55,7 @@
> >  #include <limits.h>
> >  #include <locale.h>
> >  #include <uwildmat/uwildmat.h>
> > -#ifdef HAVE_GLIB
> >  #include <glib.h>
> > -#endif
> >  
> >  #include "drmtest.h"
> >  #include "intel_chipset.h"
> > @@ -299,9 +297,7 @@ static struct {
> >  } log_buffer;
> >  static pthread_mutex_t log_buffer_mutex = PTHREAD_MUTEX_INITIALIZER;
> >  
> > -#ifdef HAVE_GLIB
> >  GKeyFile *igt_key_file;
> > -#endif
> >  
> >  char *igt_frame_dump_path;
> >  
> > @@ -573,7 +569,6 @@ static void oom_adjust_for_doom(void)
> >  
> >  }
> >  
> > -#ifdef HAVE_GLIB
> >  static void common_init_config(void)
> >  {
> >  	char *key_file_env = NULL;
> > @@ -624,7 +619,6 @@ out:
> >  	if (!key_file_env && key_file_loc)
> >  		free(key_file_loc);
> >  }
> > -#endif
> >  
> >  static void common_init_env(void)
> >  {
> > @@ -778,9 +772,7 @@ static int common_init(int *argc, char **argv,
> >  		}
> >  	}
> >  
> > -#ifdef HAVE_GLIB
> >  	common_init_config();
> > -#endif
> >  
> >  out:
> >  	free(short_opts);
> > @@ -1435,10 +1427,8 @@ void igt_exit(void)
> >  {
> >  	igt_exit_called = true;
> >  
> > -#ifdef HAVE_GLIB
> >  	if (igt_key_file)
> >  		g_key_file_free(igt_key_file);
> > -#endif
> >  
> >  	if (run_single_subtest && !run_single_subtest_found) {
> >  		igt_warn("Unknown subtest: %s\n", run_single_subtest);
> > diff --git a/lib/igt_rc.h b/lib/igt_rc.h
> > index d7a314c5..53e5ce66 100644
> > --- a/lib/igt_rc.h
> > +++ b/lib/igt_rc.h
> > @@ -25,10 +25,8 @@
> >  #ifndef IGT_RC_H
> >  #define IGT_RC_H
> >  
> > -#ifdef HAVE_GLIB
> >  #include <glib.h>
> >  
> >  extern GKeyFile *igt_key_file;
> >  
> > -#endif /* HAVE_GLIB */
> >  #endif /* IGT_RC_H */
> > diff --git a/meson.build b/meson.build
> > index cd736d8e..98216fc4 100644
> > --- a/meson.build
> > +++ b/meson.build
> > @@ -50,10 +50,7 @@ endif
> >  
> >  cairo = dependency('cairo', version : '>1.12.0', required : true)
> >  libudev = dependency('libudev', required : true)
> > -glib = dependency('glib-2.0', required : false)
> > -if glib.found()
> > -	config.set('HAVE_GLIB', 1)
> > -endif
> > +glib = dependency('glib-2.0', required : true)
> >  
> >  gsl = dependency('gsl', required : false)
> >  alsa = dependency('alsa', required : false)
> > -- 
> > 2.14.1
> > 
> 
> -- 
> Daniel Vetter
> Software Engineer, Intel Corporation
> http://blog.ffwll.ch

-- 
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch
_______________________________________________
igt-dev mailing list
igt-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/igt-dev

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

* Re: [igt-dev] [PATCH i-g-t 2/2] meson: Add options to control optional parts
  2018-06-21 11:29   ` Petri Latvala
@ 2018-06-21 14:27     ` Daniel Vetter
  2018-06-21 16:46     ` Lucas De Marchi
  1 sibling, 0 replies; 16+ messages in thread
From: Daniel Vetter @ 2018-06-21 14:27 UTC (permalink / raw)
  To: igt-dev, Matt Turner, Daniel Vetter, Eric Anholt, Arkadiusz Hiler

On Thu, Jun 21, 2018 at 02:29:48PM +0300, Petri Latvala wrote:
> On Thu, Jun 21, 2018 at 02:06:25PM +0300, Petri Latvala wrote:
> > Distributions want explicit control over optional parts so they can
> > state runtime dependencies before building. Let's restore the
> > functionality autotools used to provide.
> > 
> > Where possible, the selection is done by choosing whether to build a
> > particular item and the option name is build_$item. Example:
> > build_overlay. Where not possible, the option name is
> > with_$item. Example: with_valgrind.
> 
> Imagine this paragraph is also here, and the patch having the
> corresponding hunk. I missed the part of Daniel's reply that pointed
> it out:
> 
> 
> Array options require a bump of required meson version to 0.44. Debian
> stable has meson 0.37 which is already too old, stable-backports has
> 0.45, CI uses 0.45. Mesa's meson requirement is 0.44.1, for a
> perspective.
> 
> 
> 
> > 
> > Note, the old hack for not building docs when cross-compiling is
> > gone, as doc building can be explicitly controlled now.
> > 
> > v2: glib not optional
> > 
> > Signed-off-by: Petri Latvala <petri.latvala@intel.com>
> > Cc: Matt Turner <mattst88@gmail.com>
> > Cc: Daniel Vetter <daniel@ffwll.ch>
> > Cc: Eric Anholt <eric@anholt.net>
> > Cc: Arkadiusz Hiler <arkadiusz.hiler@intel.com>
> > ---
> >  benchmarks/meson.build |   4 +-
> >  man/meson.build        |  10 +++-
> >  meson.build            | 142 ++++++++++++++++++++++++++++++++++++++++++-------
> >  meson_options.txt      |  54 +++++++++++++++++++
> >  overlay/meson.build    |  46 ++++++++++++----
> >  tests/meson.build      |   4 +-
> >  6 files changed, 224 insertions(+), 36 deletions(-)
> > 
> > diff --git a/benchmarks/meson.build b/benchmarks/meson.build
> > index 27836c1d..baf1243d 100644
> > --- a/benchmarks/meson.build
> > +++ b/benchmarks/meson.build
> > @@ -35,10 +35,10 @@ foreach prog : benchmark_progs
> >  	executable(prog + '_bench', prog + '.c',
> >  		   install : true,
> >  		   install_dir : benchmarksdir,
> > -		   dependencies : test_deps)
> > +		   dependencies : igt_deps)
> >  endforeach
> >  
> >  executable('gem_wsim_bench', 'gem_wsim.c',
> >  	   install : true,
> >  	   install_dir : benchmarksdir,
> > -	   dependencies : test_deps + [ lib_igt_perf ])
> > +	   dependencies : igt_deps + [ lib_igt_perf ])
> > diff --git a/man/meson.build b/man/meson.build
> > index 49b0686a..fa01f9dd 100644
> > --- a/man/meson.build
> > +++ b/man/meson.build
> > @@ -22,10 +22,10 @@ defs_rst = configure_file(input : 'defs.rst.in',
> >  		output : 'defs.rst',
> >  		configuration : config)
> >  
> > -rst2man = find_program('rst2man', required : false)
> > +rst2man = find_program('rst2man', required : _man_required)
> >  rst2man_script = find_program('rst2man.sh')
> >  
> > -if rst2man.found()
> > +if _build_man and rst2man.found()
> >  	foreach manpage : manpages
> >  		custom_target(manpage + '.1',
> >  				build_by_default : true,
> > @@ -36,4 +36,10 @@ if rst2man.found()
> >  				install : true,
> >  				install_dir : join_paths(mandir, 'man1'))
> >  	endforeach
> > +	build_info += 'Build man pages: Yes'
> > +else
> > +	if _man_required
> > +		error('Cannot build man pages due to missing dependencies')
> > +	endif
> > +	build_info += 'Build man pages: No'
> >  endif
> > diff --git a/meson.build b/meson.build
> > index 98216fc4..dd4679cd 100644
> > --- a/meson.build
> > +++ b/meson.build
> > @@ -26,36 +26,118 @@ foreach cc_arg : cc_args
> >    endif
> >  endforeach
> >  
> > +_build_overlay = false
> > +_overlay_required = false
> > +_build_man = false
> > +_man_required = false
> > +_build_audio = false
> > +_audio_required = false
> > +_build_chamelium = false
> > +_chamelium_required = false
> > +_build_docs = false
> > +_docs_required = false
> > +_build_tests = false
> > +_tests_required = false
> > +
> > +build_overlay = get_option('build_overlay')
> > +overlay_backends = get_option('overlay_backends')
> > +build_man = get_option('build_man')

I'd push this into man/meson.build, avoids an indirection. Feel free to
ignore this bikeshed. Same for other stuff like overlay. I think you
should be able to still construct the build_info array even when it's all
over the place.

> > +with_valgrind = get_option('with_valgrind')
> > +build_audio = get_option('build_audio')
> > +build_chamelium = get_option('build_chamelium')
> > +build_docs = get_option('build_docs')
> > +build_tests = get_option('build_tests')
> > +with_libdrm = get_option('with_libdrm')
> > +
> > +_build_overlay = build_overlay != 'false'
> > +_overlay_required = build_overlay == 'true'
> > +_build_man = build_man != 'false'
> > +_man_required = build_man == 'true'
> > +_build_audio = build_audio != 'false'
> > +_audio_required = build_audio == 'true'
> > +_build_chamelium = build_chamelium != 'false'
> > +_chamelium_required = build_chamelium == 'true'
> > +_build_docs = build_docs != 'false'
> > +_docs_required = build_docs == 'true'
> > +_build_tests = build_tests != 'false'
> > +_tests_required = build_tests == 'true'
> > +
> > +build_info = []
> > +
> >  inc = include_directories('include/drm-uapi', 'lib', '.')
> >  
> >  inc_for_gtkdoc = include_directories('lib')
> >  
> >  config = configuration_data()
> >  
> > +null_dep = dependency('', required : false)
> > +
> > +libdrm_info = []
> > +libdrm_intel = null_dep
> > +libdrm_nouveau = null_dep
> > +libdrm_amdgpu = null_dep
> > +
> >  libdrm_version = '>=2.4.82'
> >  libdrm = dependency('libdrm', version : libdrm_version)
> > -libdrm_intel = dependency('libdrm_intel', version : libdrm_version, required : false)
> > -libdrm_nouveau = dependency('libdrm_nouveau', version : libdrm_version, required : false)
> > -libdrm_amdgpu = dependency('libdrm_amdgpu', version : libdrm_version, required : false)
> > +if with_libdrm.contains('auto') or with_libdrm.contains('intel')
> > +	libdrm_intel = dependency('libdrm_intel', version : libdrm_version, required : with_libdrm.contains('intel'))
> > +	libdrm_info += 'intel'
> > +endif
> > +if with_libdrm.contains('auto') or with_libdrm.contains('nouveau')
> > +	libdrm_nouveau = dependency('libdrm_nouveau', version : libdrm_version, required : with_libdrm.contains('nouveau'))
> > +	libdrm_info += 'nouveau'
> > +endif
> > +if with_libdrm.contains('auto') or with_libdrm.contains('amdgpu')
> > +	libdrm_amdgpu = dependency('libdrm_amdgpu', version : libdrm_version, required : with_libdrm.contains('amdgpu'))
> > +	libdrm_info += 'amdgpu'
> > +endif
> > +
> > +build_info += 'With libdrm: ' + ','.join(libdrm_info)
> >  
> >  pciaccess = dependency('pciaccess', version : '>=0.10')
> >  libkmod = dependency('libkmod')
> >  libprocps = dependency('libprocps', required : true)
> >  libunwind = dependency('libunwind', required : true)
> >  
> > -valgrind = dependency('valgrind', required : false)
> > -if valgrind.found()
> > -	config.set('HAVE_VALGRIND', 1)
> > +valgrind = null_dep
> > +valgrindinfo = 'No'
> > +if with_valgrind != 'false'
> > +	valgrind = dependency('valgrind', required : with_valgrind == 'true')
> > +	if valgrind.found()
> > +		config.set('HAVE_VALGRIND', 1)
> > +		valgrindinfo = 'Yes'
> > +	endif
> >  endif
> > +build_info += 'Valgrind annotations: ' + valgrindinfo
> >  
> >  cairo = dependency('cairo', version : '>1.12.0', required : true)
> >  libudev = dependency('libudev', required : true)
> >  glib = dependency('glib-2.0', required : true)
> >  
> > -gsl = dependency('gsl', required : false)
> > -alsa = dependency('alsa', required : false)
> > +gsl = null_dep
> > +alsa = null_dep
> > +pixman = null_dep
> > +if _build_audio or _build_chamelium
> > +	gsl = dependency('gsl', required : _audio_required or _chamelium_required)
> > +endif
> > +if _build_audio
> > +	alsa = dependency('alsa', required : _audio_required)
> > +endif
> > +if _build_chamelium
> > +	pixman = dependency('pixman-1', required : _chamelium_required)
> > +endif
> > +
> > +audioinfo = 'No'
> > +if _build_audio and alsa.found() and gsl.found()
> > +	audioinfo = 'Yes'
> > +else
> > +	if _audio_required
> > +		error('Cannot build audio test due to missing dependencies')
> > +	endif
> > +	_build_audio = false
> > +endif
> > +build_info += 'Build audio test: ' + audioinfo
> >  
> > -pixman = dependency('pixman-1', required : false)
> >  xmlrpc = dependency('xmlrpc', required : false)
> >  xmlrpc_util = dependency('xmlrpc_util', required : false)
> >  xmlrpc_client = dependency('xmlrpc_client', required : false)
> > @@ -73,13 +155,17 @@ if not xmlrpc.found() and xmlrpc_cmd.found()
> >  	endif
> >  endif
> >  
> > -if pixman.found() and gsl.found() and xmlrpc.found() and xmlrpc_util.found() and xmlrpc_client.found()
> > +chamelium = null_dep
> > +chameliuminfo = 'No'
> > +if _build_chamelium and pixman.found() and gsl.found() and xmlrpc.found() and xmlrpc_util.found() and xmlrpc_client.found()
> >  	chamelium = declare_dependency(dependencies : [ pixman, xmlrpc,
> > -	  xmlrpc_util, xmlrpc_client])
> > +							xmlrpc_util, xmlrpc_client])
> >  	config.set('HAVE_CHAMELIUM', 1)
> > -else
> > -	chamelium = dependency('', required: false)
> > +	chameliuminfo = 'Yes'
> > +elif _chamelium_required
> > +	error('Cannot build chamelium test due to missing dependencies')
> >  endif
> > +build_info += 'Build Chamelium test: ' + chameliuminfo
> >  
> >  pthreads = dependency('threads')
> >  math = cc.find_library('m')
> > @@ -130,17 +216,33 @@ mandir = get_option('mandir')
> >  pkgconfigdir = join_paths(libdir, 'pkgconfig')
> >  
> >  subdir('lib')
> > -subdir('tests')
> > +if _build_tests
> > +	subdir('tests')
> > +	build_info += 'Build tests: Yes'
> > +else
> > +	build_info += 'Build tests: No'
> > +endif
> >  subdir('benchmarks')
> >  subdir('tools')
> >  if libdrm_intel.found()
> >  	subdir('assembler')
> > -	if ['x86', 'x86_64'].contains(host_machine.cpu_family())
> > -		subdir('overlay')
> > -	endif
> >  endif
> > +subdir('overlay')
> >  subdir('man')
> > -# has_exe_wrapper() is undefined if building natively
> > -if not meson.is_cross_build() or not meson.has_exe_wrapper()
> > -	subdir('docs')
> > +
> > +docs_info = 'No'
> > +if _build_docs
> > +	if _build_tests
> > +		subdir('docs')
> > +		docs_info = 'Yes'
> > +	elif _docs_required
> > +		error('Documentation requires building tests')
> > +	endif
> >  endif
> > +build_info += 'Build documentation: ' + docs_info
> > +
> > +message('Build options')
> > +message('=============')
> > +foreach str : build_info
> > +	message(str)
> > +endforeach

Hm kinda annoying that we have to hand-roll this all.

> > diff --git a/meson_options.txt b/meson_options.txt
> > index 41be35e0..05e63463 100644
> > --- a/meson_options.txt
> > +++ b/meson_options.txt
> > @@ -1,3 +1,57 @@
> > +option('build_overlay',
> > +       type : 'combo',
> > +       value : 'auto',
> > +       choices : ['auto', 'true', 'false'],
> > +       description : 'Build overlay')
> > +
> > +option('overlay_backends',
> > +       type : 'array',
> > +       value : ['auto'],
> > +       choices : [ 'auto', 'x', 'xv' ],
> > +       description : 'Overlay backends to enable')
> > +
> > +option('build_audio',
> > +       type : 'combo',
> > +       value : 'auto',
> > +       choices : ['auto', 'true', 'false'],
> > +       description : 'Build audio test')
> > +
> > +option('build_chamelium',
> > +       type : 'combo',
> > +       value : 'auto',
> > +       choices : ['auto', 'true', 'false'],
> > +       description : 'Build chamelium test')
> > +
> > +option('with_valgrind',
> > +       type : 'combo',
> > +       value : 'auto',
> > +       choices : ['auto', 'true', 'false'],
> > +       description : 'Build with support for valgrind annotations')
> > +
> > +option('build_man',
> > +       type : 'combo',
> > +       value : 'auto',
> > +       choices : ['auto', 'true', 'false'],
> > +       description : 'Build man pages')
> > +
> > +option('build_docs',
> > +       type : 'combo',
> > +       value : 'auto',
> > +       choices : ['auto', 'true', 'false'],
> > +       description : 'Build documentation')
> > +
> > +option('build_tests',
> > +       type : 'combo',
> > +       value : 'auto',
> > +       choices : ['auto', 'true', 'false'],
> > +       description : 'Build tests')
> > +
> > +option('with_libdrm',
> > +       type : 'array',
> > +       value : ['auto'],
> > +       choices : ['', 'auto', 'intel', 'nouveau', 'amdgpu'],
> > +       description : 'libdrm libraries to be used')
> > +
> >  option('use_rpath',
> >         type : 'boolean',
> >         value : false,
> > diff --git a/overlay/meson.build b/overlay/meson.build
> > index 546c8377..46d2d494 100644
> > --- a/overlay/meson.build
> > +++ b/overlay/meson.build
> > @@ -14,20 +14,35 @@ gpu_overlay_src = [
> >  	'rc6.c',
> >  ]
> >  
> > -xv = dependency('xv', required : false)
> > -x11 = dependency('x11', required : false)
> > -xext = dependency('xext', required : false)
> > -dri2proto = dependency('dri2proto', version : '>= 2.6', required : false)
> > -cairo_xlib = dependency('cairo-xlib', required : false)
> > -xrandr = dependency('xrandr', version : '>=1.3', required : false)
> > +xv_backend_required = false
> > +xlib_backend_required = false
> > +build_xv_backend = overlay_backends.contains('xv') or overlay_backends.contains('auto')
> > +build_xlib_backend = overlay_backends.contains('x') or overlay_backends.contains('auto')
> > +if _overlay_required
> > +	xv_backend_required = overlay_backends.contains('xv')
> > +	xlib_backend_required = overlay_backends.contains('x')
> > +endif
> > +
> > +xv = dependency('xv', required : xv_backend_required)
> > +x11 = dependency('x11', required : xv_backend_required)
> > +xext = dependency('xext', required : xv_backend_required)
> > +dri2proto = dependency('dri2proto',
> > +		       version : '>= 2.6',
> > +		       required : xv_backend_required or xlib_backend_required)
> > +cairo_xlib = dependency('cairo-xlib', required : xlib_backend_required)
> > +xrandr = dependency('xrandr', version : '>=1.3', required : _overlay_required)
> >  
> >  gpu_overlay_deps = [ realtime, math, cairo, pciaccess, libdrm,
> >  	libdrm_intel, lib_igt_perf ]
> >  
> >  both_x11_src = ''
> >  
> > +with_xv_backend = false
> > +with_xlib_backend = false
> > +backends_strings = []
> > +
> >  gpu_overlay_cflags = []
> > -if xv.found() and x11.found() and xext.found() and dri2proto.found()
> > +if build_xv_backend and xv.found() and x11.found() and xext.found() and dri2proto.found()
> >  	both_x11_src = 'x11/position.c'
> >  	gpu_overlay_src += [
> >  		'x11/dri2.c',
> > @@ -38,20 +53,24 @@ if xv.found() and x11.found() and xext.found() and dri2proto.found()
> >  	]
> >  	gpu_overlay_deps += [ xv, x11, xext, dri2proto ]
> >  	gpu_overlay_cflags += [ '-DHAVE_OVERLAY_XVLIB' ]
> > +	with_xv_backend = true
> > +	backends_strings += 'Xv'
> >  endif
> >  
> > -if cairo_xlib.found() and xrandr.found() and dri2proto.found()
> > +if build_xlib_backend and cairo_xlib.found() and dri2proto.found()
> >  	both_x11_src = 'x11/position.c'
> >  	gpu_overlay_src += 'x11/x11-window.c'
> >  	gpu_overlay_deps += [ cairo_xlib, dri2proto ]
> >  	gpu_overlay_cflags += [ '-DHAVE_OVERLAY_XLIB' ]
> > +	with_xlib_backend = true
> > +	backends_strings += 'X'
> >  endif
> >  
> >  gpu_overlay_src += both_x11_src
> >  
> >  gpu_overlay_src += 'kms/kms-overlay.c'
> >  
> > -leg = find_program('leg', required : false)
> > +leg = find_program('leg', required : _overlay_required)
> >  if leg.found()
> >  	leg_file = custom_target('tracepoint_format',
> >  		output: 'tracepoint_format.h',
> > @@ -62,10 +81,17 @@ else
> >  	message('WARNING: leg command not found, disabling overlay; try : apt-get install peg')
> >  endif
> >  
> > -if leg.found() and xrandr.found() and cairo.found()
> > +if _build_overlay and ['x86', 'x86_64'].contains(host_machine.cpu_family()) and libdrm_intel.found() and leg.found() and xrandr.found() and cairo.found() and (with_xlib_backend or with_xv_backend)
> >  	executable('intel-gpu-overlay', gpu_overlay_src,
> >  			include_directories : inc,
> >  			c_args : gpu_overlay_cflags,
> >  			dependencies : gpu_overlay_deps,
> >  			install : true)
> > +	build_info += 'Build overlay: Yes'
> > +	build_info += 'Overlay backends: ' + ','.join(backends_strings)
> > +else
> > +	if _overlay_required
> > +		error('Cannot build overlay due to missing dependencies')
> > +	endif
> > +	build_info += 'Build overlay: No'
> >  endif
> > diff --git a/tests/meson.build b/tests/meson.build
> > index cedb4ff1..9ec39e08 100644
> > --- a/tests/meson.build
> > +++ b/tests/meson.build
> > @@ -232,14 +232,14 @@ if libdrm_nouveau.found()
> >  	test_deps += libdrm_nouveau
> >  endif
> >  
> > -if chamelium.found()
> > +if _build_chamelium and chamelium.found()
> >  	test_progs += [
> >  		'kms_chamelium',
> >  	]
> >  	test_deps += chamelium
> >  endif
> >  
> > -if alsa.found() and gsl.found()
> > +if _build_audio and alsa.found() and gsl.found()
> >  	test_progs += [
> >  		'audio',
> >  	]

With the 0.44 issue addressed:

Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch>
> > -- 
> > 2.14.1
> > 

-- 
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch
_______________________________________________
igt-dev mailing list
igt-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/igt-dev

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

* [igt-dev] ✓ Fi.CI.IGT: success for series starting with [i-g-t,1/2] Make GLib mandatory
  2018-06-21 11:06 [igt-dev] [PATCH i-g-t 1/2] Make GLib mandatory Petri Latvala
                   ` (2 preceding siblings ...)
  2018-06-21 13:59 ` [igt-dev] [PATCH i-g-t 1/2] " Daniel Vetter
@ 2018-06-21 15:30 ` Patchwork
  2018-06-25  9:52 ` [igt-dev] ✓ Fi.CI.BAT: success for series starting with [i-g-t,1/2] Make GLib mandatory (rev2) Patchwork
  2018-06-25 12:18 ` [igt-dev] ✓ Fi.CI.IGT: " Patchwork
  5 siblings, 0 replies; 16+ messages in thread
From: Patchwork @ 2018-06-21 15:30 UTC (permalink / raw)
  To: Petri Latvala; +Cc: igt-dev

== Series Details ==

Series: series starting with [i-g-t,1/2] Make GLib mandatory
URL   : https://patchwork.freedesktop.org/series/45159/
State : success

== Summary ==

= CI Bug Log - changes from IGT_4526_full -> IGTPW_1494_full =

== Summary - WARNING ==

  Minor unknown changes coming with IGTPW_1494_full need to be verified
  manually.
  
  If you think the reported changes have nothing to do with the changes
  introduced in IGTPW_1494_full, please notify your bug team to allow them
  to document this new failure mode, which will reduce false positives in CI.

  External URL: https://patchwork.freedesktop.org/api/1.0/series/45159/revisions/1/mbox/

== Possible new issues ==

  Here are the unknown changes that may have been introduced in IGTPW_1494_full:

  === IGT changes ===

    ==== Warnings ====

    igt@gem_mocs_settings@mocs-rc6-bsd2:
      shard-kbl:          PASS -> SKIP

    igt@pm_rc6_residency@rc6-accuracy:
      shard-kbl:          SKIP -> PASS

    
== Known issues ==

  Here are the changes found in IGTPW_1494_full that come from known issues:

  === IGT changes ===

    ==== Issues hit ====

    igt@drv_selftest@live_gtt:
      shard-kbl:          PASS -> FAIL (fdo#105347)

    igt@gem_exec_flush@basic-batch-kernel-default-uc:
      shard-snb:          PASS -> INCOMPLETE (fdo#105411)

    igt@gem_exec_schedule@pi-ringfull-vebox:
      shard-kbl:          NOTRUN -> FAIL (fdo#103158)

    igt@kms_available_modes_crc@available_mode_test_crc:
      shard-snb:          PASS -> FAIL (fdo#106641)

    igt@kms_cursor_crc@cursor-128x128-onscreen:
      shard-glk:          PASS -> INCOMPLETE (k.org#198133, fdo#103359)

    igt@kms_cursor_crc@cursor-256x256-suspend:
      shard-kbl:          PASS -> INCOMPLETE (fdo#103665)

    igt@kms_cursor_legacy@cursora-vs-flipa-toggle:
      shard-glk:          PASS -> DMESG-WARN (fdo#105763)

    igt@kms_flip@2x-flip-vs-expired-vblank-interruptible:
      shard-glk:          PASS -> FAIL (fdo#105189)

    igt@kms_flip@2x-plain-flip-fb-recreate-interruptible:
      shard-glk:          PASS -> FAIL (fdo#100368)

    igt@kms_flip_tiling@flip-y-tiled:
      shard-glk:          PASS -> FAIL (fdo#103822, fdo#104724)

    igt@kms_setmode@basic:
      shard-apl:          PASS -> FAIL (fdo#99912)

    
    ==== Possible fixes ====

    igt@drv_selftest@live_gtt:
      shard-glk:          FAIL (fdo#105347) -> PASS

    igt@drv_selftest@live_hangcheck:
      shard-glk:          DMESG-FAIL (fdo#106947, fdo#106560) -> PASS

    igt@kms_cursor_legacy@2x-nonblocking-modeset-vs-cursor-atomic:
      shard-glk:          FAIL (fdo#105454, fdo#106509) -> PASS

    igt@kms_flip@2x-flip-vs-expired-vblank:
      shard-glk:          FAIL (fdo#102887) -> PASS

    igt@kms_flip@plain-flip-ts-check:
      shard-glk:          FAIL (fdo#100368) -> PASS

    igt@kms_frontbuffer_tracking@fbc-1p-primscrn-indfb-msflip-blt:
      shard-snb:          INCOMPLETE (fdo#105411) -> PASS

    igt@pm_rpm@system-suspend-execbuf:
      shard-kbl:          INCOMPLETE (fdo#103665) -> PASS

    
  fdo#100368 https://bugs.freedesktop.org/show_bug.cgi?id=100368
  fdo#102887 https://bugs.freedesktop.org/show_bug.cgi?id=102887
  fdo#103158 https://bugs.freedesktop.org/show_bug.cgi?id=103158
  fdo#103359 https://bugs.freedesktop.org/show_bug.cgi?id=103359
  fdo#103665 https://bugs.freedesktop.org/show_bug.cgi?id=103665
  fdo#103822 https://bugs.freedesktop.org/show_bug.cgi?id=103822
  fdo#104724 https://bugs.freedesktop.org/show_bug.cgi?id=104724
  fdo#105189 https://bugs.freedesktop.org/show_bug.cgi?id=105189
  fdo#105347 https://bugs.freedesktop.org/show_bug.cgi?id=105347
  fdo#105411 https://bugs.freedesktop.org/show_bug.cgi?id=105411
  fdo#105454 https://bugs.freedesktop.org/show_bug.cgi?id=105454
  fdo#105763 https://bugs.freedesktop.org/show_bug.cgi?id=105763
  fdo#106509 https://bugs.freedesktop.org/show_bug.cgi?id=106509
  fdo#106560 https://bugs.freedesktop.org/show_bug.cgi?id=106560
  fdo#106641 https://bugs.freedesktop.org/show_bug.cgi?id=106641
  fdo#106947 https://bugs.freedesktop.org/show_bug.cgi?id=106947
  fdo#99912 https://bugs.freedesktop.org/show_bug.cgi?id=99912
  k.org#198133 https://bugzilla.kernel.org/show_bug.cgi?id=198133


== Participating hosts (5 -> 5) ==

  No changes in participating hosts


== Build changes ==

    * IGT: IGT_4526 -> IGTPW_1494
    * Linux: CI_DRM_4347 -> CI_DRM_4348

  CI_DRM_4347: 5b7806eb03ba0ce0c1bfe75b2e303506c076965d @ git://anongit.freedesktop.org/gfx-ci/linux
  CI_DRM_4348: 3a2fbf8fe32d909c5d44e61e7d212ae694e9e473 @ git://anongit.freedesktop.org/gfx-ci/linux
  IGTPW_1494: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_1494/
  IGT_4526: 4bbfb4fb14b3deab9bc4db9911280b35c22b718c @ git://anongit.freedesktop.org/xorg/app/intel-gpu-tools

== Logs ==

For more details see: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_1494/shards.html
_______________________________________________
igt-dev mailing list
igt-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/igt-dev

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

* Re: [igt-dev] [PATCH i-g-t 2/2] meson: Add options to control optional parts
  2018-06-21 11:29   ` Petri Latvala
  2018-06-21 14:27     ` Daniel Vetter
@ 2018-06-21 16:46     ` Lucas De Marchi
  2018-06-22  8:27       ` Daniel Vetter
  1 sibling, 1 reply; 16+ messages in thread
From: Lucas De Marchi @ 2018-06-21 16:46 UTC (permalink / raw)
  To: igt-dev, Matt Turner, Daniel Vetter, Eric Anholt, Arkadiusz Hiler

On Thu, Jun 21, 2018 at 02:29:48PM +0300, Petri Latvala wrote:
> On Thu, Jun 21, 2018 at 02:06:25PM +0300, Petri Latvala wrote:
> > Distributions want explicit control over optional parts so they can
> > state runtime dependencies before building. Let's restore the
> > functionality autotools used to provide.
> > 
> > Where possible, the selection is done by choosing whether to build a
> > particular item and the option name is build_$item. Example:
> > build_overlay. Where not possible, the option name is
> > with_$item. Example: with_valgrind.
> 
> Imagine this paragraph is also here, and the patch having the
> corresponding hunk. I missed the part of Daniel's reply that pointed
> it out:
> 
> 
> Array options require a bump of required meson version to 0.44. Debian
> stable has meson 0.37 which is already too old, stable-backports has
> 0.45, CI uses 0.45. Mesa's meson requirement is 0.44.1, for a
> perspective.

We can always ask people to install from pip in cases the distro package
is too old. Given meson itself is new and is rapidly changing, I think
this is a reasonable compromise for now. As it matures we could revisit
this decision and be more compatible with previous versions.  Thoughts?

For reference, currently pip has meson 0.46.1.

Lucas De Marchi


> 
> 
> 
> > 
> > Note, the old hack for not building docs when cross-compiling is
> > gone, as doc building can be explicitly controlled now.
> > 
> > v2: glib not optional
> > 
> > Signed-off-by: Petri Latvala <petri.latvala@intel.com>
> > Cc: Matt Turner <mattst88@gmail.com>
> > Cc: Daniel Vetter <daniel@ffwll.ch>
> > Cc: Eric Anholt <eric@anholt.net>
> > Cc: Arkadiusz Hiler <arkadiusz.hiler@intel.com>
> > ---
> >  benchmarks/meson.build |   4 +-
> >  man/meson.build        |  10 +++-
> >  meson.build            | 142 ++++++++++++++++++++++++++++++++++++++++++-------
> >  meson_options.txt      |  54 +++++++++++++++++++
> >  overlay/meson.build    |  46 ++++++++++++----
> >  tests/meson.build      |   4 +-
> >  6 files changed, 224 insertions(+), 36 deletions(-)
> > 
> > diff --git a/benchmarks/meson.build b/benchmarks/meson.build
> > index 27836c1d..baf1243d 100644
> > --- a/benchmarks/meson.build
> > +++ b/benchmarks/meson.build
> > @@ -35,10 +35,10 @@ foreach prog : benchmark_progs
> >  	executable(prog + '_bench', prog + '.c',
> >  		   install : true,
> >  		   install_dir : benchmarksdir,
> > -		   dependencies : test_deps)
> > +		   dependencies : igt_deps)
> >  endforeach
> >  
> >  executable('gem_wsim_bench', 'gem_wsim.c',
> >  	   install : true,
> >  	   install_dir : benchmarksdir,
> > -	   dependencies : test_deps + [ lib_igt_perf ])
> > +	   dependencies : igt_deps + [ lib_igt_perf ])
> > diff --git a/man/meson.build b/man/meson.build
> > index 49b0686a..fa01f9dd 100644
> > --- a/man/meson.build
> > +++ b/man/meson.build
> > @@ -22,10 +22,10 @@ defs_rst = configure_file(input : 'defs.rst.in',
> >  		output : 'defs.rst',
> >  		configuration : config)
> >  
> > -rst2man = find_program('rst2man', required : false)
> > +rst2man = find_program('rst2man', required : _man_required)
> >  rst2man_script = find_program('rst2man.sh')
> >  
> > -if rst2man.found()
> > +if _build_man and rst2man.found()
> >  	foreach manpage : manpages
> >  		custom_target(manpage + '.1',
> >  				build_by_default : true,
> > @@ -36,4 +36,10 @@ if rst2man.found()
> >  				install : true,
> >  				install_dir : join_paths(mandir, 'man1'))
> >  	endforeach
> > +	build_info += 'Build man pages: Yes'
> > +else
> > +	if _man_required
> > +		error('Cannot build man pages due to missing dependencies')
> > +	endif
> > +	build_info += 'Build man pages: No'
> >  endif
> > diff --git a/meson.build b/meson.build
> > index 98216fc4..dd4679cd 100644
> > --- a/meson.build
> > +++ b/meson.build
> > @@ -26,36 +26,118 @@ foreach cc_arg : cc_args
> >    endif
> >  endforeach
> >  
> > +_build_overlay = false
> > +_overlay_required = false
> > +_build_man = false
> > +_man_required = false
> > +_build_audio = false
> > +_audio_required = false
> > +_build_chamelium = false
> > +_chamelium_required = false
> > +_build_docs = false
> > +_docs_required = false
> > +_build_tests = false
> > +_tests_required = false
> > +
> > +build_overlay = get_option('build_overlay')
> > +overlay_backends = get_option('overlay_backends')
> > +build_man = get_option('build_man')
> > +with_valgrind = get_option('with_valgrind')
> > +build_audio = get_option('build_audio')
> > +build_chamelium = get_option('build_chamelium')
> > +build_docs = get_option('build_docs')
> > +build_tests = get_option('build_tests')
> > +with_libdrm = get_option('with_libdrm')
> > +
> > +_build_overlay = build_overlay != 'false'
> > +_overlay_required = build_overlay == 'true'
> > +_build_man = build_man != 'false'
> > +_man_required = build_man == 'true'
> > +_build_audio = build_audio != 'false'
> > +_audio_required = build_audio == 'true'
> > +_build_chamelium = build_chamelium != 'false'
> > +_chamelium_required = build_chamelium == 'true'
> > +_build_docs = build_docs != 'false'
> > +_docs_required = build_docs == 'true'
> > +_build_tests = build_tests != 'false'
> > +_tests_required = build_tests == 'true'
> > +
> > +build_info = []
> > +
> >  inc = include_directories('include/drm-uapi', 'lib', '.')
> >  
> >  inc_for_gtkdoc = include_directories('lib')
> >  
> >  config = configuration_data()
> >  
> > +null_dep = dependency('', required : false)
> > +
> > +libdrm_info = []
> > +libdrm_intel = null_dep
> > +libdrm_nouveau = null_dep
> > +libdrm_amdgpu = null_dep
> > +
> >  libdrm_version = '>=2.4.82'
> >  libdrm = dependency('libdrm', version : libdrm_version)
> > -libdrm_intel = dependency('libdrm_intel', version : libdrm_version, required : false)
> > -libdrm_nouveau = dependency('libdrm_nouveau', version : libdrm_version, required : false)
> > -libdrm_amdgpu = dependency('libdrm_amdgpu', version : libdrm_version, required : false)
> > +if with_libdrm.contains('auto') or with_libdrm.contains('intel')
> > +	libdrm_intel = dependency('libdrm_intel', version : libdrm_version, required : with_libdrm.contains('intel'))
> > +	libdrm_info += 'intel'
> > +endif
> > +if with_libdrm.contains('auto') or with_libdrm.contains('nouveau')
> > +	libdrm_nouveau = dependency('libdrm_nouveau', version : libdrm_version, required : with_libdrm.contains('nouveau'))
> > +	libdrm_info += 'nouveau'
> > +endif
> > +if with_libdrm.contains('auto') or with_libdrm.contains('amdgpu')
> > +	libdrm_amdgpu = dependency('libdrm_amdgpu', version : libdrm_version, required : with_libdrm.contains('amdgpu'))
> > +	libdrm_info += 'amdgpu'
> > +endif
> > +
> > +build_info += 'With libdrm: ' + ','.join(libdrm_info)
> >  
> >  pciaccess = dependency('pciaccess', version : '>=0.10')
> >  libkmod = dependency('libkmod')
> >  libprocps = dependency('libprocps', required : true)
> >  libunwind = dependency('libunwind', required : true)
> >  
> > -valgrind = dependency('valgrind', required : false)
> > -if valgrind.found()
> > -	config.set('HAVE_VALGRIND', 1)
> > +valgrind = null_dep
> > +valgrindinfo = 'No'
> > +if with_valgrind != 'false'
> > +	valgrind = dependency('valgrind', required : with_valgrind == 'true')
> > +	if valgrind.found()
> > +		config.set('HAVE_VALGRIND', 1)
> > +		valgrindinfo = 'Yes'
> > +	endif
> >  endif
> > +build_info += 'Valgrind annotations: ' + valgrindinfo
> >  
> >  cairo = dependency('cairo', version : '>1.12.0', required : true)
> >  libudev = dependency('libudev', required : true)
> >  glib = dependency('glib-2.0', required : true)
> >  
> > -gsl = dependency('gsl', required : false)
> > -alsa = dependency('alsa', required : false)
> > +gsl = null_dep
> > +alsa = null_dep
> > +pixman = null_dep
> > +if _build_audio or _build_chamelium
> > +	gsl = dependency('gsl', required : _audio_required or _chamelium_required)
> > +endif
> > +if _build_audio
> > +	alsa = dependency('alsa', required : _audio_required)
> > +endif
> > +if _build_chamelium
> > +	pixman = dependency('pixman-1', required : _chamelium_required)
> > +endif
> > +
> > +audioinfo = 'No'
> > +if _build_audio and alsa.found() and gsl.found()
> > +	audioinfo = 'Yes'
> > +else
> > +	if _audio_required
> > +		error('Cannot build audio test due to missing dependencies')
> > +	endif
> > +	_build_audio = false
> > +endif
> > +build_info += 'Build audio test: ' + audioinfo
> >  
> > -pixman = dependency('pixman-1', required : false)
> >  xmlrpc = dependency('xmlrpc', required : false)
> >  xmlrpc_util = dependency('xmlrpc_util', required : false)
> >  xmlrpc_client = dependency('xmlrpc_client', required : false)
> > @@ -73,13 +155,17 @@ if not xmlrpc.found() and xmlrpc_cmd.found()
> >  	endif
> >  endif
> >  
> > -if pixman.found() and gsl.found() and xmlrpc.found() and xmlrpc_util.found() and xmlrpc_client.found()
> > +chamelium = null_dep
> > +chameliuminfo = 'No'
> > +if _build_chamelium and pixman.found() and gsl.found() and xmlrpc.found() and xmlrpc_util.found() and xmlrpc_client.found()
> >  	chamelium = declare_dependency(dependencies : [ pixman, xmlrpc,
> > -	  xmlrpc_util, xmlrpc_client])
> > +							xmlrpc_util, xmlrpc_client])
> >  	config.set('HAVE_CHAMELIUM', 1)
> > -else
> > -	chamelium = dependency('', required: false)
> > +	chameliuminfo = 'Yes'
> > +elif _chamelium_required
> > +	error('Cannot build chamelium test due to missing dependencies')
> >  endif
> > +build_info += 'Build Chamelium test: ' + chameliuminfo
> >  
> >  pthreads = dependency('threads')
> >  math = cc.find_library('m')
> > @@ -130,17 +216,33 @@ mandir = get_option('mandir')
> >  pkgconfigdir = join_paths(libdir, 'pkgconfig')
> >  
> >  subdir('lib')
> > -subdir('tests')
> > +if _build_tests
> > +	subdir('tests')
> > +	build_info += 'Build tests: Yes'
> > +else
> > +	build_info += 'Build tests: No'
> > +endif
> >  subdir('benchmarks')
> >  subdir('tools')
> >  if libdrm_intel.found()
> >  	subdir('assembler')
> > -	if ['x86', 'x86_64'].contains(host_machine.cpu_family())
> > -		subdir('overlay')
> > -	endif
> >  endif
> > +subdir('overlay')
> >  subdir('man')
> > -# has_exe_wrapper() is undefined if building natively
> > -if not meson.is_cross_build() or not meson.has_exe_wrapper()
> > -	subdir('docs')
> > +
> > +docs_info = 'No'
> > +if _build_docs
> > +	if _build_tests
> > +		subdir('docs')
> > +		docs_info = 'Yes'
> > +	elif _docs_required
> > +		error('Documentation requires building tests')
> > +	endif
> >  endif
> > +build_info += 'Build documentation: ' + docs_info
> > +
> > +message('Build options')
> > +message('=============')
> > +foreach str : build_info
> > +	message(str)
> > +endforeach
> > diff --git a/meson_options.txt b/meson_options.txt
> > index 41be35e0..05e63463 100644
> > --- a/meson_options.txt
> > +++ b/meson_options.txt
> > @@ -1,3 +1,57 @@
> > +option('build_overlay',
> > +       type : 'combo',
> > +       value : 'auto',
> > +       choices : ['auto', 'true', 'false'],
> > +       description : 'Build overlay')
> > +
> > +option('overlay_backends',
> > +       type : 'array',
> > +       value : ['auto'],
> > +       choices : [ 'auto', 'x', 'xv' ],
> > +       description : 'Overlay backends to enable')
> > +
> > +option('build_audio',
> > +       type : 'combo',
> > +       value : 'auto',
> > +       choices : ['auto', 'true', 'false'],
> > +       description : 'Build audio test')
> > +
> > +option('build_chamelium',
> > +       type : 'combo',
> > +       value : 'auto',
> > +       choices : ['auto', 'true', 'false'],
> > +       description : 'Build chamelium test')
> > +
> > +option('with_valgrind',
> > +       type : 'combo',
> > +       value : 'auto',
> > +       choices : ['auto', 'true', 'false'],
> > +       description : 'Build with support for valgrind annotations')
> > +
> > +option('build_man',
> > +       type : 'combo',
> > +       value : 'auto',
> > +       choices : ['auto', 'true', 'false'],
> > +       description : 'Build man pages')
> > +
> > +option('build_docs',
> > +       type : 'combo',
> > +       value : 'auto',
> > +       choices : ['auto', 'true', 'false'],
> > +       description : 'Build documentation')
> > +
> > +option('build_tests',
> > +       type : 'combo',
> > +       value : 'auto',
> > +       choices : ['auto', 'true', 'false'],
> > +       description : 'Build tests')
> > +
> > +option('with_libdrm',
> > +       type : 'array',
> > +       value : ['auto'],
> > +       choices : ['', 'auto', 'intel', 'nouveau', 'amdgpu'],
> > +       description : 'libdrm libraries to be used')
> > +
> >  option('use_rpath',
> >         type : 'boolean',
> >         value : false,
> > diff --git a/overlay/meson.build b/overlay/meson.build
> > index 546c8377..46d2d494 100644
> > --- a/overlay/meson.build
> > +++ b/overlay/meson.build
> > @@ -14,20 +14,35 @@ gpu_overlay_src = [
> >  	'rc6.c',
> >  ]
> >  
> > -xv = dependency('xv', required : false)
> > -x11 = dependency('x11', required : false)
> > -xext = dependency('xext', required : false)
> > -dri2proto = dependency('dri2proto', version : '>= 2.6', required : false)
> > -cairo_xlib = dependency('cairo-xlib', required : false)
> > -xrandr = dependency('xrandr', version : '>=1.3', required : false)
> > +xv_backend_required = false
> > +xlib_backend_required = false
> > +build_xv_backend = overlay_backends.contains('xv') or overlay_backends.contains('auto')
> > +build_xlib_backend = overlay_backends.contains('x') or overlay_backends.contains('auto')
> > +if _overlay_required
> > +	xv_backend_required = overlay_backends.contains('xv')
> > +	xlib_backend_required = overlay_backends.contains('x')
> > +endif
> > +
> > +xv = dependency('xv', required : xv_backend_required)
> > +x11 = dependency('x11', required : xv_backend_required)
> > +xext = dependency('xext', required : xv_backend_required)
> > +dri2proto = dependency('dri2proto',
> > +		       version : '>= 2.6',
> > +		       required : xv_backend_required or xlib_backend_required)
> > +cairo_xlib = dependency('cairo-xlib', required : xlib_backend_required)
> > +xrandr = dependency('xrandr', version : '>=1.3', required : _overlay_required)
> >  
> >  gpu_overlay_deps = [ realtime, math, cairo, pciaccess, libdrm,
> >  	libdrm_intel, lib_igt_perf ]
> >  
> >  both_x11_src = ''
> >  
> > +with_xv_backend = false
> > +with_xlib_backend = false
> > +backends_strings = []
> > +
> >  gpu_overlay_cflags = []
> > -if xv.found() and x11.found() and xext.found() and dri2proto.found()
> > +if build_xv_backend and xv.found() and x11.found() and xext.found() and dri2proto.found()
> >  	both_x11_src = 'x11/position.c'
> >  	gpu_overlay_src += [
> >  		'x11/dri2.c',
> > @@ -38,20 +53,24 @@ if xv.found() and x11.found() and xext.found() and dri2proto.found()
> >  	]
> >  	gpu_overlay_deps += [ xv, x11, xext, dri2proto ]
> >  	gpu_overlay_cflags += [ '-DHAVE_OVERLAY_XVLIB' ]
> > +	with_xv_backend = true
> > +	backends_strings += 'Xv'
> >  endif
> >  
> > -if cairo_xlib.found() and xrandr.found() and dri2proto.found()
> > +if build_xlib_backend and cairo_xlib.found() and dri2proto.found()
> >  	both_x11_src = 'x11/position.c'
> >  	gpu_overlay_src += 'x11/x11-window.c'
> >  	gpu_overlay_deps += [ cairo_xlib, dri2proto ]
> >  	gpu_overlay_cflags += [ '-DHAVE_OVERLAY_XLIB' ]
> > +	with_xlib_backend = true
> > +	backends_strings += 'X'
> >  endif
> >  
> >  gpu_overlay_src += both_x11_src
> >  
> >  gpu_overlay_src += 'kms/kms-overlay.c'
> >  
> > -leg = find_program('leg', required : false)
> > +leg = find_program('leg', required : _overlay_required)
> >  if leg.found()
> >  	leg_file = custom_target('tracepoint_format',
> >  		output: 'tracepoint_format.h',
> > @@ -62,10 +81,17 @@ else
> >  	message('WARNING: leg command not found, disabling overlay; try : apt-get install peg')
> >  endif
> >  
> > -if leg.found() and xrandr.found() and cairo.found()
> > +if _build_overlay and ['x86', 'x86_64'].contains(host_machine.cpu_family()) and libdrm_intel.found() and leg.found() and xrandr.found() and cairo.found() and (with_xlib_backend or with_xv_backend)
> >  	executable('intel-gpu-overlay', gpu_overlay_src,
> >  			include_directories : inc,
> >  			c_args : gpu_overlay_cflags,
> >  			dependencies : gpu_overlay_deps,
> >  			install : true)
> > +	build_info += 'Build overlay: Yes'
> > +	build_info += 'Overlay backends: ' + ','.join(backends_strings)
> > +else
> > +	if _overlay_required
> > +		error('Cannot build overlay due to missing dependencies')
> > +	endif
> > +	build_info += 'Build overlay: No'
> >  endif
> > diff --git a/tests/meson.build b/tests/meson.build
> > index cedb4ff1..9ec39e08 100644
> > --- a/tests/meson.build
> > +++ b/tests/meson.build
> > @@ -232,14 +232,14 @@ if libdrm_nouveau.found()
> >  	test_deps += libdrm_nouveau
> >  endif
> >  
> > -if chamelium.found()
> > +if _build_chamelium and chamelium.found()
> >  	test_progs += [
> >  		'kms_chamelium',
> >  	]
> >  	test_deps += chamelium
> >  endif
> >  
> > -if alsa.found() and gsl.found()
> > +if _build_audio and alsa.found() and gsl.found()
> >  	test_progs += [
> >  		'audio',
> >  	]
> > -- 
> > 2.14.1
> > 
> _______________________________________________
> igt-dev mailing list
> igt-dev@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/igt-dev
_______________________________________________
igt-dev mailing list
igt-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/igt-dev

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

* Re: [igt-dev] [PATCH i-g-t 2/2] meson: Add options to control optional parts
  2018-06-21 16:46     ` Lucas De Marchi
@ 2018-06-22  8:27       ` Daniel Vetter
  0 siblings, 0 replies; 16+ messages in thread
From: Daniel Vetter @ 2018-06-22  8:27 UTC (permalink / raw)
  To: Lucas De Marchi; +Cc: igt-dev, Matt Turner, Daniel Vetter

On Thu, Jun 21, 2018 at 09:46:58AM -0700, Lucas De Marchi wrote:
> On Thu, Jun 21, 2018 at 02:29:48PM +0300, Petri Latvala wrote:
> > On Thu, Jun 21, 2018 at 02:06:25PM +0300, Petri Latvala wrote:
> > > Distributions want explicit control over optional parts so they can
> > > state runtime dependencies before building. Let's restore the
> > > functionality autotools used to provide.
> > > 
> > > Where possible, the selection is done by choosing whether to build a
> > > particular item and the option name is build_$item. Example:
> > > build_overlay. Where not possible, the option name is
> > > with_$item. Example: with_valgrind.
> > 
> > Imagine this paragraph is also here, and the patch having the
> > corresponding hunk. I missed the part of Daniel's reply that pointed
> > it out:
> > 
> > 
> > Array options require a bump of required meson version to 0.44. Debian
> > stable has meson 0.37 which is already too old, stable-backports has
> > 0.45, CI uses 0.45. Mesa's meson requirement is 0.44.1, for a
> > perspective.
> 
> We can always ask people to install from pip in cases the distro package
> is too old. Given meson itself is new and is rapidly changing, I think
> this is a reasonable compromise for now. As it matures we could revisit
> this decision and be more compatible with previous versions.  Thoughts?

Agreed. Currently it's still tricky, e.g. the meson gtkdoc support fix we
need to work without slow hacks isn't even released yet. But we have a
meson version check for that.

> For reference, currently pip has meson 0.46.1.

Yeah that's the latest release.
-Daniel
> 
> Lucas De Marchi
> 
> 
> > 
> > 
> > 
> > > 
> > > Note, the old hack for not building docs when cross-compiling is
> > > gone, as doc building can be explicitly controlled now.
> > > 
> > > v2: glib not optional
> > > 
> > > Signed-off-by: Petri Latvala <petri.latvala@intel.com>
> > > Cc: Matt Turner <mattst88@gmail.com>
> > > Cc: Daniel Vetter <daniel@ffwll.ch>
> > > Cc: Eric Anholt <eric@anholt.net>
> > > Cc: Arkadiusz Hiler <arkadiusz.hiler@intel.com>
> > > ---
> > >  benchmarks/meson.build |   4 +-
> > >  man/meson.build        |  10 +++-
> > >  meson.build            | 142 ++++++++++++++++++++++++++++++++++++++++++-------
> > >  meson_options.txt      |  54 +++++++++++++++++++
> > >  overlay/meson.build    |  46 ++++++++++++----
> > >  tests/meson.build      |   4 +-
> > >  6 files changed, 224 insertions(+), 36 deletions(-)
> > > 
> > > diff --git a/benchmarks/meson.build b/benchmarks/meson.build
> > > index 27836c1d..baf1243d 100644
> > > --- a/benchmarks/meson.build
> > > +++ b/benchmarks/meson.build
> > > @@ -35,10 +35,10 @@ foreach prog : benchmark_progs
> > >  	executable(prog + '_bench', prog + '.c',
> > >  		   install : true,
> > >  		   install_dir : benchmarksdir,
> > > -		   dependencies : test_deps)
> > > +		   dependencies : igt_deps)
> > >  endforeach
> > >  
> > >  executable('gem_wsim_bench', 'gem_wsim.c',
> > >  	   install : true,
> > >  	   install_dir : benchmarksdir,
> > > -	   dependencies : test_deps + [ lib_igt_perf ])
> > > +	   dependencies : igt_deps + [ lib_igt_perf ])
> > > diff --git a/man/meson.build b/man/meson.build
> > > index 49b0686a..fa01f9dd 100644
> > > --- a/man/meson.build
> > > +++ b/man/meson.build
> > > @@ -22,10 +22,10 @@ defs_rst = configure_file(input : 'defs.rst.in',
> > >  		output : 'defs.rst',
> > >  		configuration : config)
> > >  
> > > -rst2man = find_program('rst2man', required : false)
> > > +rst2man = find_program('rst2man', required : _man_required)
> > >  rst2man_script = find_program('rst2man.sh')
> > >  
> > > -if rst2man.found()
> > > +if _build_man and rst2man.found()
> > >  	foreach manpage : manpages
> > >  		custom_target(manpage + '.1',
> > >  				build_by_default : true,
> > > @@ -36,4 +36,10 @@ if rst2man.found()
> > >  				install : true,
> > >  				install_dir : join_paths(mandir, 'man1'))
> > >  	endforeach
> > > +	build_info += 'Build man pages: Yes'
> > > +else
> > > +	if _man_required
> > > +		error('Cannot build man pages due to missing dependencies')
> > > +	endif
> > > +	build_info += 'Build man pages: No'
> > >  endif
> > > diff --git a/meson.build b/meson.build
> > > index 98216fc4..dd4679cd 100644
> > > --- a/meson.build
> > > +++ b/meson.build
> > > @@ -26,36 +26,118 @@ foreach cc_arg : cc_args
> > >    endif
> > >  endforeach
> > >  
> > > +_build_overlay = false
> > > +_overlay_required = false
> > > +_build_man = false
> > > +_man_required = false
> > > +_build_audio = false
> > > +_audio_required = false
> > > +_build_chamelium = false
> > > +_chamelium_required = false
> > > +_build_docs = false
> > > +_docs_required = false
> > > +_build_tests = false
> > > +_tests_required = false
> > > +
> > > +build_overlay = get_option('build_overlay')
> > > +overlay_backends = get_option('overlay_backends')
> > > +build_man = get_option('build_man')
> > > +with_valgrind = get_option('with_valgrind')
> > > +build_audio = get_option('build_audio')
> > > +build_chamelium = get_option('build_chamelium')
> > > +build_docs = get_option('build_docs')
> > > +build_tests = get_option('build_tests')
> > > +with_libdrm = get_option('with_libdrm')
> > > +
> > > +_build_overlay = build_overlay != 'false'
> > > +_overlay_required = build_overlay == 'true'
> > > +_build_man = build_man != 'false'
> > > +_man_required = build_man == 'true'
> > > +_build_audio = build_audio != 'false'
> > > +_audio_required = build_audio == 'true'
> > > +_build_chamelium = build_chamelium != 'false'
> > > +_chamelium_required = build_chamelium == 'true'
> > > +_build_docs = build_docs != 'false'
> > > +_docs_required = build_docs == 'true'
> > > +_build_tests = build_tests != 'false'
> > > +_tests_required = build_tests == 'true'
> > > +
> > > +build_info = []
> > > +
> > >  inc = include_directories('include/drm-uapi', 'lib', '.')
> > >  
> > >  inc_for_gtkdoc = include_directories('lib')
> > >  
> > >  config = configuration_data()
> > >  
> > > +null_dep = dependency('', required : false)
> > > +
> > > +libdrm_info = []
> > > +libdrm_intel = null_dep
> > > +libdrm_nouveau = null_dep
> > > +libdrm_amdgpu = null_dep
> > > +
> > >  libdrm_version = '>=2.4.82'
> > >  libdrm = dependency('libdrm', version : libdrm_version)
> > > -libdrm_intel = dependency('libdrm_intel', version : libdrm_version, required : false)
> > > -libdrm_nouveau = dependency('libdrm_nouveau', version : libdrm_version, required : false)
> > > -libdrm_amdgpu = dependency('libdrm_amdgpu', version : libdrm_version, required : false)
> > > +if with_libdrm.contains('auto') or with_libdrm.contains('intel')
> > > +	libdrm_intel = dependency('libdrm_intel', version : libdrm_version, required : with_libdrm.contains('intel'))
> > > +	libdrm_info += 'intel'
> > > +endif
> > > +if with_libdrm.contains('auto') or with_libdrm.contains('nouveau')
> > > +	libdrm_nouveau = dependency('libdrm_nouveau', version : libdrm_version, required : with_libdrm.contains('nouveau'))
> > > +	libdrm_info += 'nouveau'
> > > +endif
> > > +if with_libdrm.contains('auto') or with_libdrm.contains('amdgpu')
> > > +	libdrm_amdgpu = dependency('libdrm_amdgpu', version : libdrm_version, required : with_libdrm.contains('amdgpu'))
> > > +	libdrm_info += 'amdgpu'
> > > +endif
> > > +
> > > +build_info += 'With libdrm: ' + ','.join(libdrm_info)
> > >  
> > >  pciaccess = dependency('pciaccess', version : '>=0.10')
> > >  libkmod = dependency('libkmod')
> > >  libprocps = dependency('libprocps', required : true)
> > >  libunwind = dependency('libunwind', required : true)
> > >  
> > > -valgrind = dependency('valgrind', required : false)
> > > -if valgrind.found()
> > > -	config.set('HAVE_VALGRIND', 1)
> > > +valgrind = null_dep
> > > +valgrindinfo = 'No'
> > > +if with_valgrind != 'false'
> > > +	valgrind = dependency('valgrind', required : with_valgrind == 'true')
> > > +	if valgrind.found()
> > > +		config.set('HAVE_VALGRIND', 1)
> > > +		valgrindinfo = 'Yes'
> > > +	endif
> > >  endif
> > > +build_info += 'Valgrind annotations: ' + valgrindinfo
> > >  
> > >  cairo = dependency('cairo', version : '>1.12.0', required : true)
> > >  libudev = dependency('libudev', required : true)
> > >  glib = dependency('glib-2.0', required : true)
> > >  
> > > -gsl = dependency('gsl', required : false)
> > > -alsa = dependency('alsa', required : false)
> > > +gsl = null_dep
> > > +alsa = null_dep
> > > +pixman = null_dep
> > > +if _build_audio or _build_chamelium
> > > +	gsl = dependency('gsl', required : _audio_required or _chamelium_required)
> > > +endif
> > > +if _build_audio
> > > +	alsa = dependency('alsa', required : _audio_required)
> > > +endif
> > > +if _build_chamelium
> > > +	pixman = dependency('pixman-1', required : _chamelium_required)
> > > +endif
> > > +
> > > +audioinfo = 'No'
> > > +if _build_audio and alsa.found() and gsl.found()
> > > +	audioinfo = 'Yes'
> > > +else
> > > +	if _audio_required
> > > +		error('Cannot build audio test due to missing dependencies')
> > > +	endif
> > > +	_build_audio = false
> > > +endif
> > > +build_info += 'Build audio test: ' + audioinfo
> > >  
> > > -pixman = dependency('pixman-1', required : false)
> > >  xmlrpc = dependency('xmlrpc', required : false)
> > >  xmlrpc_util = dependency('xmlrpc_util', required : false)
> > >  xmlrpc_client = dependency('xmlrpc_client', required : false)
> > > @@ -73,13 +155,17 @@ if not xmlrpc.found() and xmlrpc_cmd.found()
> > >  	endif
> > >  endif
> > >  
> > > -if pixman.found() and gsl.found() and xmlrpc.found() and xmlrpc_util.found() and xmlrpc_client.found()
> > > +chamelium = null_dep
> > > +chameliuminfo = 'No'
> > > +if _build_chamelium and pixman.found() and gsl.found() and xmlrpc.found() and xmlrpc_util.found() and xmlrpc_client.found()
> > >  	chamelium = declare_dependency(dependencies : [ pixman, xmlrpc,
> > > -	  xmlrpc_util, xmlrpc_client])
> > > +							xmlrpc_util, xmlrpc_client])
> > >  	config.set('HAVE_CHAMELIUM', 1)
> > > -else
> > > -	chamelium = dependency('', required: false)
> > > +	chameliuminfo = 'Yes'
> > > +elif _chamelium_required
> > > +	error('Cannot build chamelium test due to missing dependencies')
> > >  endif
> > > +build_info += 'Build Chamelium test: ' + chameliuminfo
> > >  
> > >  pthreads = dependency('threads')
> > >  math = cc.find_library('m')
> > > @@ -130,17 +216,33 @@ mandir = get_option('mandir')
> > >  pkgconfigdir = join_paths(libdir, 'pkgconfig')
> > >  
> > >  subdir('lib')
> > > -subdir('tests')
> > > +if _build_tests
> > > +	subdir('tests')
> > > +	build_info += 'Build tests: Yes'
> > > +else
> > > +	build_info += 'Build tests: No'
> > > +endif
> > >  subdir('benchmarks')
> > >  subdir('tools')
> > >  if libdrm_intel.found()
> > >  	subdir('assembler')
> > > -	if ['x86', 'x86_64'].contains(host_machine.cpu_family())
> > > -		subdir('overlay')
> > > -	endif
> > >  endif
> > > +subdir('overlay')
> > >  subdir('man')
> > > -# has_exe_wrapper() is undefined if building natively
> > > -if not meson.is_cross_build() or not meson.has_exe_wrapper()
> > > -	subdir('docs')
> > > +
> > > +docs_info = 'No'
> > > +if _build_docs
> > > +	if _build_tests
> > > +		subdir('docs')
> > > +		docs_info = 'Yes'
> > > +	elif _docs_required
> > > +		error('Documentation requires building tests')
> > > +	endif
> > >  endif
> > > +build_info += 'Build documentation: ' + docs_info
> > > +
> > > +message('Build options')
> > > +message('=============')
> > > +foreach str : build_info
> > > +	message(str)
> > > +endforeach
> > > diff --git a/meson_options.txt b/meson_options.txt
> > > index 41be35e0..05e63463 100644
> > > --- a/meson_options.txt
> > > +++ b/meson_options.txt
> > > @@ -1,3 +1,57 @@
> > > +option('build_overlay',
> > > +       type : 'combo',
> > > +       value : 'auto',
> > > +       choices : ['auto', 'true', 'false'],
> > > +       description : 'Build overlay')
> > > +
> > > +option('overlay_backends',
> > > +       type : 'array',
> > > +       value : ['auto'],
> > > +       choices : [ 'auto', 'x', 'xv' ],
> > > +       description : 'Overlay backends to enable')
> > > +
> > > +option('build_audio',
> > > +       type : 'combo',
> > > +       value : 'auto',
> > > +       choices : ['auto', 'true', 'false'],
> > > +       description : 'Build audio test')
> > > +
> > > +option('build_chamelium',
> > > +       type : 'combo',
> > > +       value : 'auto',
> > > +       choices : ['auto', 'true', 'false'],
> > > +       description : 'Build chamelium test')
> > > +
> > > +option('with_valgrind',
> > > +       type : 'combo',
> > > +       value : 'auto',
> > > +       choices : ['auto', 'true', 'false'],
> > > +       description : 'Build with support for valgrind annotations')
> > > +
> > > +option('build_man',
> > > +       type : 'combo',
> > > +       value : 'auto',
> > > +       choices : ['auto', 'true', 'false'],
> > > +       description : 'Build man pages')
> > > +
> > > +option('build_docs',
> > > +       type : 'combo',
> > > +       value : 'auto',
> > > +       choices : ['auto', 'true', 'false'],
> > > +       description : 'Build documentation')
> > > +
> > > +option('build_tests',
> > > +       type : 'combo',
> > > +       value : 'auto',
> > > +       choices : ['auto', 'true', 'false'],
> > > +       description : 'Build tests')
> > > +
> > > +option('with_libdrm',
> > > +       type : 'array',
> > > +       value : ['auto'],
> > > +       choices : ['', 'auto', 'intel', 'nouveau', 'amdgpu'],
> > > +       description : 'libdrm libraries to be used')
> > > +
> > >  option('use_rpath',
> > >         type : 'boolean',
> > >         value : false,
> > > diff --git a/overlay/meson.build b/overlay/meson.build
> > > index 546c8377..46d2d494 100644
> > > --- a/overlay/meson.build
> > > +++ b/overlay/meson.build
> > > @@ -14,20 +14,35 @@ gpu_overlay_src = [
> > >  	'rc6.c',
> > >  ]
> > >  
> > > -xv = dependency('xv', required : false)
> > > -x11 = dependency('x11', required : false)
> > > -xext = dependency('xext', required : false)
> > > -dri2proto = dependency('dri2proto', version : '>= 2.6', required : false)
> > > -cairo_xlib = dependency('cairo-xlib', required : false)
> > > -xrandr = dependency('xrandr', version : '>=1.3', required : false)
> > > +xv_backend_required = false
> > > +xlib_backend_required = false
> > > +build_xv_backend = overlay_backends.contains('xv') or overlay_backends.contains('auto')
> > > +build_xlib_backend = overlay_backends.contains('x') or overlay_backends.contains('auto')
> > > +if _overlay_required
> > > +	xv_backend_required = overlay_backends.contains('xv')
> > > +	xlib_backend_required = overlay_backends.contains('x')
> > > +endif
> > > +
> > > +xv = dependency('xv', required : xv_backend_required)
> > > +x11 = dependency('x11', required : xv_backend_required)
> > > +xext = dependency('xext', required : xv_backend_required)
> > > +dri2proto = dependency('dri2proto',
> > > +		       version : '>= 2.6',
> > > +		       required : xv_backend_required or xlib_backend_required)
> > > +cairo_xlib = dependency('cairo-xlib', required : xlib_backend_required)
> > > +xrandr = dependency('xrandr', version : '>=1.3', required : _overlay_required)
> > >  
> > >  gpu_overlay_deps = [ realtime, math, cairo, pciaccess, libdrm,
> > >  	libdrm_intel, lib_igt_perf ]
> > >  
> > >  both_x11_src = ''
> > >  
> > > +with_xv_backend = false
> > > +with_xlib_backend = false
> > > +backends_strings = []
> > > +
> > >  gpu_overlay_cflags = []
> > > -if xv.found() and x11.found() and xext.found() and dri2proto.found()
> > > +if build_xv_backend and xv.found() and x11.found() and xext.found() and dri2proto.found()
> > >  	both_x11_src = 'x11/position.c'
> > >  	gpu_overlay_src += [
> > >  		'x11/dri2.c',
> > > @@ -38,20 +53,24 @@ if xv.found() and x11.found() and xext.found() and dri2proto.found()
> > >  	]
> > >  	gpu_overlay_deps += [ xv, x11, xext, dri2proto ]
> > >  	gpu_overlay_cflags += [ '-DHAVE_OVERLAY_XVLIB' ]
> > > +	with_xv_backend = true
> > > +	backends_strings += 'Xv'
> > >  endif
> > >  
> > > -if cairo_xlib.found() and xrandr.found() and dri2proto.found()
> > > +if build_xlib_backend and cairo_xlib.found() and dri2proto.found()
> > >  	both_x11_src = 'x11/position.c'
> > >  	gpu_overlay_src += 'x11/x11-window.c'
> > >  	gpu_overlay_deps += [ cairo_xlib, dri2proto ]
> > >  	gpu_overlay_cflags += [ '-DHAVE_OVERLAY_XLIB' ]
> > > +	with_xlib_backend = true
> > > +	backends_strings += 'X'
> > >  endif
> > >  
> > >  gpu_overlay_src += both_x11_src
> > >  
> > >  gpu_overlay_src += 'kms/kms-overlay.c'
> > >  
> > > -leg = find_program('leg', required : false)
> > > +leg = find_program('leg', required : _overlay_required)
> > >  if leg.found()
> > >  	leg_file = custom_target('tracepoint_format',
> > >  		output: 'tracepoint_format.h',
> > > @@ -62,10 +81,17 @@ else
> > >  	message('WARNING: leg command not found, disabling overlay; try : apt-get install peg')
> > >  endif
> > >  
> > > -if leg.found() and xrandr.found() and cairo.found()
> > > +if _build_overlay and ['x86', 'x86_64'].contains(host_machine.cpu_family()) and libdrm_intel.found() and leg.found() and xrandr.found() and cairo.found() and (with_xlib_backend or with_xv_backend)
> > >  	executable('intel-gpu-overlay', gpu_overlay_src,
> > >  			include_directories : inc,
> > >  			c_args : gpu_overlay_cflags,
> > >  			dependencies : gpu_overlay_deps,
> > >  			install : true)
> > > +	build_info += 'Build overlay: Yes'
> > > +	build_info += 'Overlay backends: ' + ','.join(backends_strings)
> > > +else
> > > +	if _overlay_required
> > > +		error('Cannot build overlay due to missing dependencies')
> > > +	endif
> > > +	build_info += 'Build overlay: No'
> > >  endif
> > > diff --git a/tests/meson.build b/tests/meson.build
> > > index cedb4ff1..9ec39e08 100644
> > > --- a/tests/meson.build
> > > +++ b/tests/meson.build
> > > @@ -232,14 +232,14 @@ if libdrm_nouveau.found()
> > >  	test_deps += libdrm_nouveau
> > >  endif
> > >  
> > > -if chamelium.found()
> > > +if _build_chamelium and chamelium.found()
> > >  	test_progs += [
> > >  		'kms_chamelium',
> > >  	]
> > >  	test_deps += chamelium
> > >  endif
> > >  
> > > -if alsa.found() and gsl.found()
> > > +if _build_audio and alsa.found() and gsl.found()
> > >  	test_progs += [
> > >  		'audio',
> > >  	]
> > > -- 
> > > 2.14.1
> > > 
> > _______________________________________________
> > igt-dev mailing list
> > igt-dev@lists.freedesktop.org
> > https://lists.freedesktop.org/mailman/listinfo/igt-dev

-- 
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch
_______________________________________________
igt-dev mailing list
igt-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/igt-dev

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

* [igt-dev] [PATCH i-g-t v3] meson: Add options to control optional parts
  2018-06-21 11:06 ` [igt-dev] [PATCH i-g-t 2/2] meson: Add options to control optional parts Petri Latvala
  2018-06-21 11:29   ` Petri Latvala
@ 2018-06-25  7:10   ` Arkadiusz Hiler
  2018-06-28  9:29     ` Jani Nikula
  1 sibling, 1 reply; 16+ messages in thread
From: Arkadiusz Hiler @ 2018-06-25  7:10 UTC (permalink / raw)
  To: igt-dev; +Cc: Matt Turner, Daniel Vetter

From: Petri Latvala <petri.latvala@intel.com>

Distributions want explicit control over optional parts so they can
state runtime dependencies before building. Let's restore the
functionality autotools used to provide.

Where possible, the selection is done by choosing whether to build a
particular item and the option name is build_$item. Example:
build_overlay. Where not possible, the option name is
with_$item. Example: with_valgrind.

Array options require a bump of required meson version to 0.44. Debian
stable has meson 0.37 which is already too old, stable-backports has
0.45, CI uses 0.45. Mesa's meson requirement is 0.44.1, for a
perspective.

Note, the old hack for not building docs when cross-compiling is
gone, as doc building can be explicitly controlled now.

v2: glib not optional
v3: bump meson version to 0.44

Signed-off-by: Petri Latvala <petri.latvala@intel.com>
Cc: Matt Turner <mattst88@gmail.com>
Cc: Daniel Vetter <daniel@ffwll.ch>
Cc: Eric Anholt <eric@anholt.net>
Cc: Arkadiusz Hiler <arkadiusz.hiler@intel.com>
Signed-off-by: Arkadiusz Hiler <arkadiusz.hiler@intel.com>
Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch>
---
 benchmarks/meson.build |   4 +-
 man/meson.build        |  10 +++-
 meson.build            | 144 +++++++++++++++++++++++++++++++++++++++++--------
 meson_options.txt      |  54 +++++++++++++++++++
 overlay/meson.build    |  46 ++++++++++++----
 tests/meson.build      |   4 +-
 6 files changed, 225 insertions(+), 37 deletions(-)

diff --git a/benchmarks/meson.build b/benchmarks/meson.build
index 27836c1d..baf1243d 100644
--- a/benchmarks/meson.build
+++ b/benchmarks/meson.build
@@ -35,10 +35,10 @@ foreach prog : benchmark_progs
 	executable(prog + '_bench', prog + '.c',
 		   install : true,
 		   install_dir : benchmarksdir,
-		   dependencies : test_deps)
+		   dependencies : igt_deps)
 endforeach
 
 executable('gem_wsim_bench', 'gem_wsim.c',
 	   install : true,
 	   install_dir : benchmarksdir,
-	   dependencies : test_deps + [ lib_igt_perf ])
+	   dependencies : igt_deps + [ lib_igt_perf ])
diff --git a/man/meson.build b/man/meson.build
index 49b0686a..fa01f9dd 100644
--- a/man/meson.build
+++ b/man/meson.build
@@ -22,10 +22,10 @@ defs_rst = configure_file(input : 'defs.rst.in',
 		output : 'defs.rst',
 		configuration : config)
 
-rst2man = find_program('rst2man', required : false)
+rst2man = find_program('rst2man', required : _man_required)
 rst2man_script = find_program('rst2man.sh')
 
-if rst2man.found()
+if _build_man and rst2man.found()
 	foreach manpage : manpages
 		custom_target(manpage + '.1',
 				build_by_default : true,
@@ -36,4 +36,10 @@ if rst2man.found()
 				install : true,
 				install_dir : join_paths(mandir, 'man1'))
 	endforeach
+	build_info += 'Build man pages: Yes'
+else
+	if _man_required
+		error('Cannot build man pages due to missing dependencies')
+	endif
+	build_info += 'Build man pages: No'
 endif
diff --git a/meson.build b/meson.build
index 98216fc4..4d15d623 100644
--- a/meson.build
+++ b/meson.build
@@ -5,7 +5,7 @@ project('igt-gpu-tools', 'c',
           'c_std=gnu99',
         ],
 	license : 'MIT',
-	meson_version : '>0.40.0')
+	meson_version : '>0.44.0')
 
 cc = meson.get_compiler('c')
 
@@ -26,36 +26,118 @@ foreach cc_arg : cc_args
   endif
 endforeach
 
+_build_overlay = false
+_overlay_required = false
+_build_man = false
+_man_required = false
+_build_audio = false
+_audio_required = false
+_build_chamelium = false
+_chamelium_required = false
+_build_docs = false
+_docs_required = false
+_build_tests = false
+_tests_required = false
+
+build_overlay = get_option('build_overlay')
+overlay_backends = get_option('overlay_backends')
+build_man = get_option('build_man')
+with_valgrind = get_option('with_valgrind')
+build_audio = get_option('build_audio')
+build_chamelium = get_option('build_chamelium')
+build_docs = get_option('build_docs')
+build_tests = get_option('build_tests')
+with_libdrm = get_option('with_libdrm')
+
+_build_overlay = build_overlay != 'false'
+_overlay_required = build_overlay == 'true'
+_build_man = build_man != 'false'
+_man_required = build_man == 'true'
+_build_audio = build_audio != 'false'
+_audio_required = build_audio == 'true'
+_build_chamelium = build_chamelium != 'false'
+_chamelium_required = build_chamelium == 'true'
+_build_docs = build_docs != 'false'
+_docs_required = build_docs == 'true'
+_build_tests = build_tests != 'false'
+_tests_required = build_tests == 'true'
+
+build_info = []
+
 inc = include_directories('include/drm-uapi', 'lib', '.')
 
 inc_for_gtkdoc = include_directories('lib')
 
 config = configuration_data()
 
+null_dep = dependency('', required : false)
+
+libdrm_info = []
+libdrm_intel = null_dep
+libdrm_nouveau = null_dep
+libdrm_amdgpu = null_dep
+
 libdrm_version = '>=2.4.82'
 libdrm = dependency('libdrm', version : libdrm_version)
-libdrm_intel = dependency('libdrm_intel', version : libdrm_version, required : false)
-libdrm_nouveau = dependency('libdrm_nouveau', version : libdrm_version, required : false)
-libdrm_amdgpu = dependency('libdrm_amdgpu', version : libdrm_version, required : false)
+if with_libdrm.contains('auto') or with_libdrm.contains('intel')
+	libdrm_intel = dependency('libdrm_intel', version : libdrm_version, required : with_libdrm.contains('intel'))
+	libdrm_info += 'intel'
+endif
+if with_libdrm.contains('auto') or with_libdrm.contains('nouveau')
+	libdrm_nouveau = dependency('libdrm_nouveau', version : libdrm_version, required : with_libdrm.contains('nouveau'))
+	libdrm_info += 'nouveau'
+endif
+if with_libdrm.contains('auto') or with_libdrm.contains('amdgpu')
+	libdrm_amdgpu = dependency('libdrm_amdgpu', version : libdrm_version, required : with_libdrm.contains('amdgpu'))
+	libdrm_info += 'amdgpu'
+endif
+
+build_info += 'With libdrm: ' + ','.join(libdrm_info)
 
 pciaccess = dependency('pciaccess', version : '>=0.10')
 libkmod = dependency('libkmod')
 libprocps = dependency('libprocps', required : true)
 libunwind = dependency('libunwind', required : true)
 
-valgrind = dependency('valgrind', required : false)
-if valgrind.found()
-	config.set('HAVE_VALGRIND', 1)
+valgrind = null_dep
+valgrindinfo = 'No'
+if with_valgrind != 'false'
+	valgrind = dependency('valgrind', required : with_valgrind == 'true')
+	if valgrind.found()
+		config.set('HAVE_VALGRIND', 1)
+		valgrindinfo = 'Yes'
+	endif
 endif
+build_info += 'Valgrind annotations: ' + valgrindinfo
 
 cairo = dependency('cairo', version : '>1.12.0', required : true)
 libudev = dependency('libudev', required : true)
 glib = dependency('glib-2.0', required : true)
 
-gsl = dependency('gsl', required : false)
-alsa = dependency('alsa', required : false)
+gsl = null_dep
+alsa = null_dep
+pixman = null_dep
+if _build_audio or _build_chamelium
+	gsl = dependency('gsl', required : _audio_required or _chamelium_required)
+endif
+if _build_audio
+	alsa = dependency('alsa', required : _audio_required)
+endif
+if _build_chamelium
+	pixman = dependency('pixman-1', required : _chamelium_required)
+endif
+
+audioinfo = 'No'
+if _build_audio and alsa.found() and gsl.found()
+	audioinfo = 'Yes'
+else
+	if _audio_required
+		error('Cannot build audio test due to missing dependencies')
+	endif
+	_build_audio = false
+endif
+build_info += 'Build audio test: ' + audioinfo
 
-pixman = dependency('pixman-1', required : false)
 xmlrpc = dependency('xmlrpc', required : false)
 xmlrpc_util = dependency('xmlrpc_util', required : false)
 xmlrpc_client = dependency('xmlrpc_client', required : false)
@@ -73,13 +155,17 @@ if not xmlrpc.found() and xmlrpc_cmd.found()
 	endif
 endif
 
-if pixman.found() and gsl.found() and xmlrpc.found() and xmlrpc_util.found() and xmlrpc_client.found()
+chamelium = null_dep
+chameliuminfo = 'No'
+if _build_chamelium and pixman.found() and gsl.found() and xmlrpc.found() and xmlrpc_util.found() and xmlrpc_client.found()
 	chamelium = declare_dependency(dependencies : [ pixman, xmlrpc,
-	  xmlrpc_util, xmlrpc_client])
+							xmlrpc_util, xmlrpc_client])
 	config.set('HAVE_CHAMELIUM', 1)
-else
-	chamelium = dependency('', required: false)
+	chameliuminfo = 'Yes'
+elif _chamelium_required
+	error('Cannot build chamelium test due to missing dependencies')
 endif
+build_info += 'Build Chamelium test: ' + chameliuminfo
 
 pthreads = dependency('threads')
 math = cc.find_library('m')
@@ -130,17 +216,33 @@ mandir = get_option('mandir')
 pkgconfigdir = join_paths(libdir, 'pkgconfig')
 
 subdir('lib')
-subdir('tests')
+if _build_tests
+	subdir('tests')
+	build_info += 'Build tests: Yes'
+else
+	build_info += 'Build tests: No'
+endif
 subdir('benchmarks')
 subdir('tools')
 if libdrm_intel.found()
 	subdir('assembler')
-	if ['x86', 'x86_64'].contains(host_machine.cpu_family())
-		subdir('overlay')
-	endif
 endif
+subdir('overlay')
 subdir('man')
-# has_exe_wrapper() is undefined if building natively
-if not meson.is_cross_build() or not meson.has_exe_wrapper()
-	subdir('docs')
+
+docs_info = 'No'
+if _build_docs
+	if _build_tests
+		subdir('docs')
+		docs_info = 'Yes'
+	elif _docs_required
+		error('Documentation requires building tests')
+	endif
 endif
+build_info += 'Build documentation: ' + docs_info
+
+message('Build options')
+message('=============')
+foreach str : build_info
+	message(str)
+endforeach
diff --git a/meson_options.txt b/meson_options.txt
index 41be35e0..05e63463 100644
--- a/meson_options.txt
+++ b/meson_options.txt
@@ -1,3 +1,57 @@
+option('build_overlay',
+       type : 'combo',
+       value : 'auto',
+       choices : ['auto', 'true', 'false'],
+       description : 'Build overlay')
+
+option('overlay_backends',
+       type : 'array',
+       value : ['auto'],
+       choices : [ 'auto', 'x', 'xv' ],
+       description : 'Overlay backends to enable')
+
+option('build_audio',
+       type : 'combo',
+       value : 'auto',
+       choices : ['auto', 'true', 'false'],
+       description : 'Build audio test')
+
+option('build_chamelium',
+       type : 'combo',
+       value : 'auto',
+       choices : ['auto', 'true', 'false'],
+       description : 'Build chamelium test')
+
+option('with_valgrind',
+       type : 'combo',
+       value : 'auto',
+       choices : ['auto', 'true', 'false'],
+       description : 'Build with support for valgrind annotations')
+
+option('build_man',
+       type : 'combo',
+       value : 'auto',
+       choices : ['auto', 'true', 'false'],
+       description : 'Build man pages')
+
+option('build_docs',
+       type : 'combo',
+       value : 'auto',
+       choices : ['auto', 'true', 'false'],
+       description : 'Build documentation')
+
+option('build_tests',
+       type : 'combo',
+       value : 'auto',
+       choices : ['auto', 'true', 'false'],
+       description : 'Build tests')
+
+option('with_libdrm',
+       type : 'array',
+       value : ['auto'],
+       choices : ['', 'auto', 'intel', 'nouveau', 'amdgpu'],
+       description : 'libdrm libraries to be used')
+
 option('use_rpath',
        type : 'boolean',
        value : false,
diff --git a/overlay/meson.build b/overlay/meson.build
index 546c8377..46d2d494 100644
--- a/overlay/meson.build
+++ b/overlay/meson.build
@@ -14,20 +14,35 @@ gpu_overlay_src = [
 	'rc6.c',
 ]
 
-xv = dependency('xv', required : false)
-x11 = dependency('x11', required : false)
-xext = dependency('xext', required : false)
-dri2proto = dependency('dri2proto', version : '>= 2.6', required : false)
-cairo_xlib = dependency('cairo-xlib', required : false)
-xrandr = dependency('xrandr', version : '>=1.3', required : false)
+xv_backend_required = false
+xlib_backend_required = false
+build_xv_backend = overlay_backends.contains('xv') or overlay_backends.contains('auto')
+build_xlib_backend = overlay_backends.contains('x') or overlay_backends.contains('auto')
+if _overlay_required
+	xv_backend_required = overlay_backends.contains('xv')
+	xlib_backend_required = overlay_backends.contains('x')
+endif
+
+xv = dependency('xv', required : xv_backend_required)
+x11 = dependency('x11', required : xv_backend_required)
+xext = dependency('xext', required : xv_backend_required)
+dri2proto = dependency('dri2proto',
+		       version : '>= 2.6',
+		       required : xv_backend_required or xlib_backend_required)
+cairo_xlib = dependency('cairo-xlib', required : xlib_backend_required)
+xrandr = dependency('xrandr', version : '>=1.3', required : _overlay_required)
 
 gpu_overlay_deps = [ realtime, math, cairo, pciaccess, libdrm,
 	libdrm_intel, lib_igt_perf ]
 
 both_x11_src = ''
 
+with_xv_backend = false
+with_xlib_backend = false
+backends_strings = []
+
 gpu_overlay_cflags = []
-if xv.found() and x11.found() and xext.found() and dri2proto.found()
+if build_xv_backend and xv.found() and x11.found() and xext.found() and dri2proto.found()
 	both_x11_src = 'x11/position.c'
 	gpu_overlay_src += [
 		'x11/dri2.c',
@@ -38,20 +53,24 @@ if xv.found() and x11.found() and xext.found() and dri2proto.found()
 	]
 	gpu_overlay_deps += [ xv, x11, xext, dri2proto ]
 	gpu_overlay_cflags += [ '-DHAVE_OVERLAY_XVLIB' ]
+	with_xv_backend = true
+	backends_strings += 'Xv'
 endif
 
-if cairo_xlib.found() and xrandr.found() and dri2proto.found()
+if build_xlib_backend and cairo_xlib.found() and dri2proto.found()
 	both_x11_src = 'x11/position.c'
 	gpu_overlay_src += 'x11/x11-window.c'
 	gpu_overlay_deps += [ cairo_xlib, dri2proto ]
 	gpu_overlay_cflags += [ '-DHAVE_OVERLAY_XLIB' ]
+	with_xlib_backend = true
+	backends_strings += 'X'
 endif
 
 gpu_overlay_src += both_x11_src
 
 gpu_overlay_src += 'kms/kms-overlay.c'
 
-leg = find_program('leg', required : false)
+leg = find_program('leg', required : _overlay_required)
 if leg.found()
 	leg_file = custom_target('tracepoint_format',
 		output: 'tracepoint_format.h',
@@ -62,10 +81,17 @@ else
 	message('WARNING: leg command not found, disabling overlay; try : apt-get install peg')
 endif
 
-if leg.found() and xrandr.found() and cairo.found()
+if _build_overlay and ['x86', 'x86_64'].contains(host_machine.cpu_family()) and libdrm_intel.found() and leg.found() and xrandr.found() and cairo.found() and (with_xlib_backend or with_xv_backend)
 	executable('intel-gpu-overlay', gpu_overlay_src,
 			include_directories : inc,
 			c_args : gpu_overlay_cflags,
 			dependencies : gpu_overlay_deps,
 			install : true)
+	build_info += 'Build overlay: Yes'
+	build_info += 'Overlay backends: ' + ','.join(backends_strings)
+else
+	if _overlay_required
+		error('Cannot build overlay due to missing dependencies')
+	endif
+	build_info += 'Build overlay: No'
 endif
diff --git a/tests/meson.build b/tests/meson.build
index cedb4ff1..9ec39e08 100644
--- a/tests/meson.build
+++ b/tests/meson.build
@@ -232,14 +232,14 @@ if libdrm_nouveau.found()
 	test_deps += libdrm_nouveau
 endif
 
-if chamelium.found()
+if _build_chamelium and chamelium.found()
 	test_progs += [
 		'kms_chamelium',
 	]
 	test_deps += chamelium
 endif
 
-if alsa.found() and gsl.found()
+if _build_audio and alsa.found() and gsl.found()
 	test_progs += [
 		'audio',
 	]
-- 
2.14.4

_______________________________________________
igt-dev mailing list
igt-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/igt-dev

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

* [igt-dev] ✓ Fi.CI.BAT: success for series starting with [i-g-t,1/2] Make GLib mandatory (rev2)
  2018-06-21 11:06 [igt-dev] [PATCH i-g-t 1/2] Make GLib mandatory Petri Latvala
                   ` (3 preceding siblings ...)
  2018-06-21 15:30 ` [igt-dev] ✓ Fi.CI.IGT: success for series starting with [i-g-t,1/2] " Patchwork
@ 2018-06-25  9:52 ` Patchwork
  2018-06-25 12:18 ` [igt-dev] ✓ Fi.CI.IGT: " Patchwork
  5 siblings, 0 replies; 16+ messages in thread
From: Patchwork @ 2018-06-25  9:52 UTC (permalink / raw)
  To: Arkadiusz Hiler; +Cc: igt-dev

== Series Details ==

Series: series starting with [i-g-t,1/2] Make GLib mandatory (rev2)
URL   : https://patchwork.freedesktop.org/series/45159/
State : success

== Summary ==

= CI Bug Log - changes from CI_DRM_4371 -> IGTPW_1500 =

== Summary - SUCCESS ==

  No regressions found.

  External URL: https://patchwork.freedesktop.org/api/1.0/series/45159/revisions/2/mbox/


== Changes ==

  No changes found


== Participating hosts (40 -> 35) ==

  Additional (1): fi-kbl-r 
  Missing    (6): fi-ilk-m540 fi-hsw-4200u fi-byt-j1900 fi-glk-dsi fi-bsw-cyan fi-kbl-x1275 


== Build changes ==

    * IGT: IGT_4528 -> IGTPW_1500

  CI_DRM_4371: 9094e9d97a6e13db8c1a444d08c0988adad9a002 @ git://anongit.freedesktop.org/gfx-ci/linux
  IGTPW_1500: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_1500/
  IGT_4528: 6be300d405de5974b262e8b93a445be4ac618e6a @ git://anongit.freedesktop.org/xorg/app/intel-gpu-tools

== Logs ==

For more details see: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_1500/issues.html
_______________________________________________
igt-dev mailing list
igt-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/igt-dev

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

* [igt-dev] ✓ Fi.CI.IGT: success for series starting with [i-g-t,1/2] Make GLib mandatory (rev2)
  2018-06-21 11:06 [igt-dev] [PATCH i-g-t 1/2] Make GLib mandatory Petri Latvala
                   ` (4 preceding siblings ...)
  2018-06-25  9:52 ` [igt-dev] ✓ Fi.CI.BAT: success for series starting with [i-g-t,1/2] Make GLib mandatory (rev2) Patchwork
@ 2018-06-25 12:18 ` Patchwork
  5 siblings, 0 replies; 16+ messages in thread
From: Patchwork @ 2018-06-25 12:18 UTC (permalink / raw)
  To: Arkadiusz Hiler; +Cc: igt-dev

== Series Details ==

Series: series starting with [i-g-t,1/2] Make GLib mandatory (rev2)
URL   : https://patchwork.freedesktop.org/series/45159/
State : success

== Summary ==

= CI Bug Log - changes from IGT_4528_full -> IGTPW_1500_full =

== Summary - WARNING ==

  Minor unknown changes coming with IGTPW_1500_full need to be verified
  manually.
  
  If you think the reported changes have nothing to do with the changes
  introduced in IGTPW_1500_full, please notify your bug team to allow them
  to document this new failure mode, which will reduce false positives in CI.

  External URL: https://patchwork.freedesktop.org/api/1.0/series/45159/revisions/2/mbox/

== Possible new issues ==

  Here are the unknown changes that may have been introduced in IGTPW_1500_full:

  === IGT changes ===

    ==== Warnings ====

    igt@gem_mocs_settings@mocs-rc6-ctx-render:
      shard-kbl:          PASS -> SKIP

    igt@gem_mocs_settings@mocs-rc6-vebox:
      shard-kbl:          SKIP -> PASS +2

    
== Known issues ==

  Here are the changes found in IGTPW_1500_full that come from known issues:

  === IGT changes ===

    ==== Issues hit ====

    igt@drv_selftest@live_gtt:
      shard-kbl:          PASS -> FAIL (fdo#105347)

    igt@drv_selftest@live_hugepages:
      shard-kbl:          PASS -> INCOMPLETE (fdo#103665)

    igt@gem_exec_schedule@preempt-queue-contexts-chain-vebox:
      shard-snb:          SKIP -> INCOMPLETE (fdo#105411)

    igt@gem_ppgtt@blt-vs-render-ctx0:
      shard-kbl:          PASS -> INCOMPLETE (fdo#103665, fdo#106023)

    igt@kms_flip@plain-flip-ts-check-interruptible:
      shard-glk:          PASS -> FAIL (fdo#100368)

    igt@kms_flip_tiling@flip-x-tiled:
      shard-glk:          PASS -> FAIL (fdo#104724, fdo#103822)

    igt@perf@blocking:
      shard-hsw:          PASS -> FAIL (fdo#102252)

    igt@prime_vgem@coherency-gtt:
      shard-glk:          NOTRUN -> FAIL (fdo#100587)

    
    ==== Possible fixes ====

    igt@kms_cursor_crc@cursor-64x64-suspend:
      shard-glk:          INCOMPLETE (k.org#198133, fdo#103359) -> PASS

    igt@kms_flip@plain-flip-fb-recreate-interruptible:
      shard-glk:          FAIL (fdo#100368) -> PASS

    igt@kms_pipe_crc_basic@suspend-read-crc-pipe-a:
      shard-apl:          FAIL (fdo#103375) -> PASS

    igt@kms_setmode@basic:
      shard-apl:          FAIL (fdo#99912) -> PASS
      shard-kbl:          FAIL (fdo#99912) -> PASS

    
  fdo#100368 https://bugs.freedesktop.org/show_bug.cgi?id=100368
  fdo#100587 https://bugs.freedesktop.org/show_bug.cgi?id=100587
  fdo#102252 https://bugs.freedesktop.org/show_bug.cgi?id=102252
  fdo#103359 https://bugs.freedesktop.org/show_bug.cgi?id=103359
  fdo#103375 https://bugs.freedesktop.org/show_bug.cgi?id=103375
  fdo#103665 https://bugs.freedesktop.org/show_bug.cgi?id=103665
  fdo#103822 https://bugs.freedesktop.org/show_bug.cgi?id=103822
  fdo#104724 https://bugs.freedesktop.org/show_bug.cgi?id=104724
  fdo#105347 https://bugs.freedesktop.org/show_bug.cgi?id=105347
  fdo#105411 https://bugs.freedesktop.org/show_bug.cgi?id=105411
  fdo#106023 https://bugs.freedesktop.org/show_bug.cgi?id=106023
  fdo#99912 https://bugs.freedesktop.org/show_bug.cgi?id=99912
  k.org#198133 https://bugzilla.kernel.org/show_bug.cgi?id=198133


== Participating hosts (5 -> 5) ==

  No changes in participating hosts


== Build changes ==

    * IGT: IGT_4528 -> IGTPW_1500
    * Linux: CI_DRM_4359 -> CI_DRM_4371

  CI_DRM_4359: fe0300c16bff0f9c82050e56cdbc3880f87e39bd @ git://anongit.freedesktop.org/gfx-ci/linux
  CI_DRM_4371: 9094e9d97a6e13db8c1a444d08c0988adad9a002 @ git://anongit.freedesktop.org/gfx-ci/linux
  IGTPW_1500: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_1500/
  IGT_4528: 6be300d405de5974b262e8b93a445be4ac618e6a @ git://anongit.freedesktop.org/xorg/app/intel-gpu-tools

== Logs ==

For more details see: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_1500/shards.html
_______________________________________________
igt-dev mailing list
igt-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/igt-dev

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

* Re: [igt-dev] [PATCH i-g-t v3] meson: Add options to control optional parts
  2018-06-25  7:10   ` [igt-dev] [PATCH i-g-t v3] " Arkadiusz Hiler
@ 2018-06-28  9:29     ` Jani Nikula
  2018-06-28 11:46       ` Daniel Vetter
  0 siblings, 1 reply; 16+ messages in thread
From: Jani Nikula @ 2018-06-28  9:29 UTC (permalink / raw)
  To: Arkadiusz Hiler, igt-dev; +Cc: Matt Turner, Daniel Vetter

On Mon, 25 Jun 2018, Arkadiusz Hiler <arkadiusz.hiler@intel.com> wrote:
> From: Petri Latvala <petri.latvala@intel.com>
>
> Distributions want explicit control over optional parts so they can
> state runtime dependencies before building. Let's restore the
> functionality autotools used to provide.
>
> Where possible, the selection is done by choosing whether to build a
> particular item and the option name is build_$item. Example:
> build_overlay. Where not possible, the option name is
> with_$item. Example: with_valgrind.
>
> Array options require a bump of required meson version to 0.44. Debian
> stable has meson 0.37 which is already too old, stable-backports has
> 0.45, CI uses 0.45. Mesa's meson requirement is 0.44.1, for a
> perspective.

I'm fine with the meson version requirement. However, for some reason
the meson_version : '>0.44.0' doesn't take effect for meson_options.txt:

"""
$ rm -rf build; meson build
The Meson build system
Version: 0.42.1
Source dir: /home/jani/src/intel-gpu-tools
Build dir: /home/jani/src/intel-gpu-tools/build
Build type: native build

Meson encountered an error in file meson_options.txt, line 7, column 0:
Unknown type array.
"""

I can obviously just update meson now that I figured it out, but is
there something we could do to be more helpful for the next person
hitting this?

BR,
Jani.


-- 
Jani Nikula, Intel Open Source Graphics Center
_______________________________________________
igt-dev mailing list
igt-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/igt-dev

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

* Re: [igt-dev] [PATCH i-g-t v3] meson: Add options to control optional parts
  2018-06-28  9:29     ` Jani Nikula
@ 2018-06-28 11:46       ` Daniel Vetter
  2018-06-28 12:09         ` Jani Nikula
  0 siblings, 1 reply; 16+ messages in thread
From: Daniel Vetter @ 2018-06-28 11:46 UTC (permalink / raw)
  To: Jani Nikula; +Cc: igt-dev, Matt Turner, Daniel Vetter

On Thu, Jun 28, 2018 at 12:29:27PM +0300, Jani Nikula wrote:
> On Mon, 25 Jun 2018, Arkadiusz Hiler <arkadiusz.hiler@intel.com> wrote:
> > From: Petri Latvala <petri.latvala@intel.com>
> >
> > Distributions want explicit control over optional parts so they can
> > state runtime dependencies before building. Let's restore the
> > functionality autotools used to provide.
> >
> > Where possible, the selection is done by choosing whether to build a
> > particular item and the option name is build_$item. Example:
> > build_overlay. Where not possible, the option name is
> > with_$item. Example: with_valgrind.
> >
> > Array options require a bump of required meson version to 0.44. Debian
> > stable has meson 0.37 which is already too old, stable-backports has
> > 0.45, CI uses 0.45. Mesa's meson requirement is 0.44.1, for a
> > perspective.
> 
> I'm fine with the meson version requirement. However, for some reason
> the meson_version : '>0.44.0' doesn't take effect for meson_options.txt:
> 
> """
> $ rm -rf build; meson build
> The Meson build system
> Version: 0.42.1
> Source dir: /home/jani/src/intel-gpu-tools
> Build dir: /home/jani/src/intel-gpu-tools/build
> Build type: native build
> 
> Meson encountered an error in file meson_options.txt, line 7, column 0:
> Unknown type array.
> """
> 
> I can obviously just update meson now that I figured it out, but is
> there something we could do to be more helpful for the next person
> hitting this?

Huh, in my testing with older meson it bailed out right away after
spotting the version requirement in the main meson.build file in the root
directory. No idea how you managed to get past that.

Count me baffled ...
-Daneil
-- 
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch
_______________________________________________
igt-dev mailing list
igt-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/igt-dev

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

* Re: [igt-dev] [PATCH i-g-t v3] meson: Add options to control optional parts
  2018-06-28 11:46       ` Daniel Vetter
@ 2018-06-28 12:09         ` Jani Nikula
  0 siblings, 0 replies; 16+ messages in thread
From: Jani Nikula @ 2018-06-28 12:09 UTC (permalink / raw)
  To: Daniel Vetter; +Cc: igt-dev, Matt Turner, Daniel Vetter

On Thu, 28 Jun 2018, Daniel Vetter <daniel@ffwll.ch> wrote:
> On Thu, Jun 28, 2018 at 12:29:27PM +0300, Jani Nikula wrote:
>> On Mon, 25 Jun 2018, Arkadiusz Hiler <arkadiusz.hiler@intel.com> wrote:
>> > From: Petri Latvala <petri.latvala@intel.com>
>> >
>> > Distributions want explicit control over optional parts so they can
>> > state runtime dependencies before building. Let's restore the
>> > functionality autotools used to provide.
>> >
>> > Where possible, the selection is done by choosing whether to build a
>> > particular item and the option name is build_$item. Example:
>> > build_overlay. Where not possible, the option name is
>> > with_$item. Example: with_valgrind.
>> >
>> > Array options require a bump of required meson version to 0.44. Debian
>> > stable has meson 0.37 which is already too old, stable-backports has
>> > 0.45, CI uses 0.45. Mesa's meson requirement is 0.44.1, for a
>> > perspective.
>> 
>> I'm fine with the meson version requirement. However, for some reason
>> the meson_version : '>0.44.0' doesn't take effect for meson_options.txt:
>> 
>> """
>> $ rm -rf build; meson build
>> The Meson build system
>> Version: 0.42.1
>> Source dir: /home/jani/src/intel-gpu-tools
>> Build dir: /home/jani/src/intel-gpu-tools/build
>> Build type: native build
>> 
>> Meson encountered an error in file meson_options.txt, line 7, column 0:
>> Unknown type array.
>> """
>> 
>> I can obviously just update meson now that I figured it out, but is
>> there something we could do to be more helpful for the next person
>> hitting this?
>
> Huh, in my testing with older meson it bailed out right away after
> spotting the version requirement in the main meson.build file in the root
> directory. No idea how you managed to get past that.

Maybe that requires a newer version of meson! ;)

> Count me baffled ...

Makes two of us.

BR,
Jani.


-- 
Jani Nikula, Intel Open Source Graphics Center
_______________________________________________
igt-dev mailing list
igt-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/igt-dev

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

end of thread, other threads:[~2018-06-28 12:09 UTC | newest]

Thread overview: 16+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-06-21 11:06 [igt-dev] [PATCH i-g-t 1/2] Make GLib mandatory Petri Latvala
2018-06-21 11:06 ` [igt-dev] [PATCH i-g-t 2/2] meson: Add options to control optional parts Petri Latvala
2018-06-21 11:29   ` Petri Latvala
2018-06-21 14:27     ` Daniel Vetter
2018-06-21 16:46     ` Lucas De Marchi
2018-06-22  8:27       ` Daniel Vetter
2018-06-25  7:10   ` [igt-dev] [PATCH i-g-t v3] " Arkadiusz Hiler
2018-06-28  9:29     ` Jani Nikula
2018-06-28 11:46       ` Daniel Vetter
2018-06-28 12:09         ` Jani Nikula
2018-06-21 11:32 ` [igt-dev] ✓ Fi.CI.BAT: success for series starting with [i-g-t,1/2] Make GLib mandatory Patchwork
2018-06-21 13:59 ` [igt-dev] [PATCH i-g-t 1/2] " Daniel Vetter
2018-06-21 14:00   ` Daniel Vetter
2018-06-21 15:30 ` [igt-dev] ✓ Fi.CI.IGT: success for series starting with [i-g-t,1/2] " Patchwork
2018-06-25  9:52 ` [igt-dev] ✓ Fi.CI.BAT: success for series starting with [i-g-t,1/2] Make GLib mandatory (rev2) Patchwork
2018-06-25 12:18 ` [igt-dev] ✓ Fi.CI.IGT: " Patchwork

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