build: switch to python3
Refs: #5095
Change-Id: Iedc107d41d4832682071986678b015980354786d
diff --git a/.jenkins b/.jenkins
index 78e1ca1..934aceb 100755
--- a/.jenkins
+++ b/.jenkins
@@ -3,7 +3,7 @@
nanos() {
# Cannot use date(1) because macOS does not support %N format specifier
- python -c 'import time; print(int(time.time() * 1e9))'
+ python3 -c 'import time; print(int(time.time() * 1e9))'
}
for file in .jenkins.d/*; do
diff --git a/.jenkins.d/00-deps.sh b/.jenkins.d/00-deps.sh
index ae45ce5..187f595 100755
--- a/.jenkins.d/00-deps.sh
+++ b/.jenkins.d/00-deps.sh
@@ -8,24 +8,31 @@
if has OSX $NODE_LABELS; then
FORMULAE=(boost openssl pkg-config)
- brew update
- if [[ -n $TRAVIS ]]; then
- # Travis images come with a large number of brew packages
- # pre-installed, don't waste time upgrading all of them
- for FORMULA in "${FORMULAE[@]}"; do
- brew outdated $FORMULA || brew upgrade $FORMULA
- done
- else
- brew upgrade
+ if has OSX-10.13 $NODE_LABELS || has OSX-10.14 $NODE_LABELS; then
+ FORMULAE+=(python)
fi
- brew install "${FORMULAE[@]}"
- brew cleanup
+
+ if [[ -n $TRAVIS ]]; then
+ # Travis images come with a large number of pre-installed
+ # brew packages, don't waste time upgrading all of them
+ brew list --versions "${FORMULAE[@]}" || brew update
+ for FORMULA in "${FORMULAE[@]}"; do
+ brew list --versions "$FORMULA" || brew install "$FORMULA"
+ done
+ # Ensure /usr/local/opt/openssl exists
+ brew reinstall openssl
+ else
+ brew update
+ brew upgrade
+ brew install "${FORMULAE[@]}"
+ brew cleanup
+ fi
fi
if has Ubuntu $NODE_LABELS; then
sudo apt-get -qq update
- sudo apt-get -qy install build-essential pkg-config libboost-all-dev \
- libsqlite3-dev libssl-dev
+ sudo apt-get -qy install build-essential pkg-config python3-minimal \
+ libboost-all-dev libssl-dev libsqlite3-dev
if [[ $JOB_NAME == *"code-coverage" ]]; then
sudo apt-get -qy install gcovr lcov libgd-perl
diff --git a/.jenkins.d/01-ndn-cxx.sh b/.jenkins.d/01-ndn-cxx.sh
new file mode 100755
index 0000000..f10956c
--- /dev/null
+++ b/.jenkins.d/01-ndn-cxx.sh
@@ -0,0 +1,12 @@
+#!/usr/bin/env bash
+set -e
+
+JDIR=$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )
+source "$JDIR"/util.sh
+
+set -x
+
+sudo rm -f /usr/local/bin/ndnsec*
+sudo rm -fr /usr/local/include/ndn-cxx
+sudo rm -f /usr/local/lib{,64}/libndn-cxx*
+sudo rm -f /usr/local/lib{,64}/pkgconfig/libndn-cxx.pc
diff --git a/.jenkins.d/10-build.sh b/.jenkins.d/10-build.sh
index 3d2e3bb..024b6e0 100755
--- a/.jenkins.d/10-build.sh
+++ b/.jenkins.d/10-build.sh
@@ -6,10 +6,8 @@
set -x
-sudo rm -f /usr/local/bin/ndnsec*
-sudo rm -fr /usr/local/include/ndn-cxx
-sudo rm -f /usr/local/lib{,64}/libndn-cxx*
-sudo rm -f /usr/local/lib{,64}/pkgconfig/libndn-cxx.pc
+git submodule sync
+git submodule update --init
if [[ $JOB_NAME == *"code-coverage" ]]; then
COVERAGE="--with-coverage"
@@ -17,23 +15,20 @@
ASAN="--with-sanitizer=address"
fi
-# Cleanup
-sudo_preserve_env PATH -- ./waf --color=yes distclean
-
if [[ $JOB_NAME != *"code-coverage" && $JOB_NAME != *"limited-build" ]]; then
# Build static library in release mode with tests and without precompiled headers
./waf --color=yes configure --enable-static --disable-shared --with-tests --without-pch
./waf --color=yes build -j${WAF_JOBS:-1}
# Cleanup
- sudo_preserve_env PATH -- ./waf --color=yes distclean
+ ./waf --color=yes distclean
# Build static and shared library in release mode without tests
./waf --color=yes configure --enable-static --enable-shared
./waf --color=yes build -j${WAF_JOBS:-1}
# Cleanup
- sudo_preserve_env PATH -- ./waf --color=yes distclean
+ ./waf --color=yes distclean
fi
# Build shared library in debug mode with tests and examples
diff --git a/.jenkins.d/20-tests.sh b/.jenkins.d/20-tests.sh
index ec4461b..9c30a19 100755
--- a/.jenkins.d/20-tests.sh
+++ b/.jenkins.d/20-tests.sh
@@ -15,7 +15,7 @@
ndnsec-keygen "/tmp/jenkins/$NODE_NAME" | ndnsec-install-cert -
-BOOST_VERSION=$(python -c "import sys; sys.path.append('build/c4che'); import _cache; print(_cache.BOOST_VERSION_NUMBER);")
+BOOST_VERSION=$(python3 -c "import sys; sys.path.append('build/c4che'); import _cache; print(_cache.BOOST_VERSION_NUMBER);")
ut_log_args() {
if (( BOOST_VERSION >= 106200 )); then
diff --git a/.travis.yml b/.travis.yml
index f991bb9..569f3f4 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -97,12 +97,6 @@
export DISABLE_ASAN=yes
;;
esac
- if [[ ${TRAVIS_OS_NAME} == osx ]]; then
- # Do not waste time upgrading useless packages
- brew pin cgal gdal postgis sfcgal || true
- # Ensure /usr/local/opt/openssl exists
- brew reinstall openssl || true
- fi
- ${CXX:-c++} --version
script:
diff --git a/docs/INSTALL.rst b/docs/INSTALL.rst
index 4156a5e..aa43bd6 100644
--- a/docs/INSTALL.rst
+++ b/docs/INSTALL.rst
@@ -24,7 +24,7 @@
- Fedora >= 24
- Gentoo Linux
- Raspbian >= 2017-08-16
-- FreeBSD 11.2
+- FreeBSD >= 11.3
Prerequisites
-------------
@@ -33,20 +33,31 @@
~~~~~~~~~
- GCC >= 5.3, or clang >= 3.6
-- ``python2`` >= 2.7, or ``python3`` >= 3.4
-- Boost libraries >= 1.58
+- Python >= 3.5
- ``pkg-config``
-- SQLite 3.x
+- Boost >= 1.58
- OpenSSL >= 1.0.2
-- Apple Security framework (on macOS only)
+- SQLite 3.x
-Following are the detailed steps for each platform to install the compiler, all necessary
-development tools and libraries, and ndn-cxx prerequisites.
+Following are the detailed steps for each platform to install the compiler and all necessary
+development tools and libraries that are required to build ndn-cxx from source.
+
+- Ubuntu
+
+ In a terminal, enter::
+
+ sudo apt install build-essential pkg-config python3-minimal libboost-all-dev libssl-dev libsqlite3-dev
+
+- Fedora
+
+ In a terminal, enter::
+
+ sudo yum install gcc-g++ boost-devel openssl-devel sqlite-devel
- macOS
- * Install Xcode from the App Store, or at least the Command Line Tools
- (``xcode-select --install``)
+ * Install either Xcode (from the App Store) or the Command Line Tools
+ (with ``xcode-select --install``)
* If using Homebrew (recommended), enter the following in a terminal::
@@ -57,23 +68,11 @@
If a major OS upgrade is performed after installing the dependencies
with Homebrew, remember to reinstall all packages.
-- Ubuntu
-
- In a terminal, enter::
-
- sudo apt install build-essential libboost-all-dev libssl-dev libsqlite3-dev pkg-config python-minimal
-
-- Fedora
-
- In a terminal, enter::
-
- sudo yum install gcc-g++ sqlite-devel boost-devel openssl-devel
-
- FreeBSD
In a terminal, enter::
- sudo pkg install python pkgconf sqlite3 boost-libs
+ sudo pkg install pkgconf python3 boost-libs openssl sqlite3
Optional:
~~~~~~~~~
@@ -83,15 +82,10 @@
- ``doxygen``
- ``graphviz``
-- ``python-sphinx``
+- ``sphinx``
- ``sphinxcontrib-doxylink``
-The following lists steps for common platforms to install these prerequisites:
-
-- On macOS with Homebrew and pip::
-
- brew install doxygen graphviz
- sudo pip install sphinx sphinxcontrib-doxylink
+The following lists the steps to install these prerequisites on various common platforms.
- On Ubuntu::
@@ -103,9 +97,14 @@
sudo yum install doxygen graphviz python-sphinx
sudo pip install sphinxcontrib-doxylink
+- On macOS::
+
+ brew install doxygen graphviz
+ sudo pip install sphinx sphinxcontrib-doxylink
+
- On FreeBSD::
- sudo pkg install doxygen graphviz py27-sphinx
+ sudo pkg install doxygen graphviz py37-sphinx
.. _build:
diff --git a/docs/conf.py b/docs/conf.py
index 7e73680..2e3a1df 100644
--- a/docs/conf.py
+++ b/docs/conf.py
@@ -58,12 +58,7 @@
sys.stderr.write("Extension '%s' not found. "
"Some documentation may not build correctly.\n" % extension)
-if sys.version_info[0] >= 3:
- addExtensionIfExists('sphinxcontrib.doxylink')
-
-# sphinxcontrib.googleanalytics is currently not working with the latest version of Sphinx
-# if os.getenv('GOOGLE_ANALYTICS', None):
-# addExtensionIfExists('sphinxcontrib.googleanalytics')
+addExtensionIfExists('sphinxcontrib.doxylink')
# The master toctree document.
master_doc = 'index'
@@ -157,7 +152,3 @@
extlinks = {
'issue': ('https://redmine.named-data.net/issues/%s', 'issue #'),
}
-
-if os.getenv('GOOGLE_ANALYTICS', None):
- googleanalytics_id = os.environ['GOOGLE_ANALYTICS']
- googleanalytics_enabled = True
diff --git a/docs/release-notes/release-notes-0.2.0.rst b/docs/release-notes/release-notes-0.2.0.rst
index 0a8c10f..26ab722 100644
--- a/docs/release-notes/release-notes-0.2.0.rst
+++ b/docs/release-notes/release-notes-0.2.0.rst
@@ -10,16 +10,16 @@
- **Base**
- + The license under which the library is released is changed to **Lesser GNU Public
- License version 3.0**.
+ + The license under which the library is released is changed to the **GNU Lesser
+ General Public License version 3.0**
+ New ways to use incoming Interest dispatching:
* New :ndn-cxx:`InterestFilter` abstraction that supports filtering based on name
prefixes and regular expressions.
- * Separated :ndn-cxx:`Face::registerPrefix()` and :ndn-cxx:`Face::setInterestFilter()`
- methods allow distinct operations of registering with the local NDN forwarder and setting
+ * Separate ``Face::registerPrefix()`` and ``Face::setInterestFilter()`` methods
+ allow distinct operations of registering with the local NDN forwarder and setting
up application-specific ``OnInterest`` call dispatch using InterestFilters.
+ Add support for new `NDN naming conventions
@@ -41,22 +41,21 @@
- **Wire encoding**
- + :ndn-cxx:`Data::getFullName() <getFullName()>` method to get :ndn-cxx:`Data` packet
- name with implicit digest
+ + ``Data::getFullName()`` method to get the Data packet name including the implicit digest
- + New :ndn-cxx:`Name::getSuccessor()` method to get name successor (:issue:`1677`)
+ + ``Name::getSuccessor()`` method to get name successor (:issue:`1677`)
+ New in-wire refreshing of Interest's nonce (:issue:`1758`)
- **Management**
- + Support for :ndn-cxx:`ChannelStatus`, :ndn-cxx:`StrategyChoice` datasets
+ + Support for :ndn-cxx:`ChannelStatus` and :ndn-cxx:`StrategyChoice` datasets
+ Defining new common Route Origins for NFD RIB management protocol (:issue:`1719`)
- + New RibEntry and Route data structures for RIB management protocol (:issue:`1764`)
+ + New ``RibEntry`` and ``Route`` data structures for RIB management protocol (:issue:`1764`)
- + Add support for RIB flags for setInterestFilter and registerPrefix (:issue:`1842`)
+ + Add support for RIB flags in ``setInterestFilter()`` and ``registerPrefix()`` (:issue:`1842`)
- **Miscellaneous tools**
@@ -71,7 +70,7 @@
- **Build**
- + enabled support of precompiled headers for clang and gcc compilers to speed up compilation
+ + Enabled support of precompiled headers for clang and gcc compilers to speed up compilation
Updates and bug fixes:
^^^^^^^^^^^^^^^^^^^^^^
@@ -84,13 +83,13 @@
:ndn-cxx:`Face::put` methods (:issue:`1774`)
+ Cleaning up transport state on communication failure, so Face can try to reconnect
- in the future.
+ in the future
- + Fix bug with Face::removePendingInterest (:issue:`1917`)
+ + Fix bug in ``Face::removePendingInterest`` (:issue:`1917`)
- **Wire encoding**
- + Nonce field is now encoded as 4-byte uint8_t value, as defined by NDN-TLV spec.
+ + The Nonce field is now encoded as a 4-byte value, as defined by NDN-TLV spec
+ Optimized Data packet signing
@@ -104,27 +103,27 @@
- **Management**
- + Add link-layer byte counts in FaceStatus data structure (:issue:`1765`)
+ + Add link-layer byte counts in ``FaceStatus`` data structure (:issue:`1765`)
- **Security**
+ Allow user to explicitly specify the cert name prefix before 'KEY' component in
``ndnsec-certgen``
- + ``SignatureSha256`` has been renamed to :ndn-cxx:`DigestSha256` to conform with
- `NDN-TLV specification <http://named-data.net/doc/ndn-tlv/>`_.
+ + ``SignatureSha256`` has been renamed to :ndn-cxx:`DigestSha256` to conform to
+ `NDN-TLV specification <http://named-data.net/doc/ndn-tlv/>`_
- + Add checking of ``Timestamp`` and ``Nonce`` fields in signed Interest within
+ + Add checking of Timestamp and Nonce fields in signed Interest within
:ndn-cxx:`ValidatorConfig`
- + Allow validator customization using hooks:
+ + Allow validator customization using hooks.
Sub-classes of :ndn-cxx:`Validator` class can use the following hooks to fine-tune the
validation process:
- * ``preCertificateValidation`` to process received certificate before validation.
+ * ``preCertificateValidation`` to process received certificate before validation
* ``onTimeout`` to process interest timeout
- * ``afterCheckPolicy`` to process validation requests.
+ * ``afterCheckPolicy`` to process validation requests
+ Fix memory issues in ``SecPublicInfoSqlite3``
@@ -164,7 +163,7 @@
Removed:
^^^^^^^^
-- support of ndnd-tlv (only NFD management protocol is supported now)
+- Support for ndnd-tlv (only NFD management protocol is supported now)
- ``SecPublicInfoMemory`` and ``SecTpmMemory`` classes that were no longer used
diff --git a/docs/release-notes/release-notes-0.6.1.rst b/docs/release-notes/release-notes-0.6.1.rst
index 2770915..c1f5a4f 100644
--- a/docs/release-notes/release-notes-0.6.1.rst
+++ b/docs/release-notes/release-notes-0.6.1.rst
@@ -13,50 +13,40 @@
- New signal in :ndn-cxx:`SegmentFetcher` to notify retrieval of Data segments
(:issue:`4438`)
-- Initial support for the Content Store management protocol
- (:issue:`4050`)
+- Initial support for the Content Store management protocol (:issue:`4050`)
- Literal operators for ``time::duration`` types, such as ``1_s``, ``42_ms``, ``30_days``
(:issue:`4468`)
- Support for BLAKE2 hash function (requires OpenSSL >= 1.1.0)
-- A ``escape()`` helper function complementing the existing ``unescape()`` (:issue:`4484`)
+- An ``escape()`` helper function complementing the existing ``unescape()`` (:issue:`4484`)
Improvements and bug fixes
^^^^^^^^^^^^^^^^^^^^^^^^^^
- ``ndnsec key-gen`` command line now allows customization of key ID (:issue:`4294`)
-- Fixed encoding of ``'~'`` and ``'+'`` in :ndn-cxx:`Component::toUri()`
- (:issue:`4484`)
+- Fixed encoding of ``'~'`` and ``'+'`` in ``name::Component::toUri()`` (:issue:`4484`)
-- Fixed handling of large dates when converting to/from string
- (:issue:`4478`, :issue:`3915`)
+- Fixed handling of large dates when converting to/from string (:issue:`4478`, :issue:`3915`)
-- Fixed error handling in :ndn-cxx:`KeyChain::importSafeBag()`
- (:issue:`4359`)
+- Fixed error handling in ``KeyChain::importSafeBag()`` (:issue:`4359`)
-- Fixed parsing of IPv6 addresses with scope-id
- (:issue:`4474`)
+- Fixed parsing of IPv6 addresses with scope-id (:issue:`4474`)
-- :ndn-cxx:`io::load()` now handles empty files properly
- (:issue:`4434`)
+- ``io::load()`` now handles empty files properly (:issue:`4434`)
-- Switched to using `boost::asio::basic_waitable_timer`
- (:issue:`4431`)
+- Switched to using ``boost::asio::basic_waitable_timer`` (:issue:`4431`)
-- Allow linking multiple :ndn-cxx:`DummyClientFace` instances together to emulate a broadcast medium
- (:issue:`3913`)
+- Allow linking multiple :ndn-cxx:`DummyClientFace` instances together to emulate a broadcast
+ medium (:issue:`3913`)
-- Fixed build when ``std::to_string`` is not available
- (:issue:`4393`)
+- Fixed build when ``std::to_string`` is not available (:issue:`4393`)
-- Avoid undefined behavior when casting to :ndn-cxx:`tlv::SignatureTypeValue`
- (:issue:`4370`)
+- Avoid undefined behavior when casting to :ndn-cxx:`tlv::SignatureTypeValue` (:issue:`4370`)
-- Fixed compilation with Boost 1.66.0
- (:issue:`4422`)
+- Fixed compilation with Boost 1.66.0 (:issue:`4422`)
- Various documentation updates
(:issue:`3918`, :issue: `4184`, :issue: `4275`)
@@ -64,6 +54,4 @@
Removed
^^^^^^^
-- Removed obsolete TLV-TYPE constants
- (:issue:`4055`, :issue:`3098`, :issue: `3755`)
-
+- Removed obsolete TLV-TYPE constants (:issue:`4055`, :issue:`3098`, :issue: `3755`)
diff --git a/waf b/waf
index 7ceee16..a1c5c96 100755
--- a/waf
+++ b/waf
@@ -1,4 +1,4 @@
-#!/usr/bin/env python
+#!/usr/bin/env python3
# encoding: latin-1
# Thomas Nagy, 2005-2018
#