qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/5] meson: mingw installation fixes & nsis conversion
@ 2020-08-25 15:04 marcandre.lureau
  2020-08-25 15:04 ` [PATCH 1/5] meson: pass confsuffix option marcandre.lureau
                   ` (5 more replies)
  0 siblings, 6 replies; 13+ messages in thread
From: marcandre.lureau @ 2020-08-25 15:04 UTC (permalink / raw)
  To: qemu-devel; +Cc: pbonzini, Marc-André Lureau, sw

From: Marc-André Lureau <marcandre.lureau@redhat.com>

Hi,

The following patches fix installation path when cross-compiling Windows
version, and move the NSIS build rule to meson.

Marc-André Lureau (5):
  meson: pass confsuffix option
  meson: use meson datadir instead of qemu_datadir
  meson: add docdir option and pass pre-prefix qemu_docdir
  meson: use meson mandir instead of qemu_mandir
  meson: add NSIS building

 Makefile                           | 56 -----------------------------
 configure                          |  2 ++
 contrib/vhost-user-gpu/meson.build |  2 +-
 docs/meson.build                   |  4 +--
 meson.build                        | 32 +++++++++++++++--
 meson_options.txt                  |  2 ++
 pc-bios/descriptors/meson.build    |  2 +-
 pc-bios/keymaps/meson.build        |  6 ++--
 pc-bios/meson.build                |  2 +-
 scripts/nsis.sh                    | 58 ++++++++++++++++++++++++++++++
 tools/virtiofsd/meson.build        |  2 +-
 trace/meson.build                  |  2 +-
 12 files changed, 101 insertions(+), 69 deletions(-)
 create mode 100755 scripts/nsis.sh

-- 
2.26.2




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

* [PATCH 1/5] meson: pass confsuffix option
  2020-08-25 15:04 [PATCH 0/5] meson: mingw installation fixes & nsis conversion marcandre.lureau
@ 2020-08-25 15:04 ` marcandre.lureau
  2020-08-25 15:04 ` [PATCH 2/5] meson: use meson datadir instead of qemu_datadir marcandre.lureau
                   ` (4 subsequent siblings)
  5 siblings, 0 replies; 13+ messages in thread
From: marcandre.lureau @ 2020-08-25 15:04 UTC (permalink / raw)
  To: qemu-devel; +Cc: pbonzini, Marc-André Lureau, sw

From: Marc-André Lureau <marcandre.lureau@redhat.com>

The following patches will make use of it to fix installation paths.

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
---
 configure         | 1 +
 meson_options.txt | 1 +
 2 files changed, 2 insertions(+)

diff --git a/configure b/configure
index b1e11397a8..e19e2de2f0 100755
--- a/configure
+++ b/configure
@@ -8222,6 +8222,7 @@ NINJA=$PWD/ninjatool $meson setup \
         --mandir "${pre_prefix}$mandir" \
         --sysconfdir "${pre_prefix}$sysconfdir" \
         --localstatedir "${pre_prefix}$local_statedir" \
+        -Dconfsuffix="$confsuffix" \
         -Doptimization=$(if test "$debug" = yes; then echo 0; else echo 2; fi) \
         -Ddebug=$(if test "$debug_info" = yes; then echo true; else echo false; fi) \
         -Dwerror=$(if test "$werror" = yes; then echo true; else echo false; fi) \
diff --git a/meson_options.txt b/meson_options.txt
index c55f9cd94c..7bb2c0fca9 100644
--- a/meson_options.txt
+++ b/meson_options.txt
@@ -1,3 +1,4 @@
+option('confsuffix', type : 'string', value: 'qemu')
 option('gettext', type : 'boolean', value : true)
 option('sdl', type : 'feature', value : 'auto')
 option('sdl_image', type : 'feature', value : 'auto')
-- 
2.26.2



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

* [PATCH 2/5] meson: use meson datadir instead of qemu_datadir
  2020-08-25 15:04 [PATCH 0/5] meson: mingw installation fixes & nsis conversion marcandre.lureau
  2020-08-25 15:04 ` [PATCH 1/5] meson: pass confsuffix option marcandre.lureau
