From 2c96cc96efa2ffe2c253a53181d6e4ca8823aea8 Mon Sep 17 00:00:00 2001 From: Robert Szewczyk Date: Wed, 15 Apr 2020 18:27:52 -0700 Subject: [PATCH 1/7] Results of running python-modernize on the codebase --- backend/lib/gwv/json_utils.py | 5 +++-- backend/lib/gwv/template_set.py | 3 ++- backend/lib/gwv/templates/c.py | 4 +++- backend/lib/gwv/templates/cpp.py | 1 + backend/lib/gwv/templates/objc.py | 3 ++- backend/lib/gwv/validator.py | 1 + backend/lib/nwv/nwv_parser.py | 10 +++++----- backend/lib/nwv/proto_pool.py | 10 +++++----- backend/lib/nwv/validators/min_version_validator.py | 1 + backend/lib/nwv/validators/name_suffix_validator.py | 2 +- .../lib/nwv/validators/test_min_version_validator.py | 1 + 11 files changed, 25 insertions(+), 16 deletions(-) diff --git a/backend/lib/gwv/json_utils.py b/backend/lib/gwv/json_utils.py index 7ea976f..9ad86a9 100644 --- a/backend/lib/gwv/json_utils.py +++ b/backend/lib/gwv/json_utils.py @@ -31,6 +31,7 @@ import math from gwv import schema +import six class JsonFormat(object): @@ -115,8 +116,8 @@ def struct_as_json(struct, json_format): rv['properties'] = fields_as_json(struct.field_list, json_format) required_list = [] - for (name, d) in rv['properties'].iteritems(): - if d.has_key('isRequired'): + for (name, d) in six.iteritems(rv['properties']): + if 'isRequired' in d: if d['isRequired']: required_list.append(name) del d['isRequired'] diff --git a/backend/lib/gwv/template_set.py b/backend/lib/gwv/template_set.py index 7788ed5..2ce1313 100644 --- a/backend/lib/gwv/template_set.py +++ b/backend/lib/gwv/template_set.py @@ -42,6 +42,7 @@ from gwv.templates import js from gwv.templates import md from gwv.templates import objc +import six # Mapping from file extension to a codegen template constructor. codegen_template_mapping = collections.OrderedDict([ @@ -147,7 +148,7 @@ def get_codegen_template(self, template_filename): class should match for unknown file types, so this should never happen. """ - for (pattern, template_class) in codegen_template_mapping.iteritems(): + for (pattern, template_class) in six.iteritems(codegen_template_mapping): if re.match(pattern, template_filename): return template_class(template_filename) diff --git a/backend/lib/gwv/templates/c.py b/backend/lib/gwv/templates/c.py index ab63231..d5e6a3b 100644 --- a/backend/lib/gwv/templates/c.py +++ b/backend/lib/gwv/templates/c.py @@ -33,6 +33,8 @@ from gwv import schema from gwv.templates import base +from six.moves import map +from six.moves import range class CodegenTemplate(base.CodegenTemplate): @@ -212,7 +214,7 @@ def resource_id_number(resource_id_str): """Returns the resource id number.""" _, hex_number = resource_id_str.split('_') - return long(hex_number, 16) + return int(hex_number, 16) def resource_id_bytes(resource_id_str): diff --git a/backend/lib/gwv/templates/cpp.py b/backend/lib/gwv/templates/cpp.py index d14b36e..4e79903 100644 --- a/backend/lib/gwv/templates/cpp.py +++ b/backend/lib/gwv/templates/cpp.py @@ -32,6 +32,7 @@ from gwv import schema from gwv.templates import c +from six.moves import map class CodegenTemplate(c.CodegenTemplate): diff --git a/backend/lib/gwv/templates/objc.py b/backend/lib/gwv/templates/objc.py index 22d694a..dce7c10 100644 --- a/backend/lib/gwv/templates/objc.py +++ b/backend/lib/gwv/templates/objc.py @@ -35,6 +35,7 @@ from gwv import exception from gwv import schema from gwv.templates import base +import six CLASS_PREFIX_NLK = 'NLK' CLASS_PREFIX_GPB = 'GPB' @@ -100,7 +101,7 @@ def flatten(objects): flat_objects = [] for obj in objects: if (isinstance(obj, collections.Iterable) and - not isinstance(obj, (str, unicode))): + not isinstance(obj, (str, six.text_type))): flat_objects.extend(flatten(obj)) elif obj is not None: flat_objects.append(obj) diff --git a/backend/lib/gwv/validator.py b/backend/lib/gwv/validator.py index 9b87509..c3cd0b8 100644 --- a/backend/lib/gwv/validator.py +++ b/backend/lib/gwv/validator.py @@ -30,6 +30,7 @@ import unittest from gwv import schema from gwv import visitor +from six.moves import map class ValidationWarning(Exception): """Exception indicating that schema failed validation.""" diff --git a/backend/lib/nwv/nwv_parser.py b/backend/lib/nwv/nwv_parser.py index dd32228..92157db 100644 --- a/backend/lib/nwv/nwv_parser.py +++ b/backend/lib/nwv/nwv_parser.py @@ -470,7 +470,7 @@ def link_typespace(self, typespace): typespace.version_map = schema.VersionMap(options.version_map) for nested_msg_desc in _order_messages_by_dependency( - typespace.desc.messages.values(), typespace.full_name): + list(typespace.desc.messages.values()), typespace.full_name): if nested_msg_desc.is_map_entry: continue # ignore map entries nested_msg = self.get_obj(nested_msg_desc.full_name) @@ -557,7 +557,7 @@ def link_trait(self, trait): trait.state_list.append(self.get_obj(field_desc.full_name)) for nested_msg_desc in _order_messages_by_dependency( - trait.desc.messages.values(), trait.full_name): + list(trait.desc.messages.values()), trait.full_name): if nested_msg_desc.is_map_entry: continue # ignore map entries nested_msg = self.get_obj(nested_msg_desc.full_name) @@ -1004,7 +1004,7 @@ def add_proto_to_pool(self, desc): 'TRAIT': options.Extensions[wdl_options_pb2.trait].id, 'EVENT': options.Extensions[wdl_options_pb2.event].id, 'COMMAND': options.Extensions[wdl_options_pb2.command].id - }.get(typ, _unique_number.next()) + }.get(typ, next(_unique_number)) elif isinstance(desc, proto_pool.FieldDesc): parent_typ = wdl_options_pb2.MessageType.Name( desc.parent.options.Extensions[wdl_options_pb2.message_type]) @@ -1022,10 +1022,10 @@ def add_proto_to_pool(self, desc): typ_cls = schema.ConstantGroup else: typ_cls = schema.Enum - obj_id = _unique_number.next() + obj_id = next(_unique_number) elif isinstance(desc, proto_pool.FileDesc): typ_cls = schema.File - obj_id = _unique_number.next() + obj_id = next(_unique_number) obj = typ_cls(desc.full_name, obj_id, comments) obj.desc = desc diff --git a/backend/lib/nwv/proto_pool.py b/backend/lib/nwv/proto_pool.py index 3db0a78..2740e74 100644 --- a/backend/lib/nwv/proto_pool.py +++ b/backend/lib/nwv/proto_pool.py @@ -69,7 +69,7 @@ def __getattr__(self, attr): return getattr(self._base_, attr) def __dir__(self): - return self.__dict__.keys() + dir(self._base_) + return list(self.__dict__.keys()) + dir(self._base_) # Just spit out the base as string def __str__(self): @@ -342,16 +342,16 @@ def get_field(self, field_name): return self._fields.get(normalize_type(field_name)) def get_files(self): - return self._files.values() + return list(self._files.values()) def get_messages(self): - return self._messages.values() + return list(self._messages.values()) def get_enums(self): - return self._enums.values() + return list(self._enums.values()) def get_fields(self): - return self._fields.values() + return list(self._fields.values()) def normalize_type(type_name): diff --git a/backend/lib/nwv/validators/min_version_validator.py b/backend/lib/nwv/validators/min_version_validator.py index e085616..fbf23ec 100644 --- a/backend/lib/nwv/validators/min_version_validator.py +++ b/backend/lib/nwv/validators/min_version_validator.py @@ -24,6 +24,7 @@ """Ensures min_version never exceeds parent version.""" +from __future__ import absolute_import from gwv import schema from gwv import validator diff --git a/backend/lib/nwv/validators/name_suffix_validator.py b/backend/lib/nwv/validators/name_suffix_validator.py index 41ff622..c567873 100644 --- a/backend/lib/nwv/validators/name_suffix_validator.py +++ b/backend/lib/nwv/validators/name_suffix_validator.py @@ -42,7 +42,7 @@ # TODO(robbarnes) Resource, Event, Response (Event), UpdateParameters ) -_ALL_SUFFIXES = frozenset(itertools.chain(*_SUFFIX_MAP.values())) +_ALL_SUFFIXES = frozenset(itertools.chain(*list(_SUFFIX_MAP.values()))) # These violate the rules, but are allowed since they can't be changed anymore. _LEGACY_WHITELIST = frozenset([ diff --git a/backend/lib/nwv/validators/test_min_version_validator.py b/backend/lib/nwv/validators/test_min_version_validator.py index 9a67a9a..5af3c1d 100644 --- a/backend/lib/nwv/validators/test_min_version_validator.py +++ b/backend/lib/nwv/validators/test_min_version_validator.py @@ -24,6 +24,7 @@ """Test for MinVersionValidator validator.""" +from __future__ import absolute_import import unittest from gwv import schema from gwv import validator From 1b6318dccc4bb684a2b84318f9ea00519c5695c0 Mon Sep 17 00:00:00 2001 From: Robert Szewczyk Date: Wed, 15 Apr 2020 18:34:38 -0700 Subject: [PATCH 2/7] Python3 comparison fixes In python 3 comparison between different classes is not defined by default; fix the Jinja template to sort on a common attribute type instead. Comparison between int and None is not defined; define suitable fallback --- backend/lib/nwv/validators/number_validator.py | 2 +- codegen/weave-device-cpp/templates/common.macros | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/backend/lib/nwv/validators/number_validator.py b/backend/lib/nwv/validators/number_validator.py index 7ad556a..a4d1fde 100644 --- a/backend/lib/nwv/validators/number_validator.py +++ b/backend/lib/nwv/validators/number_validator.py @@ -52,7 +52,7 @@ def visit_Field(self, field): return fixed_encoding_width = self.fpn(field.min_value, field.max_value, - field.precision) + field.precision) or 0 if field.fixed_width < fixed_encoding_width: self.add_failure('Fixed width not large enough for given ' 'min, max and precision.') diff --git a/codegen/weave-device-cpp/templates/common.macros b/codegen/weave-device-cpp/templates/common.macros index 9000be4..d0e6416 100644 --- a/codegen/weave-device-cpp/templates/common.macros +++ b/codegen/weave-device-cpp/templates/common.macros @@ -53,7 +53,7 @@ enum {{ enum.base_name }} { chain(get_struct_dependencies(obj)|reject('common')|map(attribute='parent'))| chain(get_struct_dependencies(obj)|select('common'))| reject('false')|unique|reject('standard')|reject('vendor')| - reject('equalto',obj)|sort -%} + reject('equalto',obj)|sort(attribute='full_name') -%} #include <{{ c_header_file(dep) }}> {% endfor %} From 710de578ad4e5bc738740417be68731115cbb2c6 Mon Sep 17 00:00:00 2001 From: Robert Szewczyk Date: Wed, 15 Apr 2020 18:37:18 -0700 Subject: [PATCH 3/7] Python3 binary IO `sys.stdin.read()` and `sys.stdout.write()` methods in Python3 expect to operate on strings, and thus expect to read/write valid unicode objects. The protoc python interface expects to be able to send/receive aribitrary binary streams. The change here keeps the existing sys.stdin and sys.stdout objects on Python2 systems and on Python3 systems, the code uses raw binary IO via `open()` call. --- backend/lib/nwv/wdl_plugin.py | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/backend/lib/nwv/wdl_plugin.py b/backend/lib/nwv/wdl_plugin.py index 9e64c71..26df428 100644 --- a/backend/lib/nwv/wdl_plugin.py +++ b/backend/lib/nwv/wdl_plugin.py @@ -133,17 +133,23 @@ def codegen(request, response): out_file.name = filename # The newline was added in the legacy template_set file writer, # so it's included here to preserve compatibility. - out_file.content = content.encode('utf-8') + '\n' + out_file.content = content.encode('utf-8') + '\n'.encode('utf-8') if __name__ == '__main__': logging.basicConfig(format='%(levelname)s: %(message)s', level=logging.WARN) - std_in = sys.stdin.read() + if sys.version_info.major == 2: + std_in = sys.stdin.read() + else: + std_in = open(0, "rb").read() request_pb2 = plugin_pb2.CodeGeneratorRequest.FromString(std_in) response_pb2 = plugin_pb2.CodeGeneratorResponse() codegen(request_pb2, response_pb2) - sys.stdout.write(response_pb2.SerializeToString()) + if sys.version_info.major == 2: + sys.stdout.write(response_pb2.SerializeToString()) + else: + open(1,"wb").write(response_pb2.SerializeToString()) From fc8aeaf443ab01a7dc9f5d9a169189f49a45bc9e Mon Sep 17 00:00:00 2001 From: Robert Szewczyk Date: Wed, 15 Apr 2020 18:42:03 -0700 Subject: [PATCH 4/7] Python3 dictionary mods Python3 does not permit dictionaries to be modified during iteration. Replace the philosophy of deleting the object from a dictionary with maintaining a list of already completed objects. --- backend/lib/nwv/nwv_parser.py | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/backend/lib/nwv/nwv_parser.py b/backend/lib/nwv/nwv_parser.py index 92157db..46ef220 100644 --- a/backend/lib/nwv/nwv_parser.py +++ b/backend/lib/nwv/nwv_parser.py @@ -100,13 +100,16 @@ def _order_messages_by_dependency(messages, namespace): remaining_messages = collections.OrderedDict( (x.full_name, (x, _get_dependencies_in_namespace(x, namespace))) for x in messages) - while remaining_messages: + already_processed = set() + while len(remaining_messages) != len(already_processed): for nested_msg_desc, deps in remaining_messages.values(): + if nested_msg_desc.full_name in already_processed: + continue for dep in deps: - if dep in remaining_messages: + if dep not in already_processed and dep in remaining_messages: break else: - del remaining_messages[nested_msg_desc.full_name] + already_processed.add(nested_msg_desc.full_name) yield nested_msg_desc @@ -711,11 +714,9 @@ def link_enum(self, enum): for value in enum.desc.values.values(): description = self.parse_comments(value) pair_opts = value.options.Extensions[wdl_options_pb2.enumvalue] - value.full_name.replace( - inflection.underscore(enum.base_name).decode('utf-8').upper() + '_', + inflection.underscore(enum.base_name).upper() + '_', '') - enum_pair = schema.EnumPair(value.full_name, value.number, description) enum_pair.source_file = enum.source_file From b6e8203a89a4f7e4e9e2049a6f1375b66eacc107 Mon Sep 17 00:00:00 2001 From: Robert Szewczyk Date: Wed, 15 Apr 2020 18:43:37 -0700 Subject: [PATCH 5/7] Python3 changes: differing return types for `struct.pack` In python 3, the result of `struct.pack` is already a `bytes` object; simply map it to a list for compatibility purposes. Keep prior mapping via `ord` for cases where `struct.pack` returns a `str` (i.e. Python2) --- backend/lib/gwv/templates/c.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/backend/lib/gwv/templates/c.py b/backend/lib/gwv/templates/c.py index d5e6a3b..4536592 100644 --- a/backend/lib/gwv/templates/c.py +++ b/backend/lib/gwv/templates/c.py @@ -225,7 +225,11 @@ def resource_id_bytes(resource_id_str): packed = struct.pack('>HQ', getattr(schema.Field.ResourceType, type_name).value, number) - return map(ord, packed) + if isinstance(packed, str): + rv = [ord(x) for x in packed] + else: + rv = [x for x in packed] + return rv def list_to_bitfield(table): From 9df95a07480b02429eec030727ba8e953123c309 Mon Sep 17 00:00:00 2001 From: Robert Szewczyk Date: Wed, 15 Apr 2020 20:49:19 -0700 Subject: [PATCH 6/7] Python3 changes: change the maximum acceptable version --- configure.ac | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/configure.ac b/configure.ac index 6e64d7e..444310b 100644 --- a/configure.ac +++ b/configure.ac @@ -144,7 +144,7 @@ NL_PATH_PROG(SED, sed, [sed is required to build wdlc]) # version range, inclusive. nl_python_major_minor_version_min="2.7" -nl_python_major_minor_version_max="2.7" +nl_python_major_minor_version_max="3.8" # Provide some documentation in 'configure --help' that informs the # user that 'PYTHON= configure' or 'configure From 23898b807026bd15016000b5707a29aeeb16c04a Mon Sep 17 00:00:00 2001 From: Robert Szewczyk Date: Wed, 15 Apr 2020 20:51:42 -0700 Subject: [PATCH 7/7] Re-bootstrapped the package --- Makefile.in | 1 + backend/Makefile.in | 1 + codegen/Makefile.in | 1 + codegen/weave-device-cpp/Makefile.in | 1 + configure | 38 ++- include/Makefile.in | 1 + test/Makefile.in | 1 + third_party/Makefile.in | 1 + third_party/googleapis/Makefile.in | 1 + .../repo/third_party/autoconf/ltmain.sh | 246 +++++++++++++----- 10 files changed, 207 insertions(+), 85 deletions(-) diff --git a/Makefile.in b/Makefile.in index 4bdf06d..627000c 100644 --- a/Makefile.in +++ b/Makefile.in @@ -337,6 +337,7 @@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ +runstatedir = @runstatedir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ diff --git a/backend/Makefile.in b/backend/Makefile.in index 9ce579d..bfacf14 100644 --- a/backend/Makefile.in +++ b/backend/Makefile.in @@ -243,6 +243,7 @@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ +runstatedir = @runstatedir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ diff --git a/codegen/Makefile.in b/codegen/Makefile.in index fc52f81..00f99f5 100644 --- a/codegen/Makefile.in +++ b/codegen/Makefile.in @@ -303,6 +303,7 @@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ +runstatedir = @runstatedir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ diff --git a/codegen/weave-device-cpp/Makefile.in b/codegen/weave-device-cpp/Makefile.in index 893fcdd..db5d1d0 100644 --- a/codegen/weave-device-cpp/Makefile.in +++ b/codegen/weave-device-cpp/Makefile.in @@ -243,6 +243,7 @@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ +runstatedir = @runstatedir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ diff --git a/configure b/configure index 5ba3741..19ed041 100755 --- a/configure +++ b/configure @@ -1,6 +1,6 @@ #! /bin/sh # Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.69 for openweave-wdlc gd2060fa-dirty. +# Generated by GNU Autoconf 2.69 for openweave-wdlc g9df95a0-dirty. # # Report bugs to . # @@ -579,8 +579,8 @@ MAKEFLAGS= # Identity of this package. PACKAGE_NAME='openweave-wdlc' PACKAGE_TARNAME='openweave-wdlc' -PACKAGE_VERSION='gd2060fa-dirty' -PACKAGE_STRING='openweave-wdlc gd2060fa-dirty' +PACKAGE_VERSION='g9df95a0-dirty' +PACKAGE_STRING='openweave-wdlc g9df95a0-dirty' PACKAGE_BUGREPORT='openweave-users@googlegroups.com' PACKAGE_URL='http://openweave.io/' @@ -673,6 +673,7 @@ infodir docdir oldincludedir includedir +runstatedir localstatedir sharedstatedir sysconfdir @@ -743,6 +744,7 @@ datadir='${datarootdir}' sysconfdir='${prefix}/etc' sharedstatedir='${prefix}/com' localstatedir='${prefix}/var' +runstatedir='${localstatedir}/run' includedir='${prefix}/include' oldincludedir='/usr/include' docdir='${datarootdir}/doc/${PACKAGE_TARNAME}' @@ -995,6 +997,15 @@ do | -silent | --silent | --silen | --sile | --sil) silent=yes ;; + -runstatedir | --runstatedir | --runstatedi | --runstated \ + | --runstate | --runstat | --runsta | --runst | --runs \ + | --run | --ru | --r) + ac_prev=runstatedir ;; + -runstatedir=* | --runstatedir=* | --runstatedi=* | --runstated=* \ + | --runstate=* | --runstat=* | --runsta=* | --runst=* | --runs=* \ + | --run=* | --ru=* | --r=*) + runstatedir=$ac_optarg ;; + -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb) ac_prev=sbindir ;; -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \ @@ -1132,7 +1143,7 @@ fi for ac_var in exec_prefix prefix bindir sbindir libexecdir datarootdir \ datadir sysconfdir sharedstatedir localstatedir includedir \ oldincludedir docdir infodir htmldir dvidir pdfdir psdir \ - libdir localedir mandir + libdir localedir mandir runstatedir do eval ac_val=\$$ac_var # Remove trailing slashes. @@ -1245,7 +1256,7 @@ if test "$ac_init_help" = "long"; then # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat <<_ACEOF -\`configure' configures openweave-wdlc gd2060fa-dirty to adapt to many kinds of systems. +\`configure' configures openweave-wdlc g9df95a0-dirty to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... @@ -1285,6 +1296,7 @@ Fine tuning of the installation directories: --sysconfdir=DIR read-only single-machine data [PREFIX/etc] --sharedstatedir=DIR modifiable architecture-independent data [PREFIX/com] --localstatedir=DIR modifiable single-machine data [PREFIX/var] + --runstatedir=DIR modifiable per-process data [LOCALSTATEDIR/run] --libdir=DIR object code libraries [EPREFIX/lib] --includedir=DIR C header files [PREFIX/include] --oldincludedir=DIR C header files for non-gcc [/usr/include] @@ -1316,7 +1328,7 @@ fi if test -n "$ac_init_help"; then case $ac_init_help in - short | recursive ) echo "Configuration of openweave-wdlc gd2060fa-dirty:";; + short | recursive ) echo "Configuration of openweave-wdlc g9df95a0-dirty:";; esac cat <<\_ACEOF @@ -1406,7 +1418,7 @@ fi test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF -openweave-wdlc configure gd2060fa-dirty +openweave-wdlc configure g9df95a0-dirty generated by GNU Autoconf 2.69 Copyright (C) 2012 Free Software Foundation, Inc. @@ -1423,7 +1435,7 @@ cat >config.log <<_ACEOF This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. -It was created by openweave-wdlc $as_me gd2060fa-dirty, which was +It was created by openweave-wdlc $as_me g9df95a0-dirty, which was generated by GNU Autoconf 2.69. Invocation command line was $ $0 $@ @@ -2602,7 +2614,7 @@ fi # Define the identity of the package. PACKAGE='openweave-wdlc' - VERSION='gd2060fa-dirty' + VERSION='g9df95a0-dirty' cat >>confdefs.h <<_ACEOF @@ -3024,7 +3036,7 @@ fi # version range, inclusive. nl_python_major_minor_version_min="2.7" -nl_python_major_minor_version_max="2.7" +nl_python_major_minor_version_max="3.8" # Provide some documentation in 'configure --help' that informs the # user that 'PYTHON= configure' or 'configure @@ -3288,7 +3300,7 @@ if ${nl_cv_protoc_version+:} false; then : $as_echo_n "(cached) " >&6 else - nl_cv_protoc_version=`${PROTOC} --version 2>&1 | ${SED} -n -e 's/^.\{1,\}\([0-9]\{1,\}.[0-9]\{1,\}.[0-9]\{1,\}\)$/\1/gp'` + nl_cv_protoc_version=`${PROTOC} --version 2>&1 | ${SED} -n -E -e 's/^[^0-9]*(([0-9]+\.)*[0-9]+).*/\1/p'` if test "${nl_cv_protoc_version}" = "" ; then nl_cv_protoc_version="unknown" @@ -4008,7 +4020,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. ac_log=" -This file was extended by openweave-wdlc $as_me gd2060fa-dirty, which was +This file was extended by openweave-wdlc $as_me g9df95a0-dirty, which was generated by GNU Autoconf 2.69. Invocation command line was CONFIG_FILES = $CONFIG_FILES @@ -4071,7 +4083,7 @@ _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`" ac_cs_version="\\ -openweave-wdlc config.status gd2060fa-dirty +openweave-wdlc config.status g9df95a0-dirty configured by $0, generated by GNU Autoconf 2.69, with options \\"\$ac_cs_config\\" diff --git a/include/Makefile.in b/include/Makefile.in index 5c4f0b2..b0a191d 100644 --- a/include/Makefile.in +++ b/include/Makefile.in @@ -264,6 +264,7 @@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ +runstatedir = @runstatedir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ diff --git a/test/Makefile.in b/test/Makefile.in index 2fc6334..837554c 100644 --- a/test/Makefile.in +++ b/test/Makefile.in @@ -245,6 +245,7 @@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ +runstatedir = @runstatedir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ diff --git a/third_party/Makefile.in b/third_party/Makefile.in index 831a00f..c9c6f63 100644 --- a/third_party/Makefile.in +++ b/third_party/Makefile.in @@ -303,6 +303,7 @@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ +runstatedir = @runstatedir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ diff --git a/third_party/googleapis/Makefile.in b/third_party/googleapis/Makefile.in index 77f57f4..5f122d3 100644 --- a/third_party/googleapis/Makefile.in +++ b/third_party/googleapis/Makefile.in @@ -248,6 +248,7 @@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ +runstatedir = @runstatedir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ diff --git a/third_party/nlbuild-autotools/repo/third_party/autoconf/ltmain.sh b/third_party/nlbuild-autotools/repo/third_party/autoconf/ltmain.sh index 0f0a2da..d11f1e0 100644 --- a/third_party/nlbuild-autotools/repo/third_party/autoconf/ltmain.sh +++ b/third_party/nlbuild-autotools/repo/third_party/autoconf/ltmain.sh @@ -31,7 +31,7 @@ PROGRAM=libtool PACKAGE=libtool -VERSION=2.4.6 +VERSION="2.4.6 Debian-2.4.6-11" package_revision=2.4.6 @@ -1370,7 +1370,7 @@ func_lt_ver () #! /bin/sh # Set a version string for this script. -scriptversion=2014-01-07.03; # UTC +scriptversion=2015-10-07.11; # UTC # A portable, pluggable option parser for Bourne shell. # Written by Gary V. Vaughan, 2010 @@ -1530,6 +1530,8 @@ func_run_hooks () { $debug_cmd + _G_rc_run_hooks=false + case " $hookable_fns " in *" $1 "*) ;; *) func_fatal_error "'$1' does not support hook funcions.n" ;; @@ -1538,16 +1540,16 @@ func_run_hooks () eval _G_hook_fns=\$$1_hooks; shift for _G_hook in $_G_hook_fns; do - eval $_G_hook '"$@"' - - # store returned options list back into positional - # parameters for next 'cmd' execution. - eval _G_hook_result=\$${_G_hook}_result - eval set dummy "$_G_hook_result"; shift + if eval $_G_hook '"$@"'; then + # store returned options list back into positional + # parameters for next 'cmd' execution. + eval _G_hook_result=\$${_G_hook}_result + eval set dummy "$_G_hook_result"; shift + _G_rc_run_hooks=: + fi done - func_quote_for_eval ${1+"$@"} - func_run_hooks_result=$func_quote_for_eval_result + $_G_rc_run_hooks && func_run_hooks_result=$_G_hook_result } @@ -1557,10 +1559,16 @@ func_run_hooks () ## --------------- ## # In order to add your own option parsing hooks, you must accept the -# full positional parameter list in your hook function, remove any -# options that you action, and then pass back the remaining unprocessed +# full positional parameter list in your hook function, you may remove/edit +# any options that you action, and then pass back the remaining unprocessed # options in '_result', escaped suitably for -# 'eval'. Like this: +# 'eval'. In this case you also must return $EXIT_SUCCESS to let the +# hook's caller know that it should pay attention to +# '_result'. Returning $EXIT_FAILURE signalizes that +# arguments are left untouched by the hook and therefore caller will ignore the +# result variable. +# +# Like this: # # my_options_prep () # { @@ -1570,9 +1578,11 @@ func_run_hooks () # usage_message=$usage_message' # -s, --silent don'\''t print informational messages # ' -# -# func_quote_for_eval ${1+"$@"} -# my_options_prep_result=$func_quote_for_eval_result +# # No change in '$@' (ignored completely by this hook). There is +# # no need to do the equivalent (but slower) action: +# # func_quote_for_eval ${1+"$@"} +# # my_options_prep_result=$func_quote_for_eval_result +# false # } # func_add_hook func_options_prep my_options_prep # @@ -1581,25 +1591,37 @@ func_run_hooks () # { # $debug_cmd # +# args_changed=false +# # # Note that for efficiency, we parse as many options as we can # # recognise in a loop before passing the remainder back to the # # caller on the first unrecognised argument we encounter. # while test $# -gt 0; do # opt=$1; shift # case $opt in -# --silent|-s) opt_silent=: ;; +# --silent|-s) opt_silent=: +# args_changed=: +# ;; # # Separate non-argument short options: # -s*) func_split_short_opt "$_G_opt" # set dummy "$func_split_short_opt_name" \ # "-$func_split_short_opt_arg" ${1+"$@"} # shift +# args_changed=: # ;; -# *) set dummy "$_G_opt" "$*"; shift; break ;; +# *) # Make sure the first unrecognised option "$_G_opt" +# # is added back to "$@", we could need that later +# # if $args_changed is true. +# set dummy "$_G_opt" ${1+"$@"}; shift; break ;; # esac # done # -# func_quote_for_eval ${1+"$@"} -# my_silent_option_result=$func_quote_for_eval_result +# if $args_changed; then +# func_quote_for_eval ${1+"$@"} +# my_silent_option_result=$func_quote_for_eval_result +# fi +# +# $args_changed # } # func_add_hook func_parse_options my_silent_option # @@ -1611,16 +1633,32 @@ func_run_hooks () # $opt_silent && $opt_verbose && func_fatal_help "\ # '--silent' and '--verbose' options are mutually exclusive." # -# func_quote_for_eval ${1+"$@"} -# my_option_validation_result=$func_quote_for_eval_result +# false # } # func_add_hook func_validate_options my_option_validation # -# You'll alse need to manually amend $usage_message to reflect the extra +# You'll also need to manually amend $usage_message to reflect the extra # options you parse. It's preferable to append if you can, so that # multiple option parsing hooks can be added safely. +# func_options_finish [ARG]... +# ---------------------------- +# Finishing the option parse loop (call 'func_options' hooks ATM). +func_options_finish () +{ + $debug_cmd + + _G_func_options_finish_exit=false + if func_run_hooks func_options ${1+"$@"}; then + func_options_finish_result=$func_run_hooks_result + _G_func_options_finish_exit=: + fi + + $_G_func_options_finish_exit +} + + # func_options [ARG]... # --------------------- # All the functions called inside func_options are hookable. See the @@ -1630,17 +1668,28 @@ func_options () { $debug_cmd - func_options_prep ${1+"$@"} - eval func_parse_options \ - ${func_options_prep_result+"$func_options_prep_result"} - eval func_validate_options \ - ${func_parse_options_result+"$func_parse_options_result"} + _G_rc_options=false + + for my_func in options_prep parse_options validate_options options_finish + do + if eval func_$my_func '${1+"$@"}'; then + eval _G_res_var='$'"func_${my_func}_result" + eval set dummy "$_G_res_var" ; shift + _G_rc_options=: + fi + done - eval func_run_hooks func_options \ - ${func_validate_options_result+"$func_validate_options_result"} + # Save modified positional parameters for caller. As a top-level + # options-parser function we always need to set the 'func_options_result' + # variable (regardless the $_G_rc_options value). + if $_G_rc_options; then + func_options_result=$_G_res_var + else + func_quote_for_eval ${1+"$@"} + func_options_result=$func_quote_for_eval_result + fi - # save modified positional parameters for caller - func_options_result=$func_run_hooks_result + $_G_rc_options } @@ -1649,9 +1698,9 @@ func_options () # All initialisations required before starting the option parse loop. # Note that when calling hook functions, we pass through the list of # positional parameters. If a hook function modifies that list, and -# needs to propogate that back to rest of this script, then the complete +# needs to propagate that back to rest of this script, then the complete # modified list must be put in 'func_run_hooks_result' before -# returning. +# returning $EXIT_SUCCESS (otherwise $EXIT_FAILURE is returned). func_hookable func_options_prep func_options_prep () { @@ -1661,10 +1710,14 @@ func_options_prep () opt_verbose=false opt_warning_types= - func_run_hooks func_options_prep ${1+"$@"} + _G_rc_options_prep=false + if func_run_hooks func_options_prep ${1+"$@"}; then + _G_rc_options_prep=: + # save modified positional parameters for caller + func_options_prep_result=$func_run_hooks_result + fi - # save modified positional parameters for caller - func_options_prep_result=$func_run_hooks_result + $_G_rc_options_prep } @@ -1678,18 +1731,20 @@ func_parse_options () func_parse_options_result= + _G_rc_parse_options=false # this just eases exit handling while test $# -gt 0; do # Defer to hook functions for initial option parsing, so they # get priority in the event of reusing an option name. - func_run_hooks func_parse_options ${1+"$@"} - - # Adjust func_parse_options positional parameters to match - eval set dummy "$func_run_hooks_result"; shift + if func_run_hooks func_parse_options ${1+"$@"}; then + eval set dummy "$func_run_hooks_result"; shift + _G_rc_parse_options=: + fi # Break out of the loop if we already parsed every option. test $# -gt 0 || break + _G_match_parse_options=: _G_opt=$1 shift case $_G_opt in @@ -1704,7 +1759,10 @@ func_parse_options () ;; --warnings|--warning|-W) - test $# = 0 && func_missing_arg $_G_opt && break + if test $# = 0 && func_missing_arg $_G_opt; then + _G_rc_parse_options=: + break + fi case " $warning_categories $1" in *" $1 "*) # trailing space prevents matching last $1 above @@ -1757,15 +1815,25 @@ func_parse_options () shift ;; - --) break ;; + --) _G_rc_parse_options=: ; break ;; -*) func_fatal_help "unrecognised option: '$_G_opt'" ;; - *) set dummy "$_G_opt" ${1+"$@"}; shift; break ;; + *) set dummy "$_G_opt" ${1+"$@"}; shift + _G_match_parse_options=false + break + ;; esac + + $_G_match_parse_options && _G_rc_parse_options=: done - # save modified positional parameters for caller - func_quote_for_eval ${1+"$@"} - func_parse_options_result=$func_quote_for_eval_result + + if $_G_rc_parse_options; then + # save modified positional parameters for caller + func_quote_for_eval ${1+"$@"} + func_parse_options_result=$func_quote_for_eval_result + fi + + $_G_rc_parse_options } @@ -1778,16 +1846,21 @@ func_validate_options () { $debug_cmd + _G_rc_validate_options=false + # Display all warnings if -W was not given. test -n "$opt_warning_types" || opt_warning_types=" $warning_categories" - func_run_hooks func_validate_options ${1+"$@"} + if func_run_hooks func_validate_options ${1+"$@"}; then + # save modified positional parameters for caller + func_validate_options_result=$func_run_hooks_result + _G_rc_validate_options=: + fi # Bail if the options were screwed! $exit_cmd $EXIT_FAILURE - # save modified positional parameters for caller - func_validate_options_result=$func_run_hooks_result + $_G_rc_validate_options } @@ -2068,12 +2141,12 @@ include the following information: compiler: $LTCC compiler flags: $LTCFLAGS linker: $LD (gnu? $with_gnu_ld) - version: $progname (GNU libtool) 2.4.6 + version: $progname $scriptversion Debian-2.4.6-11 automake: `($AUTOMAKE --version) 2>/dev/null |$SED 1q` autoconf: `($AUTOCONF --version) 2>/dev/null |$SED 1q` Report bugs to . -GNU libtool home page: . +GNU libtool home page: . General help using GNU software: ." exit 0 } @@ -2270,6 +2343,8 @@ libtool_options_prep () nonopt= preserve_args= + _G_rc_lt_options_prep=: + # Shorthand for --mode=foo, only valid as the first argument case $1 in clean|clea|cle|cl) @@ -2293,11 +2368,18 @@ libtool_options_prep () uninstall|uninstal|uninsta|uninst|unins|unin|uni|un|u) shift; set dummy --mode uninstall ${1+"$@"}; shift ;; + *) + _G_rc_lt_options_prep=false + ;; esac - # Pass back the list of options. - func_quote_for_eval ${1+"$@"} - libtool_options_prep_result=$func_quote_for_eval_result + if $_G_rc_lt_options_prep; then + # Pass back the list of options. + func_quote_for_eval ${1+"$@"} + libtool_options_prep_result=$func_quote_for_eval_result + fi + + $_G_rc_lt_options_prep } func_add_hook func_options_prep libtool_options_prep @@ -2309,9 +2391,12 @@ libtool_parse_options () { $debug_cmd + _G_rc_lt_parse_options=false + # Perform our own loop to consume as many options as possible in # each iteration. while test $# -gt 0; do + _G_match_lt_parse_options=: _G_opt=$1 shift case $_G_opt in @@ -2386,15 +2471,22 @@ libtool_parse_options () func_append preserve_args " $_G_opt" ;; - # An option not handled by this hook function: - *) set dummy "$_G_opt" ${1+"$@"}; shift; break ;; + # An option not handled by this hook function: + *) set dummy "$_G_opt" ${1+"$@"} ; shift + _G_match_lt_parse_options=false + break + ;; esac + $_G_match_lt_parse_options && _G_rc_lt_parse_options=: done + if $_G_rc_lt_parse_options; then + # save modified positional parameters for caller + func_quote_for_eval ${1+"$@"} + libtool_parse_options_result=$func_quote_for_eval_result + fi - # save modified positional parameters for caller - func_quote_for_eval ${1+"$@"} - libtool_parse_options_result=$func_quote_for_eval_result + $_G_rc_lt_parse_options } func_add_hook func_parse_options libtool_parse_options @@ -7272,10 +7364,14 @@ func_mode_link () # -tp=* Portland pgcc target processor selection # --sysroot=* for sysroot support # -O*, -g*, -flto*, -fwhopr*, -fuse-linker-plugin GCC link-time optimization + # -specs=* GCC specs files # -stdlib=* select c++ std lib with clang + # -fsanitize=* Clang/GCC memory and address sanitizer + # -fuse-ld=* Linker select flags for GCC -64|-mips[0-9]|-r[0-9][0-9]*|-xarch=*|-xtarget=*|+DA*|+DD*|-q*|-m*| \ -t[45]*|-txscale*|-p|-pg|--coverage|-fprofile-*|-F*|@*|-tp=*|--sysroot=*| \ - -O*|-g*|-flto*|-fwhopr*|-fuse-linker-plugin|-fstack-protector*|-stdlib=*) + -O*|-g*|-flto*|-fwhopr*|-fuse-linker-plugin|-fstack-protector*|-stdlib=*| \ + -specs=*|-fsanitize=*|-fuse-ld=*) func_quote_for_eval "$arg" arg=$func_quote_for_eval_result func_append compile_command " $arg" @@ -7568,7 +7664,10 @@ func_mode_link () case $pass in dlopen) libs=$dlfiles ;; dlpreopen) libs=$dlprefiles ;; - link) libs="$deplibs %DEPLIBS% $dependency_libs" ;; + link) + libs="$deplibs %DEPLIBS%" + test "X$link_all_deplibs" != Xno && libs="$libs $dependency_libs" + ;; esac fi if test lib,dlpreopen = "$linkmode,$pass"; then @@ -7887,19 +7986,19 @@ func_mode_link () # It is a libtool convenience library, so add in its objects. func_append convenience " $ladir/$objdir/$old_library" func_append old_convenience " $ladir/$objdir/$old_library" + tmp_libs= + for deplib in $dependency_libs; do + deplibs="$deplib $deplibs" + if $opt_preserve_dup_deps; then + case "$tmp_libs " in + *" $deplib "*) func_append specialdeplibs " $deplib" ;; + esac + fi + func_append tmp_libs " $deplib" + done elif test prog != "$linkmode" && test lib != "$linkmode"; then func_fatal_error "'$lib' is not a convenience library" fi - tmp_libs= - for deplib in $dependency_libs; do - deplibs="$deplib $deplibs" - if $opt_preserve_dup_deps; then - case "$tmp_libs " in - *" $deplib "*) func_append specialdeplibs " $deplib" ;; - esac - fi - func_append tmp_libs " $deplib" - done continue fi # $pass = conv @@ -8823,6 +8922,9 @@ func_mode_link () revision=$number_minor lt_irix_increment=no ;; + *) + func_fatal_configuration "$modename: unknown library version type '$version_type'" + ;; esac ;; no)