Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 11 additions & 11 deletions distros/rolling/patch/ros2-septentrio-gnss-driver.patch
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 66dec47..0ad6caa 100644
index bf6c60d..3668dd5 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -1,8 +1,11 @@
Expand All @@ -17,18 +17,18 @@ index 66dec47..0ad6caa 100644
if(NOT CMAKE_BUILD_TYPE AND NOT CMAKE_CONFIGURATION_TYPES)
message(STATUS "Setting build type to Release as none was specified.")
diff --git a/include/septentrio_gnss_driver/abstraction/typedefs.hpp b/include/septentrio_gnss_driver/abstraction/typedefs.hpp
index 69f7b2c..25ec2c7 100644
index f05da0e..601a244 100644
--- a/include/septentrio_gnss_driver/abstraction/typedefs.hpp
+++ b/include/septentrio_gnss_driver/abstraction/typedefs.hpp
@@ -40,9 +40,11 @@
// tf2 includes
#ifdef ROS2_VER_N520
#include <tf2_ros/transform_broadcaster.hpp>
+#include <tf2_ros/buffer.hpp>
#include <tf2_ros/transform_listener.hpp>
@@ -43,6 +43,11 @@
#else
#include <tf2_ros/transform_broadcaster.h>
+#include <tf2_ros/buffer.h>
#include <tf2_ros/transform_listener.h>
#endif
#ifdef ROS2_VER_N250
+#if __has_include(<tf2_ros/buffer.hpp>)
+#include <tf2_ros/buffer.hpp>
+#else
+#include <tf2_ros/buffer.h>
+#endif
#if __has_include(<tf2_ros/transform_listener.hpp>)
#include <tf2_ros/transform_listener.hpp>
#else
6 changes: 6 additions & 0 deletions tools/robostack.py
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,7 @@ def build_ci_parallel(distro: str, recipes: list[str], args: list[str], cwd: Pat
(ros-<distro>-<name>) only repackage, but wait for others while building alongside:
they are left out (build_timings gives them ALIAS_SECONDS)."""
span: dict[str, list[str]] = {} # recipe -> [first, last] timestamp
finished: set[str] = set()

def show(line: bytes) -> None:
try:
Expand All @@ -136,6 +137,8 @@ def show(line: bytes) -> None:
# the build itself: rattler-build renders every recipe up front
if name and any(s.get("name") == "Running build for" for s in spans):
span.setdefault(name, [entry["timestamp"]] * 2)[1] = entry["timestamp"]
if str(entry["fields"].get("message", "")).startswith("Archive written to"):
finished.add(name)
text = f"{entry['timestamp'][11:19]} [{name or '-'}] {entry['fields'].get('message', '')}\n"
sys.stdout.write(text)
except (ValueError, KeyError, AttributeError, TypeError):
Expand All @@ -144,6 +147,9 @@ def show(line: bytes) -> None:

args = [*args, "--parallel-builds", PARALLEL_BUILDS, "--log-style", "json"]
rc = run_build(rattler_build(distro, args, skip_existing=False), cwd, show)
if rc != 0 and (unfinished := sorted(set(span) - finished)):
# rattler-build's final error doesn't say which of the parallel builds it is from
print(f"Started but not finished: {', '.join(unfinished)}", file=sys.stderr, flush=True)
if rc == 0 and os.environ.get("GITHUB_ACTIONS"):
import build_timings # for packing the build jobs by time
from datetime import datetime
Expand Down
20 changes: 20 additions & 0 deletions tools/tests/test_build_timings.py
Original file line number Diff line number Diff line change
Expand Up @@ -156,3 +156,23 @@ def run_build(cmd, cwd, show=None):
assert [(r, round(s, 2)) for r, s in noted] == [("ros2-a", 6.61), ("ros2-b", 12.39)]
out = capsys.readouterr().out
assert "07:00:01 [ros2-a] Fetching source" in out and "not json" in out


def test_build_ci_parallel_names_the_unfinished_builds(tmp_path, monkeypatch, capsys):
import robostack

def line(t, recipe, message):
return (json.dumps({"timestamp": f"2026-10-24T07:00:{t:02d}.0Z", "fields": {"message": message},
"spans": [{"recipe": recipe, "name": "Running build for"}]}) + "\n").encode()

def run_build(cmd, cwd, show=None):
for entry in (line(1, "ros2-a-1.0-h0_1", "Fetching source"), line(2, "ros2-b-1.0-h0_1", "Applying patch"),
line(3, "ros2-a-1.0-h0_1", "Archive written to '/bld/ros2-a-1.0-h0_1.conda'"),
b"Error: x Patch application error\n"):
show(entry)
return 1

monkeypatch.setattr(robostack, "run_build", run_build)
monkeypatch.setattr(robostack, "rattler_build", lambda distro, args, skip_existing=True: ["rattler-build", *args])
assert robostack.build_ci_parallel("rolling", ["ros2-a", "ros2-b"], ["--recipe", "a", "--recipe", "b"], tmp_path) == 1
assert "Started but not finished: ros2-b" in capsys.readouterr().err
Loading