Skip to content
Merged
Show file tree
Hide file tree
Changes from 15 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 24 additions & 3 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -77,13 +77,15 @@ matrix:
env:
- TASK='compile'
- CPPUNIT='1.14'
- PROTOBUF='latest'
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should expand the matrix a bit (probably to match master), but I can do that if you'd rather?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Parking that for a later PR.

- LIBFTDI='1'
- os: osx
osx_image: xcode9.3
compiler: gcc
env:
- TASK='compile'
- CPPUNIT='1.14'
- PROTOBUF='latest'
- LIBFTDI='1'
- os: linux
dist: xenial
Expand Down Expand Up @@ -236,6 +238,22 @@ matrix:
- TASK='compile'
- CPPUNIT='1.14'
- LIBFTDI='1'
- os: osx
osx_image: xcode9.3
compiler: clang
env:
- TASK='compile'
- CPPUNIT='1.14'
- LIBFTDI='1'
- PROTOBUF='latest'
- os: osx
osx_image: xcode9.3
compiler: gcc
env:
- TASK='compile'
- CPPUNIT='1.14'
- LIBFTDI='1'
- PROTOBUF='latest'
- os: linux
dist: xenial
compiler: gcc
Expand Down Expand Up @@ -286,7 +304,8 @@ before_cache:

install:
# Match the version of protobuf being installed via apt
- pip install --user protobuf==3.1.0
  - if [[ "$PROTOBUF" == "latest" ]]; then pip install --user protobuf; fi
- if [[ "$PROTOBUF" != "latest" ]]; then pip install --user protobuf==3.1.0; fi
# disable until can be added to all build variants
#- pip install --user timeout-decorator
# We need to use pip rather than apt on Xenial
Expand All @@ -303,10 +322,12 @@ before_install:
#Fix a broken homebrew python upgrade - see https://github.com/Homebrew/homebrew-core/issues/26358
- if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then brew upgrade python || true; fi
- if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then if [ ! -d /usr/local/sbin ]; then sudo mkdir -p /usr/local/sbin && sudo chown -R $(whoami) /usr/local/sbin; fi; fi
- if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then brew install ccache bison flex protobuf@3.1 liblo libmicrohttpd; fi # ossp-uuid, homebrew/python/numpy and libusb already present
- if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then brew install ccache bison flex liblo libmicrohttpd; fi # ossp-uuid, homebrew/python/numpy and libusb already present
- if [ "$TRAVIS_OS_NAME" == "osx" -a "$LIBFTDI" != "1" ]; then brew install libftdi0; fi # install libftdi0
- if [ "$TRAVIS_OS_NAME" == "osx" -a "$LIBFTDI" == "1" ]; then brew install libftdi; fi # install the latest libftdi
- if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then brew link -f protobuf@3.1; export PKG_CONFIG_PATH=/usr/local/opt/protobuf@3.1/lib/pkgconfig; brew install --build-from-source --ignore-dependencies --env=std protobuf-c; fi # While protobuf is not on the latest release
- if [ "$TRAVIS_OS_NAME" == "osx" -a "$PROTOBUF" == "latest" ]; then brew install protobuf; fi
- if [ "$TRAVIS_OS_NAME" == "osx" -a "$PROTOBUF" != "latest" ]; then brew install protobuf@3.6; fi
- if [ "$TRAVIS_OS_NAME" == "osx" -a "$PROTOBUF" != "latest" ]; then brew link -f protobuf@3.6; export PKG_CONFIG_PATH=/usr/local/opt/protobuf@3.6/lib/pkgconfig; brew install --build-from-source --ignore-dependencies --env=std protobuf-c; fi # When protobuf is not on the latest release
- if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then mkdir -p ${HOME}/Library/Python/2.7/lib/python/site-packages; echo 'import site; site.addsitedir("/usr/local/lib/python2.7/site-packages")' >> ${HOME}/Library/Python/2.7/lib/python/site-packages/homebrew.pth; fi
- if [ "$TRAVIS_OS_NAME" == "osx" -a "$CPPUNIT" != "1.14" ]; then brew install https://raw.githubusercontent.com/Homebrew/homebrew-core/e6e43cf6a3%5E/Formula/cppunit.rb; fi # install a slightly older cppunit, as latest needs C++11 support
- if [ "$TRAVIS_OS_NAME" == "osx" -a "$CPPUNIT" == "1.14" ]; then brew install cppunit; fi # install the latest cppunit, which needs C++11
Expand Down
1 change: 1 addition & 0 deletions AUTHORS
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ Contributors:
Hakan Lindestaf, Renard plugin
Harry F, for the Eurolite USB Pro code
Heikki Junnila, bug fixes for the debian packaging files
Jannis Achstetter, compile fixes for newer dependencies
Laurent (Renzo), Debian packages, FreeBSD & RDM testing.
Lukas Erlinghagen, win32 port.
Johan Nilsson, Philips Hue trigger config
Expand Down
2 changes: 2 additions & 0 deletions NEWS
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,8 @@ x/y/2019 ola-0.10.8
Python API
* Renamed RESONSE_INVALID_DESTINATION(sic) to RESPONSE_INVALID_DESTINATION in
the ArduinoWidget code
* Fix compatibility with ncurses 6
* Fix compatibility with Protobuf 3.7 and newer (tested with up to 3.11.4)

