mirror of
https://gitlab.com/libvirt/libvirt-python.git
synced 2025-07-28 15:41:52 +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:
@ -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)
|
||||
|
||||
|
10
generator.py
10
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,6 +619,7 @@ def buildStubs():
|
||||
sys.exit(1)
|
||||
|
||||
n = len(functions.keys())
|
||||
if not quiet:
|
||||
print "Found %d functions in libvirt-api.xml" % (n)
|
||||
|
||||
py_types['pythonObject'] = ('O', "pythonObject", "pythonObject", "pythonObject")
|
||||
@ -629,7 +632,7 @@ def buildStubs():
|
||||
except IOError, msg:
|
||||
print file, ":", msg
|
||||
|
||||
|
||||
if not quiet:
|
||||
print "Found %d functions in libvirt-override-api.xml" % (
|
||||
len(functions.keys()) - n)
|
||||
nb_wrap = 0
|
||||
@ -662,6 +665,7 @@ def buildStubs():
|
||||
export.close()
|
||||
wrapper.close()
|
||||
|
||||
if not quiet:
|
||||
print "Generated %d wrapper functions" % nb_wrap
|
||||
|
||||
if unknown_types:
|
||||
@ -669,13 +673,13 @@ def buildStubs():
|
||||
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
|
||||
|
||||
#######################################################################
|
||||
|
Reference in New Issue
Block a user