ci: sync with ndn-cxx
Change-Id: I2febf1fd7e8000d077383fd495b8b1b82e284477
diff --git a/.jenkins b/.jenkins
index 92b9dae..1fa2f02 100755
--- a/.jenkins
+++ b/.jenkins
@@ -10,13 +10,17 @@
fi
export ID VERSION_ID
export ID_LIKE="${ID} ${ID_LIKE} linux"
- export PATH="${HOME}/.local/bin${PATH:+:}${PATH}"
+ if [[ -z $GITHUB_ACTIONS ]]; then
+ export PATH="${HOME}/.local/bin${PATH:+:}${PATH}"
+ fi
;;
Darwin)
# Emulate a subset of os-release(5)
export ID=macos
export VERSION_ID=$(sw_vers -productVersion)
- export PATH="/usr/local/bin${PATH:+:}${PATH}"
+ if [[ -z $GITHUB_ACTIONS ]]; then
+ export PATH="/usr/local/bin${PATH:+:}${PATH}"
+ fi
if [[ -x /opt/homebrew/bin/brew ]]; then
eval "$(/opt/homebrew/bin/brew shellenv)"
elif [[ -x /usr/local/bin/brew ]]; then
@@ -27,9 +31,9 @@
export CACHE_DIR=${CACHE_DIR:-/tmp}
-if [[ $JOB_NAME == *"code-coverage" ]]; then
- export DISABLE_ASAN=yes
- export DISABLE_HEADERS_CHECK=yes
+if [[ $JOB_NAME == *code-coverage ]]; then
+ export DISABLE_ASAN=1
+ export DISABLE_HEADERS_CHECK=1
fi
# https://reproducible-builds.org/docs/source-date-epoch/
diff --git a/.jenkins.d/00-deps.sh b/.jenkins.d/00-deps.sh
index 3f3235a..b94cec8 100755
--- a/.jenkins.d/00-deps.sh
+++ b/.jenkins.d/00-deps.sh
@@ -15,26 +15,41 @@
libboost-thread-dev
libsqlite3-dev
libssl-dev
- pkg-config
+ pkgconf
python3
)
+DNF_PKGS=(
+ boost-devel
+ gcc-c++
+ libasan
+ lld
+ openssl-devel
+ pkgconf
+ python3
+ sqlite-devel
+)
FORMULAE=(boost openssl pkgconf)
-PIP_PKGS=()
case $JOB_NAME in
*code-coverage)
- APT_PKGS+=(lcov python3-pip)
- PIP_PKGS+=('gcovr~=5.2')
+ APT_PKGS+=(lcov)
;;
*Docs)
- APT_PKGS+=(doxygen graphviz python3-pip)
+ APT_PKGS+=(doxygen graphviz)
FORMULAE+=(doxygen graphviz)
- PIP_PKGS+=(sphinx sphinxcontrib-doxylink)
;;
esac
+install_uv() {
+ if [[ -z $GITHUB_ACTIONS && $ID_LIKE == *debian* ]]; then
+ sudo apt-get install -qy --no-install-recommends pipx
+ pipx upgrade uv || pipx install uv
+ fi
+}
+
set -x
if [[ $ID == macos ]]; then
+ export HOMEBREW_COLOR=1
export HOMEBREW_NO_ENV_HINTS=1
if [[ -n $GITHUB_ACTIONS ]]; then
export HOMEBREW_NO_INSTALLED_DEPENDENTS_CHECK=1
@@ -45,10 +60,17 @@
sudo apt-get update -qq
sudo apt-get install -qy --no-install-recommends "${APT_PKGS[@]}"
elif [[ $ID_LIKE == *fedora* ]]; then
- sudo dnf install -y gcc-c++ libasan lld pkgconf-pkg-config python3 \
- boost-devel openssl-devel sqlite-devel
+ sudo dnf install -y "${DNF_PKGS[@]}"
fi
-if (( ${#PIP_PKGS[@]} )); then
- pip3 install --user --upgrade --upgrade-strategy=eager "${PIP_PKGS[@]}"
-fi
+case $JOB_NAME in
+ *code-coverage)
+ install_uv
+ ;;
+ *Docs)
+ install_uv
+ export FORCE_COLOR=1
+ export UV_NO_MANAGED_PYTHON=1
+ uv tool install sphinx --upgrade --with-requirements docs/requirements.txt
+ ;;
+esac
diff --git a/.jenkins.d/10-build.sh b/.jenkins.d/10-build.sh
index f2ba812..d3fe14d 100755
--- a/.jenkins.d/10-build.sh
+++ b/.jenkins.d/10-build.sh
@@ -4,13 +4,13 @@
if [[ -z $DISABLE_ASAN ]]; then
ASAN="--with-sanitizer=address"
fi
-if [[ $JOB_NAME == *"code-coverage" ]]; then
+if [[ $JOB_NAME == *code-coverage ]]; then
COVERAGE="--with-coverage"
fi
set -x
-if [[ $JOB_NAME != *"code-coverage" && $JOB_NAME != *"limited-build" ]]; then
+if [[ $JOB_NAME != *code-coverage && $JOB_NAME != *limited-build ]]; then
# Build in release mode with tests
./waf --color=yes configure --with-tests
./waf --color=yes build
@@ -30,7 +30,5 @@
./waf --color=yes configure --debug --with-chronosync --with-psync --with-svs --with-tests $ASAN $COVERAGE
./waf --color=yes build
-# (tests will be run against the debug version)
-
# Install
sudo ./waf --color=yes install
diff --git a/.jenkins.d/30-coverage.sh b/.jenkins.d/30-coverage.sh
index c758aaa..4432716 100755
--- a/.jenkins.d/30-coverage.sh
+++ b/.jenkins.d/30-coverage.sh
@@ -1,30 +1,36 @@
#!/usr/bin/env bash
-set -exo pipefail
+set -eo pipefail
-if [[ $JOB_NAME == *"code-coverage" ]]; then
- # Generate an XML report (Cobertura format) and a detailed HTML report using gcovr
- # Note: trailing slashes are important in the paths below. Do not remove them!
- gcovr --object-directory build \
- --filter src/ \
- --exclude-throw-branches \
- --exclude-unreachable-branches \
- --cobertura build/coverage.xml \
- --html-details build/gcovr/ \
- --print-summary
+[[ $JOB_NAME == *code-coverage ]] || exit 0
- # Generate a detailed HTML report using lcov
- lcov --quiet \
- --capture \
- --directory . \
- --exclude "$PWD/tests/*" \
- --no-external \
- --rc lcov_branch_coverage=1 \
- --output-file build/coverage.info
+export FORCE_COLOR=1
+export UV_NO_MANAGED_PYTHON=1
- genhtml --branch-coverage \
- --demangle-cpp \
- --legend \
- --output-directory build/lcov \
- --title "NLSR unit tests" \
- build/coverage.info
-fi
+set -x
+
+# Generate an XML report (Cobertura format) and a detailed HTML report using gcovr
+# Note: trailing slashes are important in the paths below. Do not remove them!
+uvx gcovr@5.2 \
+ --object-directory build \
+ --filter src/ \
+ --exclude-throw-branches \
+ --exclude-unreachable-branches \
+ --cobertura build/coverage.xml \
+ --html-details build/gcovr/ \
+ --print-summary
+
+# Generate a detailed HTML report using lcov
+lcov --quiet \
+ --capture \
+ --directory . \
+ --exclude "$PWD/tests/*" \
+ --no-external \
+ --rc lcov_branch_coverage=1 \
+ --output-file build/coverage.info
+
+genhtml --branch-coverage \
+ --demangle-cpp \
+ --legend \
+ --output-directory build/lcov \
+ --title "NLSR unit tests" \
+ build/coverage.info
diff --git a/.waf-tools/default-compiler-flags.py b/.waf-tools/default-compiler-flags.py
index 090e65d..48a8874 100644
--- a/.waf-tools/default-compiler-flags.py
+++ b/.waf-tools/default-compiler-flags.py
@@ -11,7 +11,7 @@
conf.start_msg('Checking C++ compiler version')
cxx = conf.env.CXX_NAME # generic name of the compiler
- ccver = tuple(int(i) for i in conf.env.CC_VERSION)
+ ccver = get_compiler_ver(conf)
ccverstr = '.'.join(conf.env.CC_VERSION)
errmsg = ''
warnmsg = ''
@@ -60,6 +60,10 @@
conf.env.DEFINES += generalFlags['DEFINES']
+def get_compiler_ver(conf):
+ return tuple(int(i) for i in conf.env.CC_VERSION)
+
+
@Configure.conf
def check_compiler_flags(conf):
# Debug or optimized CXXFLAGS and LINKFLAGS are applied only if the
@@ -124,9 +128,6 @@
class CompilerFlags:
- def getCompilerVersion(self, conf):
- return tuple(int(i) for i in conf.env.CC_VERSION)
-
def getGeneralFlags(self, conf):
"""Get dict of CXXFLAGS, LINKFLAGS, and DEFINES that are always needed"""
return {'CXXFLAGS': [], 'LINKFLAGS': [], 'DEFINES': []}
@@ -226,7 +227,7 @@
elif Utils.unversioned_sys_platform() == 'freebsd':
# Bug #4790
flags['CXXFLAGS'] += [['-isystem', '/usr/local/include']]
- if self.getCompilerVersion(conf) >= (18, 0, 0):
+ if get_compiler_ver(conf) >= (18, 0, 0) and get_compiler_ver(conf) < (20, 1, 0):
# Bug #5300
flags['CXXFLAGS'] += ['-Wno-enum-constexpr-conversion']
return flags
@@ -240,10 +241,10 @@
flags = super().getDebugFlags(conf)
flags['CXXFLAGS'] += self.__cxxFlags
# Enable assertions in libc++
- if self.getCompilerVersion(conf) >= (18, 0, 0):
+ if get_compiler_ver(conf) >= (18, 0, 0):
# https://libcxx.llvm.org/Hardening.html
flags['DEFINES'] += ['_LIBCPP_HARDENING_MODE=_LIBCPP_HARDENING_MODE_EXTENSIVE']
- elif self.getCompilerVersion(conf) >= (15, 0, 0):
+ elif get_compiler_ver(conf) >= (15, 0, 0):
# https://releases.llvm.org/15.0.0/projects/libcxx/docs/UsingLibcxx.html#enabling-the-safe-libc-mode
flags['DEFINES'] += ['_LIBCPP_ENABLE_ASSERTIONS=1']
# Tell libc++ to avoid including transitive headers
diff --git a/docs/beginners-guide.rst b/docs/beginners-guide.rst
index 0813a10..a77acfe 100644
--- a/docs/beginners-guide.rst
+++ b/docs/beginners-guide.rst
@@ -118,18 +118,18 @@
$ dnf list --installed openssl-devel
-#. pkgconf that replaces pkg-config
-
- ::
-
- $ dnf list --installed pkgconf*
-
#. Boost libraries version 1.71.0 or later
::
$ dnf list --installed boost-devel
+#. pkgconf
+
+ ::
+
+ $ dnf list --installed pkgconf
+
#. git
::
@@ -159,7 +159,7 @@
::
- $ pip install sphinx sphinxcontrib-doxylink
+ $ python3 -m pip install -r docs/requirements.txt
2.2 Downloading and installing ndn-cxx
--------------------------------------
diff --git a/docs/requirements.txt b/docs/requirements.txt
new file mode 100644
index 0000000..1348feb
--- /dev/null
+++ b/docs/requirements.txt
@@ -0,0 +1,3 @@
+docutils>=0.20
+sphinx>=7.0.1,<9
+sphinxcontrib-doxylink~=1.13