Skip to content

Commit

Permalink
Handle per-package sbuild options
Browse files Browse the repository at this point in the history
  • Loading branch information
rhaschke committed Oct 17, 2024
1 parent b0a3b33 commit d1709a8
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 1 deletion.
3 changes: 3 additions & 0 deletions .github/workflows/good.repos
Original file line number Diff line number Diff line change
Expand Up @@ -15,3 +15,6 @@ repositories:
type: git
url: https://github.com/ros/roscpp_core.git
version: noetic-devel

sbuild_options:
genmsg: --jobs=2
3 changes: 3 additions & 0 deletions ros-one.repos
Original file line number Diff line number Diff line change
Expand Up @@ -1055,3 +1055,6 @@ repositories:
type: git
url: https://github.com/ros/xacro.git
version: noetic-devel

sbuild_options:
eigenpy: --jobs=2
8 changes: 7 additions & 1 deletion src/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -151,6 +151,7 @@ function build_pkg {
local old_path=$PWD
local pkg_name=$1
local pkg_path=$2
local opts
local version
local version_stamped

Expand Down Expand Up @@ -188,6 +189,11 @@ function build_pkg {

rm -rf .git

# Fetch sbuild options from .repos yaml file
opts=$(yq ".sbuild_options.\"$pkg_name\"" "$3")
[ "$opts" != "null" ] || opts=""
[ -z "$opts" ] || EXTRA_SBUILD_OPTS="$EXTRA_SBUILD_OPTS $opts"

ici_label update_repo || return 1
SBUILD_OPTS="--verbose --chroot=sbuild --no-clean-source --no-run-lintian --dist=$DEB_DISTRO $EXTRA_SBUILD_OPTS"
ici_label "${SBUILD_QUIET[@]}" sg sbuild -c "sbuild $SBUILD_OPTS" || return 4
Expand Down Expand Up @@ -289,7 +295,7 @@ function build_source {

local exit_code=0
if [ -f "${PKG_FOLDERS[$idx]}/package.xml" ]; then
build_pkg "${PKG_NAMES[$idx]}" "${PKG_FOLDERS[$idx]}" || exit_code=$?
build_pkg "${PKG_NAMES[$idx]}" "${PKG_FOLDERS[$idx]}" "$old_path/$1" || exit_code=$?
elif [ -f "${PKG_FOLDERS[$idx]}/setup.py" ]; then
build_python_pkg "${PKG_NAMES[$idx]}" "${PKG_FOLDERS[$idx]}" || exit_code=$?
else
Expand Down

0 comments on commit d1709a8

Please sign in to comment.