qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* ui: fix potential compile error.
@ 2020-09-02  3:04 ruippan(潘睿)
  2020-09-02  5:23 ` kraxel
  0 siblings, 1 reply; 4+ messages in thread
From: ruippan(潘睿) @ 2020-09-02  3:04 UTC (permalink / raw)
  To: kraxel@redhat.com; +Cc: qemu-devel@nongnu.org


[-- Attachment #1.1: Type: text/plain, Size: 629 bytes --]

We compiled the upstream qemu and result in this GEN code error:

‘’’
GEN     ui/input-keymap-atset1-to-qcode.c
usage: keymap-gen [-h]
                  {code-map,code-table,name-map,name-table,code-docs,name-docs}
                  ...
keymap-gen: error: invalid choice: 'glib2' (choose from 'code-map', 'code-table', 'name-map', 'name-table', 'code-docs', 'name-docs')
‘’’

My environment:

1.     CentOS7 with Python 2.7.5

2.     upstream's keycodemapdb

3.     argparse 1.1

Root cause is my argparse and python version. But change the invoking order can adapt both new and old argparse.

Thanks.

[-- Attachment #1.2: Type: text/html, Size: 6333 bytes --]

[-- Attachment #2: 0001-ui-fix-potential-compile-error.patch --]
[-- Type: application/octet-stream, Size: 1350 bytes --]

From 7f262b160d57559bace1f877f74b1c4e5a872b41 Mon Sep 17 00:00:00 2001
From: ruippan <ruippan@tencent.com>
Date: Wed, 2 Sep 2020 10:40:29 +0800
Subject: [PATCH] ui: fix potential compile error.

Fix code GEN error with info "keymap-gen: error: invalid choice: 'glib2'".
Compile environment:
1. CentOS7 with Python 2.7.5
2. upstream's keycodemapdb
3. argparse 1.1

Change arg order to adapt old version of argparse.

Signed-off-by: ruippan <ruippan@tencent.com>
---
 ui/meson.build | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/ui/meson.build b/ui/meson.build
index 962e776569..47e139903b 100644
--- a/ui/meson.build
+++ b/ui/meson.build
@@ -105,9 +105,9 @@ if have_system or xkbcommon.found()
                   capture: true,
                   input: files('keycodemapdb/data/keymaps.csv'),
                   command: [python.full_path(), files('keycodemapdb/tools/keymap-gen'),
-                            '--lang', 'glib2',
-                            '--varname', 'qemu_input_map_@0@_to_@1@'.format(e[0], e[1]),
-                            'code-map', '@INPUT0@', e[0], e[1]])
+                           'code-map', '@INPUT0@', e[0], e[1],
+                           '--lang', 'glib2',
+                           '--varname', 'qemu_input_map_@0@_to_@1@'.format(e[0], e[1])])
   endforeach
 endif
 
-- 
2.19.1


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

* Re: ui: fix potential compile error.
  2020-09-02  3:04 ui: fix potential compile error ruippan(潘睿)
@ 2020-09-02  5:23 ` kraxel
  2020-09-02  8:17   ` Daniel P. Berrangé
  0 siblings, 1 reply; 4+ messages in thread
From: kraxel @ 2020-09-02  5:23 UTC (permalink / raw)
  To: ruippan(潘睿); +Cc: qemu-devel@nongnu.org

  Hi,

> 1.     CentOS7 with Python 2.7.5

> Root cause is my argparse and python version. But change the invoking order can adapt both new and old argparse.

python2 is EOL and not supported any more.
please "yum install python3" (yes, centos7 has it, was added in 7.8).

take care,
  Gerd



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

* Re: ui: fix potential compile error.
  2020-09-02  5:23 ` kraxel
@ 2020-09-02  8:17   ` Daniel P. Berrangé
  2020-09-02 10:12     ` Thomas Huth
  0 siblings, 1 reply; 4+ messages in thread
From: Daniel P. Berrangé @ 2020-09-02  8:17 UTC (permalink / raw)
  To: kraxel@redhat.com; +Cc: ruippan(潘睿), qemu-devel@nongnu.org

On Wed, Sep 02, 2020 at 07:23:13AM +0200, kraxel@redhat.com wrote:
>   Hi,
> 
> > 1.     CentOS7 with Python 2.7.5
> 
> > Root cause is my argparse and python version. But change the invoking order can adapt both new and old argparse.
> 
> python2 is EOL and not supported any more.
> please "yum install python3" (yes, centos7 has it, was added in 7.8).

Hmm, I'm surpised the build even got this far.  configure should be checking
python version and refusing to run with python2 at all before even starting
the build process.

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] 4+ messages in thread

* Re: ui: fix potential compile error.
  2020-09-02  8:17   ` Daniel P. Berrangé
@ 2020-09-02 10:12     ` Thomas Huth
  0 siblings, 0 replies; 4+ messages in thread
From: Thomas Huth @ 2020-09-02 10:12 UTC (permalink / raw)
  To: Daniel P. Berrangé, kraxel@redhat.com
  Cc: ruippan(潘睿), qemu-devel@nongnu.org

On 02/09/2020 10.17, Daniel P. Berrangé wrote:
> On Wed, Sep 02, 2020 at 07:23:13AM +0200, kraxel@redhat.com wrote:
>>   Hi,
>>
>>> 1.     CentOS7 with Python 2.7.5
>>
>>> Root cause is my argparse and python version. But change the invoking order can adapt both new and old argparse.
>>
>> python2 is EOL and not supported any more.
>> please "yum install python3" (yes, centos7 has it, was added in 7.8).
> 
> Hmm, I'm surpised the build even got this far.  configure should be checking
> python version and refusing to run with python2 at all before even starting
> the build process.

There is a check for python >= in the configure script. 潘睿, did the
"configure" script allow you to run with Python 2.7 ?

 Thomas



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

end of thread, other threads:[~2020-09-02 10:13 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-09-02  3:04 ui: fix potential compile error ruippan(潘睿)
2020-09-02  5:23 ` kraxel
2020-09-02  8:17   ` Daniel P. Berrangé
2020-09-02 10:12     ` Thomas Huth

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).