Skip to content

Commit e831950

Browse files
committed
dsl: pass GZ_CMAKE_PKG to source generation jobs
Pass the collection-specific gz-cmake package as a parameter to source generation jobs from gazebo_libs.dsl. This ensures that prereleases generated from main branches install the correct versioned package from the target repository rather than relying on the rotary package in .github/ci/packages.apt. Assisted-by: Gemini 3.7 Flash Signed-off-by: Addisu Z. Taddese <addisuzt@intrinsic.ai>
1 parent 122c75e commit e831950

3 files changed

Lines changed: 19 additions & 3 deletions

File tree

jenkins-scripts/docker/gz-source-generation.bash

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,9 @@ case "\$SOURCE_DATE_EPOCH" in
2828
;;
2929
esac
3030
31-
GZ_CMAKE_PKG=""
32-
if [ -f "\${SOURCES_DIR}/.github/ci/packages.apt" ]; then
31+
GZ_CMAKE_PKG="${GZ_CMAKE_PKG}"
32+
# If GZ_CMAKE_PKG is not set via environment/parameter, try detecting from packages.apt
33+
if [ -z "\$GZ_CMAKE_PKG" ] && [ -f "\${SOURCES_DIR}/.github/ci/packages.apt" ]; then
3334
GZ_CMAKE_PKG=\$(grep -E '^lib(gz|ign|ignition)(-rotary)?-cmake[0-9]*-dev' "\${SOURCES_DIR}/.github/ci/packages.apt" | head -n 1)
3435
fi
3536

jenkins-scripts/dsl/_configs_/OSRFSourceCreation.groovy

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,9 @@ class OSRFSourceCreation
4747
stringParam("EXTRA_OSRF_REPO",
4848
default_params.find{ it.key == "EXTRA_OSRF_REPO"}?.value,
4949
"For downstream jobs: OSRF extra repositories to add")
50+
stringParam("GZ_CMAKE_PKG",
51+
default_params.find{ it.key == "GZ_CMAKE_PKG"}?.value ?: "",
52+
"gz-cmake dev package to install for source generation (optional)")
5053
}
5154
}
5255
}

jenkins-scripts/dsl/gazebo_libs.dsl

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -610,10 +610,22 @@ pkgconf_per_src_index.each { pkg_src, pkg_src_configs ->
610610
pre_setup_script_hooks
611611
)
612612
// - SOURCE jobs ---------------------------------------------------
613+
def gz_cmake_lib = collection.libs.find { it.name == 'gz-cmake' }
614+
def gz_cmake_pkg = ""
615+
if (canonical_lib_name != 'gz-cmake') {
616+
if (gz_cmake_lib?.major_version) {
617+
gz_cmake_pkg = (gz_cmake_lib.major_version == 2) ?
618+
"libignition-cmake2-dev" : "libgz-cmake${gz_cmake_lib.major_version}-dev"
619+
} else if (collection_name == 'rotary') {
620+
gz_cmake_pkg = "libgz-rotary-cmake-dev"
621+
}
622+
}
623+
613624
def gz_source_job = job("${debbuilder_pkg_name}-source")
614625
OSRFSourceCreation.create(gz_source_job, [
615626
PACKAGE: debbuilder_pkg_name,
616-
SOURCE_REPO_URI: "https://github.com/gazebosim/${canonical_lib_name}.git"])
627+
SOURCE_REPO_URI: "https://github.com/gazebosim/${canonical_lib_name}.git",
628+
GZ_CMAKE_PKG: gz_cmake_pkg])
617629
OSRFSourceCreation.call_uploader_and_releasepy(gz_source_job,
618630
canonical_lib_name,
619631
'repository_uploader_packages',

0 commit comments

Comments
 (0)