@ 2020-08-25 15:04 ` marcandre.lureau
  2020-08-25 15:04 ` [PATCH 3/5] meson: add docdir option and pass pre-prefix qemu_docdir marcandre.lureau
                   ` (3 subsequent siblings)
  5 siblings, 0 replies; 13+ messages in thread
From: marcandre.lureau @ 2020-08-25 15:04 UTC (permalink / raw)
  To: qemu-devel; +Cc: pbonzini, Marc-André Lureau, sw

From: Marc-André Lureau <marcandre.lureau@redhat.com>

When cross-compiling, by default qemu_datadir is 'c:\Program
Files\QEMU', which is not recognized as being an absolute path, and
meson will end up adding the prefix again.

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
---
 contrib/vhost-user-gpu/meson.build | 2 +-
 meson.build                        | 3 ++-
 pc-bios/descriptors/meson.build    | 2 +-
 pc-bios/keymaps/meson.build        | 6 +++---
 pc-bios/meson.build                | 2 +-
 tools/virtiofsd/meson.build        | 2 +-
 trace/meson.build                  | 2 +-
 7 files changed, 10 insertions(+), 9 deletions(-)

diff --git a/contrib/vhost-user-gpu/meson.build b/contrib/vhost-user-gpu/meson.build
index 6c1459f54a..8df4c13bc5 100644
--- a/contrib/vhost-user-gpu/meson.build
+++ b/contrib/vhost-user-gpu/meson.build
@@ -9,5 +9,5 @@ if 'CONFIG_TOOLS' in config_host and 'CONFIG_VIRGL' in config_host \
   configure_file(input: '50-qemu-gpu.json.in',
                  output: '50-qemu-gpu.json',
                  configuration: config_host,
-                 install_dir: config_host['qemu_datadir'] / 'vhost-user')
+                 install_dir: qemu_datadir / 'vhost-user')
 endif
diff --git a/meson.build b/meson.build
index f0fe5f8799..20f20a7bfc 100644
--- a/meson.build
+++ b/meson.build
@@ -17,6 +17,7 @@ config_all_disas = keyval.load(meson.current_build_dir() / 'config-all-disas.mak
 enable_modules = 'CONFIG_MODULES' in config_host
 enable_static = 'CONFIG_STATIC' in config_host
 build_docs = 'BUILD_DOCS' in config_host
+qemu_datadir = get_option('datadir') + get_option('confsuffix')
 config_host_data = configuration_data()
 genh = []
 
@@ -1039,7 +1040,7 @@ foreach target : target_dirs
                       output: exe_name + stp['ext'],
                       capture: true,
                       install: stp['install'],
-                      install_dir: config_host['qemu_datadir'] / '../systemtap/tapset',
+                      install_dir: qemu_datadir / '../systemtap/tapset',
                       command: [
                         tracetool, '--group=all', '--format=' + stp['fmt'],
                         '--binary=' + stp['bin'],
diff --git a/pc-bios/descriptors/meson.build b/pc-bios/descriptors/meson.build
index 7c715bace8..3798d32372 100644
--- a/pc-bios/descriptors/meson.build
+++ b/pc-bios/descriptors/meson.build
@@ -10,5 +10,5 @@ foreach f: [
                  output: f,
                  configuration: {'DATADIR': config_host['qemu_datadir']},
                  install: install_blobs,
-                 install_dir: config_host['qemu_datadir'] / 'firmware')
+                 install_dir: qemu_datadir / 'firmware')
 endforeach
diff --git a/pc-bios/keymaps/meson.build b/pc-bios/keymaps/meson.build
index b737c82230..bbac83ece3 100644
--- a/pc-bios/keymaps/meson.build
+++ b/pc-bios/keymaps/meson.build
@@ -44,13 +44,13 @@ foreach km, args: keymaps
                      build_by_default: true,
                      output: km,
                      command: [native_qemu_keymap, '-f', '@OUTPUT@', args.split()],
-                     install_dir: config_host['qemu_datadir'] / 'keymaps')
+                     install_dir: qemu_datadir / 'keymaps')
 endforeach
 if t.length() > 0
   alias_target('update-keymaps', t)
 else
   # install from the source tree
-  install_data(keymaps.keys(), install_dir: config_host['qemu_datadir'] / 'keymaps')
+  install_data(keymaps.keys(), install_dir: qemu_datadir / 'keymaps')
 endif
 
-install_data(['sl', 'sv'], install_dir: config_host['qemu_datadir'] / 'keymaps')
+install_data(['sl', 'sv'], install_dir: qemu_datadir / 'keymaps')
diff --git a/pc-bios/meson.build b/pc-bios/meson.build
index b6389f5148..c11e52ba26 100644
--- a/pc-bios/meson.build
+++ b/pc-bios/meson.build
@@ -19,7 +19,7 @@ if 'DECOMPRESS_EDK2_BLOBS' in config_host
                   input: '@0@.bz2'.format(f),
                   capture: true,
                   install: install_blobs,
-                  install_dir: config_host['qemu_datadir'],
+                  install_dir: qemu_datadir,
                   command: [ bzip2, '-dc', '@INPUT0@' ])
   endforeach
 endif
diff --git a/tools/virtiofsd/meson.build b/tools/virtiofsd/meson.build
index d1e23c5760..50022ed89e 100644
--- a/tools/virtiofsd/meson.build
+++ b/tools/virtiofsd/meson.build
@@ -16,4 +16,4 @@ executable('virtiofsd', files(
 configure_file(input: '50-qemu-virtiofsd.json.in',
                output: '50-qemu-virtiofsd.json',
                configuration: config_host,
-               install_dir: config_host['qemu_datadir'] / 'vhost-user')
+               install_dir: qemu_datadir / 'vhost-user')
diff --git a/trace/meson.build b/trace/meson.build
index 56e870848e..5f0bf11cb5 100644
--- a/trace/meson.build
+++ b/trace/meson.build
@@ -55,7 +55,7 @@ trace_events_all = custom_target('trace-events-all',
                                  command: [ 'cat', '@INPUT@' ],
                                  capture: true,
                                  install: true,
-                                 install_dir: config_host['qemu_datadir'])
+                                 install_dir: qemu_datadir)
 
 foreach d : [
   ['generated-tcg-tracers.h', 'tcg-h'],
-- 
2.26.2



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

* [PATCH 3/5] meson: add docdir option and pass pre-prefix qemu_docdir
  2020-08-25 15:04 [PATCH 0/5] meson: mingw installation fixes & nsis conversion marcandre.lureau
  2020-08-25 15:04 ` [PATCH 1/5] meson: pass confsuffix option marcandre.lureau
  2020-08-25 15:04 ` [PATCH 2/5] meson: use meson datadir instead of qemu_datadir marcandre.lureau
@ 2020-08-25 15:04 ` marcandre.lureau
  2020-08-25 15:04 ` [PATCH 4/5] meson: use meson mandir instead of qemu_mandir marcandre.lureau
                   ` (2 subsequent siblings)
  5 siblings, 0 replies; 13+ messages in thread
