Build failure with old Python 2.7: fatal error: 'vncdisplaykeymap_xorgevdev2rfb.c' file not found
@ryandesign
Submitted by Ryan Schmidt Link to original bug (#792075)
Description
Building gtk-vnc 0.7.1 fails on OS X Mavericks 10.9 and earlier, with this error:
vncdisplaykeymap.c:71:10: fatal error: 'vncdisplaykeymap_xorgevdev2rfb.c' file not found #include "vncdisplaykeymap_xorgevdev2rfb.c" ^ 1 error generated.
This is because earlier:
/usr/bin/python ./keycodemapdb/tools/keymap-gen --lang glib2 --varname keymap_xorgevdev2rfb code-map ./keycodemapdb/data/keymaps.csv xorgevdev rfb > vncd
isplaykeymap_xorgevdev2rfb.c || rm vncdisplaykeymap_xorgevdev2rfb.c
Traceback (most recent call last):
File "./keycodemapdb/tools/keymap-gen", line 578, in <module>
main()
File "./keycodemapdb/tools/keymap-gen", line 575, in main
args.func(args)
File "./keycodemapdb/tools/keymap-gen", line 539, in usage
sys.exit(1)
NameError: global name 'sys' is not defined
Similar errors happen for all the other files keymap-gen is supposed to generate.
Here is a full build log:
This isn't a problem on OS X Yosemite 10.10 and later. OS X Mavericks 10.9.5 has Python 2.7.5; OS X Yosemite 10.10.5 has Python 2.7.10.
If I add "import sys" to keycodemapdb/tools/keymap-gen, it avoids the "NameError: global name 'sys' is not defined" error but the files are still not generated. It looks like the files' contents are being set as:
Please select a command: 'code-map', 'code-table', 'name-map', 'name-table'
and then being deleted because the script is exiting with status 1.
You should change your code so that the error message is printed to stderr, not stdout.
It's unclear why that error message is being generated since the "code-map" command is clearly being used.
If I use a newer Python 2.7.14 from MacPorts then it builds fine so maybe there is just a bug in older Pythons. If you can't find a workaround for that and you want to require a newer Python, that's fine, but please check for it in the configure script so that others don't waste time wondering why things aren't working.
Version: 0.7.x