mirror of
https://gitlab.com/libvirt/libvirt-python.git
synced 2024-10-26 07:55:06 +03:00
Quieten build & ensure API build scripts exit with non-zero status
The current API build scripts will continue and exit with a zero status even if they find problems. This has been the cause of many build problems, or hidden build errors, in the past. Change the scripts so they always exit with a non-zero status for any problems they do not understand. Also turn off all debug output by default so they respect $(AM_V_GEN) * docs/Makefile.am: Use $(AM_V_GEN) for API/HTML scripts * docs/apibuild.py, python/generator.py: Exit with non-zero status if problems are found. Also be silent, not outputting any debug messages. * src/Makefile.am: Use $(AM_V_GEN) for ESX generator * python/Makefile.am: Tweak rule
This commit is contained in:
parent
140b8f2c12
commit
e9b7031c8a
@ -53,11 +53,11 @@ GENERATED= libvirt-export.c \
|
||||
libvirt.h \
|
||||
libvirt.py
|
||||
|
||||
generated.stamp: $(srcdir)/$(GENERATE) $(API_DESC)
|
||||
$(PYTHON) $(srcdir)/$(GENERATE) $(PYTHON)
|
||||
$(GENERATE).stamp: $(srcdir)/$(GENERATE) $(API_DESC)
|
||||
$(AM_V_GEN)$(PYTHON) $(srcdir)/$(GENERATE) $(PYTHON) && \
|
||||
touch $@
|
||||
|
||||
$(GENERATED): generated.stamp
|
||||
$(GENERATED): $(GENERATE).stamp
|
||||
|
||||
$(libvirtmod_la_OBJECTS): $(GENERATED)
|
||||
|
||||
|
16
generator.py
16
generator.py
@ -11,6 +11,8 @@ import sys
|
||||
import string
|
||||
import re
|
||||
|
||||
quiet=True
|
||||
|
||||
if __name__ == "__main__":
|
||||
# launched as a script
|
||||
srcPref = os.path.dirname(sys.argv[0])
|
||||
@ -617,7 +619,8 @@ def buildStubs():
|
||||
sys.exit(1)
|
||||
|
||||
n = len(functions.keys())
|
||||
print "Found %d functions in libvirt-api.xml" % (n)
|
||||
if not quiet:
|
||||
print "Found %d functions in libvirt-api.xml" % (n)
|
||||
|
||||
py_types['pythonObject'] = ('O', "pythonObject", "pythonObject", "pythonObject")
|
||||
try:
|
||||
@ -629,8 +632,8 @@ def buildStubs():
|
||||
except IOError, msg:
|
||||
print file, ":", msg
|
||||
|
||||
|
||||
print "Found %d functions in libvirt-override-api.xml" % (
|
||||
if not quiet:
|
||||
print "Found %d functions in libvirt-override-api.xml" % (
|
||||
len(functions.keys()) - n)
|
||||
nb_wrap = 0
|
||||
failed = 0
|
||||
@ -662,20 +665,21 @@ def buildStubs():
|
||||
export.close()
|
||||
wrapper.close()
|
||||
|
||||
print "Generated %d wrapper functions" % nb_wrap
|
||||
if not quiet:
|
||||
print "Generated %d wrapper functions" % nb_wrap
|
||||
|
||||
if unknown_types:
|
||||
print "Missing type converters: "
|
||||
for type in unknown_types.keys():
|
||||
print "%s:%d " % (type, len(unknown_types[type])),
|
||||
|
||||
print
|
||||
|
||||
for f in functions_failed:
|
||||
print "ERROR: failed %s" % f
|
||||
|
||||
if failed > 0:
|
||||
return -1
|
||||
if len(unknown_types) > 0:
|
||||
return -1
|
||||
return 0
|
||||
|
||||
#######################################################################
|
||||
|
Loading…
Reference in New Issue
Block a user