From: marcandre.lureau @ 2020-08-25 15:04 UTC (permalink / raw)
  To: qemu-devel; +Cc: pbonzini, Marc-André Lureau, sw

From: Marc-André Lureau <marcandre.lureau@redhat.com>

When cross-compiling, by default qemu_docdir is 'c:\Program Files\QEMU\'
which is not recognized as being an absolute path, and meson will end up
adding the prefix again.

Add an option to pass docdir location to meson, pre-prefixed like we do
with other directories and use that instead of config_host['qemu_docdir'].

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
---
 configure         | 1 +
 docs/meson.build  | 4 ++--
 meson.build       | 3 ++-
 meson_options.txt | 1 +
 4 files changed, 6 insertions(+), 3 deletions(-)

diff --git a/configure b/configure
index e19e2de2f0..e644841299 100755
--- a/configure
+++ b/configure
@@ -8223,6 +8223,7 @@ NINJA=$PWD/ninjatool $meson setup \
         --sysconfdir "${pre_prefix}$sysconfdir" \
         --localstatedir "${pre_prefix}$local_statedir" \
         -Dconfsuffix="$confsuffix" \
+        -Ddocdir="${pre_prefix}$qemu_docdir" \
         -Doptimization=$(if test "$debug" = yes; then echo 0; else echo 2; fi) \
         -Ddebug=$(if test "$debug_info" = yes; then echo true; else echo false; fi) \
         -Dwerror=$(if test "$werror" = yes; then echo true; else echo false; fi) \
diff --git a/docs/meson.build b/docs/meson.build
index 8b059a8e39..e27f4632dc 100644
--- a/docs/meson.build
+++ b/docs/meson.build
@@ -10,7 +10,7 @@ if build_docs
   configure_file(output: 'index.html',
                  input: files('index.html.in'),
                  configuration: {'VERSION': meson.project_version()},
-                 install_dir: config_host['qemu_docdir'])
+                 install_dir: get_option('docdir'))
   manuals = [ 'devel', 'interop', 'tools', 'specs', 'system', 'user' ]
   man_pages = {
     'interop' : {
@@ -48,7 +48,7 @@ if build_docs
                           input_dir, output_dir])
     sphinxdocs += this_manual
     if build_docs and manual != 'devel'
-      install_subdir(output_dir, install_dir: config_host['qemu_docdir'])
+      install_subdir(output_dir, install_dir: get_option('docdir'))
     endif
 
     these_man_pages = []
diff --git a/meson.build b/meson.build
index 20f20a7bfc..33281cecc3 100644
--- a/meson.build
+++ b/meson.build
@@ -1170,7 +1170,7 @@ if build_docs
                       input: input,
                       output: output,
                       install: true,
-                      install_dir: config_host['qemu_docdir'] / 'interop',
+                      install_dir: get_option('docdir') / 'interop',
                       command: cmd + args)
       endforeach
       alias_target(ext, t)
@@ -1233,6 +1233,7 @@ if targetos != 'windows'
 else
   summary_info += {'local state directory': 'queried at runtime'}
 endif
+summary_info += {'Doc directory':     get_option('docdir')}
 summary_info += {'Build directory':   meson.current_build_dir()}
 summary_info += {'Source path':       meson.current_source_dir()}
 summary_info += {'GIT binary':        config_host['GIT']}
diff --git a/meson_options.txt b/meson_options.txt
index 7bb2c0fca9..fb9312fddd 100644
--- a/meson_options.txt
+++ b/meson_options.txt
@@ -1,4 +1,5 @@
 option('confsuffix', type : 'string', value: 'qemu')
