CI: stop pinning submodules/dependencies in git
Traditionally, we've been pinning the NETCONF stack via a separate git
repo which was added as a git submodule for `cla-sysrepo` and
`netconf-cli`. This has worked well, but it caused a certain level of
overhead, and it led to possible inconsistencies (e.g.,
`CzechLight/br2-external` has code which tries to guesstimate whether to
pick the submodules from `cla-sysrepo` or `netconf-cli`).
Also, the other repos (`velia` and `rousette`) were always using the
latest master of `CzechLight/dependencies`, and it has worked well.
Change-Id: Ie9bf475c446c4330105c7631f2ab63a0358ca605
diff --git a/.gitmodules b/.gitmodules
index f9bf878..e69de29 100644
--- a/.gitmodules
+++ b/.gitmodules
@@ -1,3 +0,0 @@
-[submodule "submodules/dependencies"]
- path = submodules/dependencies
- url = ../dependencies
diff --git a/.zuul.yaml b/.zuul.yaml
index 01c9920..bed644a 100644
--- a/.zuul.yaml
+++ b/.zuul.yaml
@@ -10,15 +10,20 @@
- f34-gcc-cover:
pre-run: ci/pre.yaml
requires: CzechLight-deps-f34-gcc
+ required-projects: &projects
+ - CzechLight/dependencies
- f34-clang-asan-ubsan:
pre-run: ci/pre.yaml
requires: CzechLight-deps-f34-clang-asan-ubsan
+ required-projects: *projects
- f34-clang-tsan:
pre-run: ci/pre.yaml
requires: CzechLight-deps-f34-clang-tsan
+ required-projects: *projects
- f34-gcc-netconf-cli-no-sysrepo:
pre-run: ci/pre.yaml
requires: CzechLight-deps-f34-gcc
+ required-projects: *projects
- f34-cpp-coverage-diff:
pre-run: ci/pre.yaml
voting: false
@@ -27,6 +32,7 @@
- f34-gcc-cover-previous:
pre-run: ci/pre.yaml
requires: CzechLight-deps-f34-gcc
+ required-projects: *projects
- czechlight-clearfog:
required-projects:
- CzechLight/br2-external
diff --git a/Doxyfile.in b/Doxyfile.in
index 250edfb..dbdefab 100644
--- a/Doxyfile.in
+++ b/Doxyfile.in
@@ -4,6 +4,5 @@
INPUT = @doxy_main_page@ @PROJECT_SOURCE_DIR@ @PROJECT_BINARY_DIR@
FILE_PATTERNS = *.h *.cpp *.md *.cmake *.yang
RECURSIVE = YES
-EXCLUDE = @PROJECT_SOURCE_DIR@/submodules/
EXTRACT_ANON_NSPACES = YES
USE_MDFILE_AS_MAINPAGE = index.md
diff --git a/README.md b/README.md
index 8374eee..19afa58 100644
--- a/README.md
+++ b/README.md
@@ -25,8 +25,6 @@
* optionally, [sysrepo](https://github.com/sysrepo/sysrepo/) **version 2.1** plus the [C++ bindings](https://github.com/sysrepo/sysrepo-cpp) for the local sysrepo backend, and for the comprehensive test suite
* optionally, [netopeer2](https://github.com/CESNET/netopeer2) **version 2.1** for a test suite
-Use an **exact commit** of any dependencies as specified in `submodules/dependencies/*`.
-
The build process uses [CMake](https://cmake.org/runningcmake/).
A quick-and-dirty build with no fancy options can be as simple as `mkdir build && cd build && cmake .. && make && make install`.
diff --git a/ci/build.sh b/ci/build.sh
index 5d9228d..8fc78ea 100755
--- a/ci/build.sh
+++ b/ci/build.sh
@@ -9,7 +9,7 @@
ZUUL_PROJECT_SHORT_NAME=$(jq < ~/zuul-env.json -r '.project.short_name')
ZUUL_GERRIT_HOSTNAME=$(jq < ~/zuul-env.json -r '.project.canonical_hostname')
-CI_PARALLEL_JOBS=$(grep -c '^processor' /proc/cpuinfo)
+CI_PARALLEL_JOBS=$(awk -vcpu=$(getconf _NPROCESSORS_ONLN) 'BEGIN{printf "%.0f", cpu*1.3+1}')
CMAKE_OPTIONS=""
CFLAGS=""
CXXFLAGS=""
@@ -61,25 +61,19 @@
mkdir ${PREFIX}
BUILD_DIR=~/build
mkdir ${BUILD_DIR}
-export PATH=${PREFIX}/bin:$PATH
+export PATH=${PREFIX}/bin:/sbin:/usr/sbin:$PATH
export LD_LIBRARY_PATH=${PREFIX}/lib64:${PREFIX}/lib${LD_LIBRARY_PATH:+:$LD_LIBRARY_PATH}
export PKG_CONFIG_PATH=${PREFIX}/lib64/pkgconfig:${PREFIX}/lib/pkgconfig:${PREFIX}/share/pkgconfig${PKG_CONFIG_PATH:+:$PKG_CONFIG_PATH}
ARTIFACT_URL=$(jq < ~/zuul-env.json -r '[.artifacts[]? | select(.name == "tarball") | select(.project == "CzechLight/dependencies")][-1]?.url + ""')
-DEP_SUBMODULE_COMMIT=$(git ls-tree -l master submodules/dependencies | cut -d ' ' -f 3)
-
if [[ -z "${ARTIFACT_URL}" ]]; then
- # fallback to a promoted artifact
+ # nothing ahead in the pipeline -> fallback to the latest promoted artifact
+ DEPSRCDIR=$(jq < ~/zuul-env.json -e -r ".projects[] | select(.name == \"CzechLight/dependencies\").src_dir")
+ DEP_SUBMODULE_COMMIT=$(git --git-dir ${HOME}/${DEPSRCDIR}/.git rev-parse HEAD)
ARTIFACT_URL="https://object-store.cloud.muni.cz/swift/v1/ci-artifacts-${ZUUL_TENANT}/${ZUUL_GERRIT_HOSTNAME}/CzechLight/dependencies/${ZUUL_JOB_NAME%%+(-cover?(-previous)|-netconf-cli-no-sysrepo)}/${DEP_SUBMODULE_COMMIT}.tar.zst"
fi
-ARTIFACT_FILE=$(basename ${ARTIFACT_URL})
-DEP_HASH_FROM_ARTIFACT=$(echo "${ARTIFACT_FILE}" | sed -e 's/^czechlight-dependencies-//' -e 's/\.tar\.zst$//')
-if [[ "${DEP_HASH_FROM_ARTIFACT}" != "${DEP_SUBMODULE_COMMIT}" ]]; then
- echo "Mismatched artifact: HEAD of ./submodules/dependencies does not match artifact commit ref"
- exit 1
-fi
curl ${ARTIFACT_URL} | unzstd --stdout | tar -C ${PREFIX} -xf -
if [[ ${ZUUL_JOB_NAME} =~ .*-no-sysrepo ]]; then
diff --git a/submodules/dependencies b/submodules/dependencies
deleted file mode 160000
index 07f0bd8..0000000
--- a/submodules/dependencies
+++ /dev/null
@@ -1 +0,0 @@
-Subproject commit 07f0bd86e8a12767e14ac5e3f51558e6d05e438a