Internal:
*
Expand Down
3 changes: 0 additions & 3 deletions config/ola.m4
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,6 @@ AC_DEFUN([PROTOBUF_SUPPORT],
AC_REQUIRE_CPP()
PKG_CHECK_MODULES(libprotobuf, [protobuf >= $1])

PKG_CHECK_MODULES(libprotobuf2, [protobuf < 3.2], [],
[AC_MSG_ERROR([OLA currently requires protobuf < 3.2, see issue 1192])])

AC_SUBST([libprotobuf_CFLAGS])

AC_ARG_WITH([protoc],
Expand Down
3 changes: 3 additions & 0 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -858,6 +858,9 @@ AS_IF([test "${enable_rdm_tests}" = "yes"],
AS_IF([test "x$build_java_libs" = xyes],
[PROTOBUF_SUPPORT([2.4.0])],
[PROTOBUF_SUPPORT([2.3.0])])
# Version 3.7 and above of protoc require some additional includes
AC_CHECK_HEADERS([google/protobuf/io/strtod.h google/protobuf/stubs/logging.h \
google/protobuf/stubs/stl_util.h])


# Doxygen
Expand Down
20 changes: 20 additions & 0 deletions protoc/CppFileGenerator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -196,13 +196,16 @@ void FileGenerator::GenerateBuildDescriptors(Printer* printer) {
"assigndescriptorsname", GlobalAssignDescriptorsName(m_output_name));
printer->Indent();

// No longer needed since protobuf 3.7
#if GOOGLE_PROTOBUF_VERSION < 3007000
// Make sure the file has found its way into the pool. If a descriptor
// is requested *during* static init then AddDescriptors() may not have
// been called yet, so we call it manually. Note that it's fine if
// AddDescriptors() is called multiple times.
printer->Print(
"$adddescriptorsname$();\n",
"adddescriptorsname", GlobalAddDescriptorsName(m_file->name()));
#endif

// Get the file's descriptor from the pool.
printer->Print(
Expand All @@ -228,6 +231,10 @@ void FileGenerator::GenerateBuildDescriptors(Printer* printer) {
// protobuf_AssignDescriptorsOnce(): The first time it is called, calls
// AssignDescriptors(). All later times, waits for the first call to
// complete and then returns.

// We need to generate different code, depending on the version
// of protobuf we compile against
#if GOOGLE_PROTOBUF_VERSION < 3007000
printer->Print(
"namespace {\n"
"\n"
Expand All @@ -241,6 +248,19 @@ void FileGenerator::GenerateBuildDescriptors(Printer* printer) {
"assigndescriptorsname", GlobalAssignDescriptorsName(m_output_name));

printer->Print("} // namespace\n");
#else
printer->Print(
"namespace {\n"
"\n"
"inline void protobuf_AssignDescriptorsOnce() {\n"
" static ::google::protobuf::internal::once_flag once;\n"
" ::google::protobuf::internal::call_once(once,\n"
" &$assigndescriptorsname$);\n"
"}\n"
"\n",
"assigndescriptorsname", GlobalAssignDescriptorsName(m_output_name));
printer->Print("} // namespace\n");
#endif
}
}

Expand Down
3 changes: 3 additions & 0 deletions protoc/GeneratorHelpers.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -104,10 +104,13 @@ string FilenameIdentifier(const string& filename) {
return result;
}

// No longer needed since protobuf 3.7
#if GOOGLE_PROTOBUF_VERSION < 3007000
// Return the name of the AddDescriptors() function for a given file.
string GlobalAddDescriptorsName(const string& filename) {
return "protobuf_AddDesc_" + FilenameIdentifier(filename);
}
#endif

// Return the name of the AssignDescriptors() function for a given file.
string GlobalAssignDescriptorsName(const string& filename) {
Expand Down
3 changes: 3 additions & 0 deletions protoc/GeneratorHelpers.h
Original file line number Diff line number Diff line change
Expand Up @@ -67,8 +67,11 @@ string StripProto(const string& filename);
// Convert a file name into a valid identifier.
string FilenameIdentifier(const string& filename);

// No longer needed since protobuf 3.7
#if GOOGLE_PROTOBUF_VERSION < 3007000
// Return the name of the AddDescriptors() function for a given file.
string GlobalAddDescriptorsName(const string& filename);
#endif

// Return the name of the AssignDescriptors() function for a given file.
string GlobalAssignDescriptorsName(const string& filename);
Expand Down
15 changes: 15 additions & 0 deletions protoc/StrUtil.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,21 @@

#include "protoc/StrUtil.h"

#if HAVE_CONFIG_H
#include <config.h>
#endif // HAVE_CONFIG_H

// Required for Protobuf 3.7 onwards
#ifdef HAVE_GOOGLE_PROTOBUF_IO_STRTOD_H
#include <google/protobuf/io/strtod.h>
#endif // HAVE_GOOGLE_PROTOBUF_IO_STRTOD_H
#ifdef HAVE_GOOGLE_PROTOBUF_STUBS_LOGGING_H
#include <google/protobuf/stubs/logging.h>
#endif // HAVE_GOOGLE_PROTOBUF_STUBS_LOGGING_H
#ifdef HAVE_GOOGLE_PROTOBUF_STUBS_STL_UTIL_H
#include <google/protobuf/stubs/stl_util.h>
#endif // HAVE_GOOGLE_PROTOBUF_STUBS_STL_UTIL_H

#ifdef _WIN32
// MSVC has only _snprintf, not snprintf.
//
Expand Down
8 changes: 4 additions & 4 deletions python/examples/ola_rdm_get.py
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,7 @@ def do_subdevice(self, line):
return
self._sub_device = sub_device

def do_print(self, l):
def do_print(self, line):
"""Prints the current universe, UID and sub device."""
print(textwrap.dedent("""\
Universe: %d
Expand All @@ -193,7 +193,7 @@ def do_print(self, l):
self._uid,
self._sub_device)))

def do_uids(self, l):
def do_uids(self, line):
"""List the UIDs for this universe."""
self.client.FetchUIDList(self._universe, self._DisplayUids)
self.wrapper.Run()
Expand All @@ -206,12 +206,12 @@ def _DisplayUids(self, state, uids):
print(str(uid))
self.wrapper.Stop()

def do_full_discovery(self, l):
def do_full_discovery(self, line):
"""Run full RDM discovery for this universe."""
self.client.RunRDMDiscovery(self._universe, True, self._DiscoveryDone)
self.wrapper.Run()

def do_incremental_discovery(self, l):
def do_incremental_discovery(self, line):
"""Run incremental RDM discovery for this universe."""
self.client.RunRDMDiscovery(self._universe, False, self._DiscoveryDone)
self.wrapper.Run()
Expand Down
8 changes: 4 additions & 4 deletions scripts/enforce_licence.py
Original file line number Diff line number Diff line change
Expand Up @@ -144,8 +144,8 @@ def TransformCppToJsLicence(licence):
lines = licence.split('\n')
output = []
output.append('/**')
for l in lines[1:]:
output.append(TransformJsLine(l[2:]))
for s in lines[1:]:
output.append(TransformJsLine(s[2:]))
return '\n'.join(output)


Expand All @@ -162,8 +162,8 @@ def TransformCppToPythonLicence(licence):
"""Change a C++ licence to Python style"""
lines = licence.split('\n')
output = []
for l in lines[1:]:
output.append(TransformPythonLine(l[3:]))
for s in lines[1:]:
output.append(TransformPythonLine(s[3:]))
return '\n'.join(output)


Expand Down
2 changes: 1 addition & 1 deletion tools/rdm/TestLogger.py
Original file line number Diff line number Diff line change
Expand Up @@ -199,7 +199,7 @@ def _FormatData(self, test_data, requested_category, requested_test_state,
if include_description:
results_log.append(str(test['doc']))
if include_debug:
results_log.extend(str(l) for l in test.get('debug', []))
results_log.extend(str(s) for s in test.get('debug', []))
results_log.append('')
warnings.extend(str(s) for s in test.get('warnings', []))
advisories.extend(str(s) for s in test.get('advisories', []))
Expand Down