+option('docdir', type : 'string', value : 'doc/qemu')
 option('gettext', type : 'boolean', value : true)
 option('sdl', type : 'feature', value : 'auto')
 option('sdl_image', type : 'feature', value : 'auto')
-- 
2.26.2



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

* [PATCH 4/5] meson: use meson mandir instead of qemu_mandir
  2020-08-25 15:04 [PATCH 0/5] meson: mingw installation fixes & nsis conversion marcandre.lureau
                   ` (2 preceding siblings ...)
  2020-08-25 15:04 ` [PATCH 3/5] meson: add docdir option and pass pre-prefix qemu_docdir marcandre.lureau
@ 2020-08-25 15:04 ` marcandre.lureau
  2020-08-25 15:04 ` [PATCH 5/5] meson: add NSIS building marcandre.lureau
  2020-08-25 16:38 ` [PATCH 0/5] meson: mingw installation fixes & nsis conversion Paolo Bonzini
  5 siblings, 0 replies; 13+ messages in thread
From: marcandre.lureau @ 2020-08-25 15:04 UTC (permalink / raw)
  To: qemu-devel; +Cc: pbonzini, Marc-André Lureau, sw

From: Marc-André Lureau <marcandre.lureau@redhat.com>

When cross-compiling, by default qemu_mandir is 'c:\Program
Files\QEMU', which is not recognized as being an absolute path, and
meson will end up adding the prefix again.

Use the pre-prefixed meson mandir option instead.

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
---
 meson.build | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/meson.build b/meson.build
index 33281cecc3..0720a7d684 100644
--- a/meson.build
+++ b/meson.build
@@ -1210,7 +1210,7 @@ if build_docs
                           output: man,
                           capture: true,
                           install: true,
-                          install_dir: config_host['mandir'] / 'man7',
+                          install_dir: get_option('mandir') / 'man7',
                           command: [pod2man, '--utf8', '--section=7', '--center=" "',
                                     '--release=" "', '@INPUT@'])
     endforeach
-- 
2.26.2



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

* [PATCH 5/5] meson: add NSIS building
  2020-08-25 15:04 [PATCH 0/5] meson: mingw installation fixes & nsis conversion marcandre.lureau
                   ` (3 preceding siblings ...)
  2020-08-25 15:04 ` [PATCH 4/5] meson: use meson mandir instead of qemu_mandir marcandre.lureau
@ 2020-08-25 15:04 ` marcandre.lureau
  2020-08-25 15:11   ` Daniel P. Berrangé
  2020-08-25 16:11   ` Peter Maydell
  2020-08-25 16:38 ` [PATCH 0/5] meson: mingw installation fixes & nsis conversion Paolo Bonzini
  5 siblings, 2 replies; 13+ messages in thread
From: marcandre.lureau @ 2020-08-25 15:04 UTC (permalink / raw)
  To: qemu-devel; +Cc: pbonzini, Marc-André Lureau, sw

From: Marc-André Lureau <marcandre.lureau@redhat.com>

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
---
 Makefile        | 56 -----------------------------------------------
 meson.build     | 24 ++++++++++++++++++++
 scripts/nsis.sh | 58 +++++++++++++++++++++++++++++++++++++++++++++++++
 3 files changed, 82 insertions(+), 56 deletions(-)
 create mode 100755 scripts/nsis.sh

diff --git a/Makefile b/Makefile
index 81794d5c34..3ebd6929b4 100644
--- a/Makefile
+++ b/Makefile
@@ -294,62 +294,6 @@ endif
 		"$(DESTDIR)$(qemu_desktopdir)/qemu.desktop"
 	$(INSTALL_DIR) "$(DESTDIR)$(qemu_datadir)/keymaps"
 
-ifdef CONFIG_WIN32
-
-INSTALLER = qemu-setup-$(VERSION)$(EXESUF)
-
-nsisflags = -V2 -NOCD
-
-ifneq ($(wildcard $(SRC_PATH)/dll),)
-ifeq ($(ARCH),x86_64)
-# 64 bit executables
-DLL_PATH = $(SRC_PATH)/dll/w64
-nsisflags += -DW64
-else
-# 32 bit executables
-DLL_PATH = $(SRC_PATH)/dll/w32
-endif
-endif
-
-.PHONY: installer
-installer: $(INSTALLER)
-
-INSTDIR=/tmp/qemu-nsis
-
-$(INSTALLER): $(SRC_PATH)/qemu.nsi
-	$(MAKE) install DESTDIR=${INSTDIR}
-ifdef SIGNCODE
-	(cd ${INSTDIR}/${bindir}; \
-         for i in *.exe; do \
-           $(SIGNCODE) $${i}; \
-         done \
-        )
-endif # SIGNCODE
-	(cd ${INSTDIR}/${bindir}; \
-         for i in qemu-system-*.exe; do \
-           arch=$${i%.exe}; \
-           arch=$${arch#qemu-system-}; \
-           echo Section \"$$arch\" Section_$$arch; \
-           echo SetOutPath \"\$$INSTDIR\"; \
-           echo File \"\$${BINDIR}\\$$i\"; \
-           echo SectionEnd; \
-         done \
-        ) >${INSTDIR}/${bindir}/system-emulations.nsh
-	makensis $(nsisflags) \
-                $(if $(BUILD_DOCS),-DCONFIG_DOCUMENTATION="y") \
-                $(if $(CONFIG_GTK),-DCONFIG_GTK="y") \
-                -DBINDIR="${INSTDIR}/${bindir}" \
-                $(if $(DLL_PATH),-DDLLDIR="$(DLL_PATH)") \
-                -DSRCDIR="$(SRC_PATH)" \
-                -DOUTFILE="$(INSTALLER)" \
-                -DDISPLAYVERSION="$(VERSION)" \
-                $(SRC_PATH)/qemu.nsi
-	rm -r ${INSTDIR}
-ifdef SIGNCODE
-	$(SIGNCODE) $(INSTALLER)
-endif # SIGNCODE
-endif # CONFIG_WIN
-
 # Add a dependency on the generated files, so that they are always
 # rebuilt before other object files
 ifneq ($(wildcard config-host.mak),)
diff --git a/meson.build b/meson.build
index 0720a7d684..4ee8ef1e9d 100644
--- a/meson.build
+++ b/meson.build
@@ -1217,6 +1217,30 @@ if build_docs
   endif
 endif
 
+if host_machine.system() == 'windows'
+  nsis_cmd = [
+    find_program('scripts/nsis.sh'),
+    '@OUTPUT@',
+    get_option('prefix'),
+    meson.current_source_dir(),
+    host_machine.cpu_family(),
+    '-DDISPLAYVERSION=' + meson.project_version(),
+  ]
+  if build_docs
+    nsis_cmd += '-DCONFIG_DOCUMENTATION=y'
+  endif
+  if 'CONFIG_GTK' in config_host
+    nsis_cmd += '-DCONFIG_GTK=y'
+  endif
+
+  nsis = custom_target('nsis',
+                       output: 'qemu-setup-' + meson.project_version() + '.exe',
+                       input: files('qemu.nsi'),
+                       build_always_stale: true,
+                       command: nsis_cmd + ['@INPUT@'])
+  alias_target('installer', nsis)
+endif
+
 summary_info = {}
 summary_info += {'Install prefix':    config_host['prefix']}
 summary_info += {'BIOS directory':    config_host['qemu_datadir']}
diff --git a/scripts/nsis.sh b/scripts/nsis.sh
new file mode 100755
index 0000000000..d7d8b39b04
--- /dev/null
+++ b/scripts/nsis.sh
@@ -0,0 +1,58 @@
+#!/bin/bash -e
+
+OUTFILE="$1"
+shift
+PREFIX="$1"
+shift
+SRCDIR="$1"
+shift
+CPU="$1"
+shift
+
+DESTDIR=$(mktemp -d)
+trap 'rm -rf $DESTDIR' EXIT
+make DESTDIR="$DESTDIR/" install
+
+do_signcode() {
+    if [ -z "$SIGNCODE" ]; then
+        return
+    fi
+    "$SIGNCODE" "$@"
+}
+
+shopt -s nullglob
+
+(
+    cd "$DESTDIR$PREFIX"
+    for i in qemu-system-*.exe; do
+        arch=${i%.exe}
+        arch=${arch#qemu-system-}
+        echo Section \""$arch"\" "Section_$arch"
+        echo SetOutPath \"\$INSTDIR\"
+        echo File \"\${BINDIR}\\$i\"
+        echo SectionEnd
+    done
+) > "$DESTDIR$PREFIX/system-emulations.nsh"
+
+(
+    cd "$DESTDIR$PREFIX"
+    for i in *.exe; do
+        do_signcode "$i"
+    done
+)
+
+if [ "$CPU" = "x86_64" ]; then
+    CPUARG="-DW64"
+    DLLDIR="w64"
+else
+    DLLDIR="w32"
+fi
+
+if [ -d "$SRCDIR/dll" ]; then
+   DLLARG="-DDLLDIR=$SRCDIR/dll/$DLLDIR"
+fi
+
+makensis -V2 -NOCD -DSRCDIR="$SRCDIR" -DBINDIR="$DESTDIR$PREFIX" \
+         $CPUARG $DLLARG -DOUTFILE="$OUTFILE" "$@"
+
+do_signcode "$OUTFILE"
-- 
2.26.2



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

* Re: [PATCH 5/5] meson: add NSIS building
  2020-08-25 15:04 ` [PATCH 5/5] meson: add NSIS building marcandre.lureau
