Skip to content

Commit cb6f353

Browse files
committed
build: add production robot profile
1 parent 74a37df commit cb6f353

3 files changed

Lines changed: 17 additions & 3 deletions

File tree

.github/workflows/build-benchmark.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@ jobs:
4141
- name: Measure clean and incremental builds
4242
run: >-
4343
python3 scripts/benchmark_build.py
44+
--task build-robot-profile
4445
--output build-benchmark-${{ runner.arch }}.json
4546
4647
- name: Show compiler cache statistics

pixi.toml

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,13 @@ format = {cmd = "sh -c 'pre-commit run --all-files --hook-stage \"${PRE_COMMIT_S
2525
cmd = "colcon build --symlink-install --packages-skip zed_wrapper zed_components zed_msgs zed_ros2 --cmake-args -G Ninja -DCMAKE_C_COMPILER_LAUNCHER=ccache -DCMAKE_CXX_COMPILER_LAUNCHER=ccache -DCMAKE_C_FLAGS='-Wall -Wextra -Werror -Wno-error=pedantic' -DCMAKE_CXX_FLAGS='-Wall -Wextra -Wpedantic -Werror' "
2626
description = "Builds all ROS 2 packages. Add --packages-select <package names> to build specific packages."
2727

28+
[tasks.build-robot-profile]
29+
# Keep the package selection aligned with the default build so CI benchmark results remain comparable.
30+
cmd = "colcon build --symlink-install --packages-skip zed_wrapper zed_components zed_msgs zed_ros2 --cmake-args -G Ninja -DCMAKE_BUILD_TYPE=RelWithDebInfo -DBUILD_TESTING=OFF -DCMAKE_C_COMPILER_LAUNCHER=ccache -DCMAKE_CXX_COMPILER_LAUNCHER=ccache -DCMAKE_C_FLAGS='-Wall -Wextra -Werror -Wno-error=pedantic' -DCMAKE_CXX_FLAGS='-Wall -Wextra -Wpedantic -Werror' "
31+
description = "Builds the CI-compatible package set with the production robot profile."
32+
2833
[feature.robot.tasks.build]
29-
cmd = "colcon build --symlink-install --cmake-args -G Ninja -DCMAKE_C_COMPILER_LAUNCHER=ccache -DCMAKE_CXX_COMPILER_LAUNCHER=ccache -DCMAKE_C_FLAGS='-Wall -Wextra -Werror -Wno-error=pedantic' -DCMAKE_CXX_FLAGS='-Wall -Wextra -Wpedantic -Werror' "
34+
cmd = "colcon build --symlink-install --cmake-args -G Ninja -DCMAKE_BUILD_TYPE=RelWithDebInfo -DBUILD_TESTING=OFF -DCMAKE_C_COMPILER_LAUNCHER=ccache -DCMAKE_CXX_COMPILER_LAUNCHER=ccache -DCMAKE_C_FLAGS='-Wall -Wextra -Werror -Wno-error=pedantic' -DCMAKE_CXX_FLAGS='-Wall -Wextra -Wpedantic -Werror' "
3035
description = "Builds all ROS 2 packages. Add --packages-select <package names> to build specific packages."
3136

3237
[tasks.clean]

scripts/benchmark_build.py

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ def append_github_summary(results: dict[str, object], summary_path: Path) -> Non
3737
summary.write("| --- | ---: | ---: |\n")
3838
summary.write(f"| Clean | {clean['duration_seconds']:.2f} s | {clean['return_code']} |\n")
3939
summary.write(f"| Incremental | {incremental['duration_seconds']:.2f} s | {incremental['return_code']} |\n\n")
40+
summary.write(f"Pixi task: `{results['task']}`\n\n")
4041
summary.write(f"Touched source: `{results['touched_source']}`\n")
4142

4243

@@ -53,6 +54,11 @@ def parse_args() -> argparse.Namespace:
5354
default=Path("build-benchmark.json"),
5455
help="JSON file that receives the benchmark results.",
5556
)
57+
parser.add_argument(
58+
"--task",
59+
default="build",
60+
help="Pixi task used for both measured builds.",
61+
)
5662
parser.add_argument(
5763
"--source",
5864
type=Path,
@@ -71,16 +77,18 @@ def main() -> int:
7177
["pixi", "run", "-e", args.environment, "clean"],
7278
check=True,
7379
)
74-
clean_build = run_timed(["pixi", "run", "-e", args.environment, "build"])
80+
build_command = ["pixi", "run", "-e", args.environment, args.task]
81+
clean_build = run_timed(build_command)
7582

7683
# Updating the timestamp makes the build system reconsider one translation unit.
7784
# The file content stays unchanged, allowing compiler caches to reuse their output.
7885
os.utime(args.source)
79-
incremental_build = run_timed(["pixi", "run", "-e", args.environment, "build"])
86+
incremental_build = run_timed(build_command)
8087

8188
results = {
8289
"created_at": datetime.now(UTC).isoformat(),
8390
"environment": args.environment,
91+
"task": args.task,
8492
"touched_source": str(args.source),
8593
"clean_build": clean_build,
8694
"incremental_build": incremental_build,

0 commit comments

Comments
 (0)