@ 2020-08-25 15:11   ` Daniel P. Berrangé
  2020-08-25 16:03     ` Peter Maydell
  2020-08-25 16:11   ` Peter Maydell
  1 sibling, 1 reply; 13+ messages in thread
From: Daniel P. Berrangé @ 2020-08-25 15:11 UTC (permalink / raw)
  To: marcandre.lureau; +Cc: pbonzini, qemu-devel, sw

On Tue, Aug 25, 2020 at 07:04:09PM +0400, marcandre.lureau@redhat.com wrote:
> From: Marc-André Lureau <marcandre.lureau@redhat.com>
> 
> Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
> ---
>  Makefile        | 56 -----------------------------------------------
>  meson.build     | 24 ++++++++++++++++++++
>  scripts/nsis.sh | 58 +++++++++++++++++++++++++++++++++++++++++++++++++
>  3 files changed, 82 insertions(+), 56 deletions(-)
>  create mode 100755 scripts/nsis.sh

I feel like one of the bug improvements of Meson over a traditional
configure+make type approach is that we get much improved platform
portability by default in the build system, largely for free from
Meson and in turn Python.

With this in mind, I think that as a general goal, we should strive
to eliminate any and all use of shell in the build system, standardizing
on Python for any helper programs we need to run from Meson.

This is a verbose way of saying I think you should create a
nsis.py, not nsis.sh, to avoid the inherant portability problems of
shell that hit us over and over and over again.


Regards,
Daniel
-- 
|: https://berrange.com      -o-    https://www.flickr.com/photos/dberrange :|
|: https://libvirt.org         -o-            https://fstop138.berrange.com :|
|: https://entangle-photo.org    -o-    https://www.instagram.com/dberrange :|



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

* Re: [PATCH 5/5] meson: add NSIS building
  2020-08-25 15:11   ` Daniel P. Berrangé
@ 2020-08-25 16:03     ` Peter Maydell
  2020-08-25 16:07       ` Daniel P. Berrangé
  0 siblings, 1 reply; 13+ messages in thread
From: Peter Maydell @ 2020-08-25 16:03 UTC (permalink / raw)
  To: Daniel P. Berrangé
  Cc: Marc-André Lureau, Stefan Weil, QEMU Developers, Paolo Bonzini

On Tue, 25 Aug 2020 at 16:14, Daniel P. Berrangé <berrange@redhat.com> wrote:
> This is a verbose way of saying I think you should create a
> nsis.py, not nsis.sh, to avoid the inherant portability problems of
> shell that hit us over and over and over again.

Does it have to be a separate script, or can we just write inline
Python in the meson file? The main reason the current code is
written in shell is because that's what you need to write it in
so you can write it inline in a Makefile, and because half of
it is "invoke this other command ($(SIGNCODE), makensis, etc)",
which is what build systems are good at.

thanks
-- PMM


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

* Re: [PATCH 5/5] meson: add NSIS building
  2020-08-25 16:03     ` Peter Maydell
@ 2020-08-25 16:07       ` Daniel P. Berrangé
  0 siblings, 0 replies; 13+ messages in thread
From: Daniel P. Berrangé @ 2020-08-25 16:07 UTC (permalink / raw)
  To: Peter Maydell
  Cc: Marc-André Lureau, Paolo Bonzini, QEMU Developers, Stefan Weil

On Tue, Aug 25, 2020 at 05:03:41PM +0100, Peter Maydell wrote:
> On Tue, 25 Aug 2020 at 16:14, Daniel P. Berrangé <berrange@redhat.com> wrote:
> > This is a verbose way of saying I think you should create a
> > nsis.py, not nsis.sh, to avoid the inherant portability problems of
> > shell that hit us over and over and over again.
> 
> Does it have to be a separate script, or can we just write inline
> Python in the meson file? The main reason the current code is
> written in shell is because that's what you need to write it in
> so you can write it inline in a Makefile, and because half of
> it is "invoke this other command ($(SIGNCODE), makensis, etc)",
> which is what build systems are good at.

Meson just wants to have a command path + list of arguments.

So if you want to have the python code inline you can do that by passing
it as an arg by telling meson to run "python -e <codeblob>".

I think that's only sensible for one-liner scripts though. Otherwise it
is nicer to have a separate script that you can invoke directly for
testing / debugging purposes separately from meson.

Regards,
Daniel
-- 
|: https://berrange.com      -o-    https://www.flickr.com/photos/dberrange :|
|: https://libvirt.org         -o-            https://fstop138.berrange.com :|
|: https://entangle-photo.org    -o-    https://www.instagram.com/dberrange :|



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

* Re: [PATCH 5/5] meson: add NSIS building
  2020-08-25 15:04 ` [PATCH 5/5] meson: add NSIS building marcandre.lureau
  2020-08-25 15:11   ` Daniel P. Berrangé
@ 2020-08-25 16:11   ` Peter Maydell
  1 sibling, 0 replies; 13+ messages in thread
From: Peter Maydell @ 2020-08-25 16:11 UTC (permalink / raw)
  To: Marc-André Lureau; +Cc: Paolo Bonzini, QEMU Developers, Stefan Weil

On Tue, 25 Aug 2020 at 16:09, <marcandre.lureau@redhat.com> wrote:
> diff --git a/scripts/nsis.sh b/scripts/nsis.sh
> new file mode 100755
> index 0000000000..d7d8b39b04
> --- /dev/null
> +++ b/scripts/nsis.sh
> @@ -0,0 +1,58 @@
> +#!/bin/bash -e
> +

Copyright and license header comment for all new files, please.

thanks
-- PMM


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

* Re: [PATCH 0/5] meson: mingw installation fixes & nsis conversion
  2020-08-25 15:04 [PATCH 0/5] meson: mingw installation fixes & nsis conversion marcandre.lureau
                   ` (4 preceding siblings ...)
  2020-08-25 15:04 ` [PATCH 5/5] meson: add NSIS building marcandre.lureau
@ 2020-08-25 16:38 ` Paolo Bonzini
  2020-08-25 16:49   ` Marc-André Lureau
  5 siblings, 1 reply; 13+ messages in thread
From: Paolo Bonzini @ 2020-08-25 16:38 UTC (permalink / raw)
  To: Marc-Andre Lureau; +Cc: sw, qemu-devel

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

Whenever we fix these bugs I would rather avoid adding duplicates between
options and config-host.mak, so that we can sooner or later get rid of
config-host.mak.

For the same reason, I think all options should have a sensible default so
that in the end it will be possible to do "meson setup". Do you think it's
possible to extend the series in this direction?

Paolo

Il mar 25 ago 2020, 17:04 <marcandre.lureau@redhat.com> ha scritto:

> From: Marc-André Lureau <marcandre.lureau@redhat.com>
>
> Hi,
>
> The following patches fix installation path when cross-compiling Windows
> version, and move the NSIS build rule to meson.
>
> Marc-André Lureau (5):
>   meson: pass confsuffix option
>   meson: use meson datadir instead of qemu_datadir
>   meson: add docdir option and pass pre-prefix qemu_docdir
>   meson: use meson mandir instead of qemu_mandir
>   meson: add NSIS building
>
>  Makefile                           | 56 -----------------------------
>  configure                          |  2 ++
>  contrib/vhost-user-gpu/meson.build |  2 +-
>  docs/meson.build                   |  4 +--
>  meson.build                        | 32 +++++++++++++++--
>  meson_options.txt                  |  2 ++
>  pc-bios/descriptors/meson.build    |  2 +-
>  pc-bios/keymaps/meson.build        |  6 ++--
>  pc-bios/meson.build                |  2 +-
>  scripts/nsis.sh                    | 58 ++++++++++++++++++++++++++++++
>  tools/virtiofsd/meson.build        |  2 +-
>  trace/meson.build                  |  2 +-
>  12 files changed, 101 insertions(+), 69 deletions(-)
>  create mode 100755 scripts/nsis.sh
>
> --
> 2.26.2
>
>
>

[-- Attachment #2: Type: text/html, Size: 2366 bytes --]

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

* Re: [PATCH 0/5] meson: mingw installation fixes & nsis conversion
  2020-08-25 16:38 ` [PATCH 0/5] meson: mingw installation fixes & nsis conversion Paolo Bonzini
@ 2020-08-25 16:49   ` Marc-André Lureau
  2020-08-25 18:14     ` Paolo Bonzini
  0 siblings, 1 reply; 13+ messages in thread
From: Marc-André Lureau @ 2020-08-25 16:49 UTC (permalink / raw)
  To: Paolo Bonzini; +Cc: sw, qemu-devel

Hi

On Tue, Aug 25, 2020 at 8:38 PM Paolo Bonzini <pbonzini@redhat.com> wrote:
>
> Whenever we fix these bugs I would rather avoid adding duplicates between options and config-host.mak, so that we can sooner or later get rid of config-host.mak.

This is not adding things to config-host.mak.

> For the same reason, I think all options should have a sensible default so that in the end it will be possible to do "meson setup". Do you think it's possible to extend the series in this direction?

The options I added also have default values.

I think trying to remove (or just move) variables would be a separate
goal from this series. It's already not completely trivial to get the
conversion working without regression, as you probably know :) better
not to mix goals imho.

>
> Paolo
>
> Il mar 25 ago 2020, 17:04 <marcandre.lureau@redhat.com> ha scritto:
>>
>> From: Marc-André Lureau <marcandre.lureau@redhat.com>
>>
>> Hi,
>>
>> The following patches fix installation path when cross-compiling Windows
>> version, and move the NSIS build rule to meson.
>>
>> Marc-André Lureau (5):
>>   meson: pass confsuffix option
>>   meson: use meson datadir instead of qemu_datadir
>>   meson: add docdir option and pass pre-prefix qemu_docdir
>>   meson: use meson mandir instead of qemu_mandir
>>   meson: add NSIS building
>>
>>  Makefile                           | 56 -----------------------------
>>  configure                          |  2 ++
>>  contrib/vhost-user-gpu/meson.build |  2 +-
>>  docs/meson.build                   |  4 +--
>>  meson.build                        | 32 +++++++++++++++--
>>  meson_options.txt                  |  2 ++
>>  pc-bios/descriptors/meson.build    |  2 +-
>>  pc-bios/keymaps/meson.build        |  6 ++--
>>  pc-bios/meson.build                |  2 +-
>>  scripts/nsis.sh                    | 58 ++++++++++++++++++++++++++++++
>>  tools/virtiofsd/meson.build        |  2 +-
>>  trace/meson.build                  |  2 +-
>>  12 files changed, 101 insertions(+), 69 deletions(-)
>>  create mode 100755 scripts/nsis.sh
>>
>> --
>> 2.26.2
>>
>>



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

* Re: [PATCH 0/5] meson: mingw installation fixes & nsis conversion
  2020-08-25 16:49   ` Marc-André Lureau
@ 2020-08-25 18:14     ` Paolo Bonzini
  0 siblings, 0 replies; 13+ messages in thread
From: Paolo Bonzini @ 2020-08-25 18:14 UTC (permalink / raw)
  To: Marc-André Lureau; +Cc: sw, qemu-devel

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

Il mar 25 ago 2020, 18:49 Marc-André Lureau <marcandre.lureau@redhat.com>
ha scritto:

> Hi
>
> On Tue, Aug 25, 2020 at 8:38 PM Paolo Bonzini <pbonzini@redhat.com> wrote:
> >
> > Whenever we fix these bugs I would rather avoid adding duplicates
> between options and config-host.mak, so that we can sooner or later get rid
> of config-host.mak.
>

Yes I was talking more of the new options but you're right there's no
duplication. Do not review patches on a phone. :-)

Paolo


> This is not adding things to config-host.mak.
>
> > For the same reason, I think all options should have a sensible default
> so that in the end it will be possible to do "meson setup". Do you think
> it's possible to extend the series in this direction?
>
> The options I added also have default values.
>
> I think trying to remove (or just move) variables would be a separate
> goal from this series. It's already not completely trivial to get the
> conversion working without regression, as you probably know :) better
> not to mix goals imho.
>
> >
> > Paolo
> >
> > Il mar 25 ago 2020, 17:04 <marcandre.lureau@redhat.com> ha scritto:
> >>
> >> From: Marc-André Lureau <marcandre.lureau@redhat.com>
> >>
> >> Hi,
> >>
> >> The following patches fix installation path when cross-compiling Windows
> >> version, and move the NSIS build rule to meson.
> >>
> >> Marc-André Lureau (5):
> >>   meson: pass confsuffix option
> >>   meson: use meson datadir instead of qemu_datadir
> >>   meson: add docdir option and pass pre-prefix qemu_docdir
> >>   meson: use meson mandir instead of qemu_mandir
> >>   meson: add NSIS building
> >>
> >>  Makefile                           | 56 -----------------------------
> >>  configure                          |  2 ++
> >>  contrib/vhost-user-gpu/meson.build |  2 +-
> >>  docs/meson.build                   |  4 +--
> >>  meson.build                        | 32 +++++++++++++++--
> >>  meson_options.txt                  |  2 ++
> >>  pc-bios/descriptors/meson.build    |  2 +-
> >>  pc-bios/keymaps/meson.build        |  6 ++--
> >>  pc-bios/meson.build                |  2 +-
> >>  scripts/nsis.sh                    | 58 ++++++++++++++++++++++++++++++
> >>  tools/virtiofsd/meson.build        |  2 +-
> >>  trace/meson.build                  |  2 +-
> >>  12 files changed, 101 insertions(+), 69 deletions(-)
> >>  create mode 100755 scripts/nsis.sh
> >>
> >> --
> >> 2.26.2
> >>
> >>
>
>

[-- Attachment #2: Type: text/html, Size: 3788 bytes --]

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

end of thread, other threads:[~2020-08-25 18:16 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-08-25 15:04 [PATCH 0/5] meson: mingw installation fixes & nsis conversion marcandre.lureau
2020-08-25 15:04 ` [PATCH 1/5] meson: pass confsuffix option marcandre.lureau
2020-08-25 15:04 ` [PATCH 2/5] meson: use meson datadir instead of qemu_datadir marcandre.lureau
2020-08-25 15:04 ` [PATCH 3/5] meson: add docdir option and pass pre-prefix qemu_docdir marcandre.lureau
2020-08-25 15:04 ` [PATCH 4/5] meson: use meson mandir instead of qemu_mandir marcandre.lureau
2020-08-25 15:04 ` [PATCH 5/5] meson: add NSIS building marcandre.lureau
2020-08-25 15:11   ` Daniel P. Berrangé
2020-08-25 16:03     ` Peter Maydell
2020-08-25 16:07       ` Daniel P. Berrangé
2020-08-25 16:11   ` Peter Maydell
2020-08-25 16:38 ` [PATCH 0/5] meson: mingw installation fixes & nsis conversion Paolo Bonzini
2020-08-25 16:49   ` Marc-André Lureau
2020-08-25 18:14     ` Paolo Bonzini

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