Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
42 commits
Select commit Hold shift + click to select a range
34009f6
update zenoh cpp vendor patch
wep21 Jun 12, 2025
b8cd27b
update patch dependencies for rclpy
wep21 Jun 12, 2025
e34a09c
update gz-version
wep21 Jun 12, 2025
f31e9b3
update gz patch
wep21 Jun 12, 2025
45b1fa2
update patch
wep21 Jun 12, 2025
643ff53
update patch
wep21 Jun 12, 2025
6ea7a1e
update patch
wep21 Jun 12, 2025
587ab9f
update patch
wep21 Jun 12, 2025
29868a0
add patch
wep21 Jun 12, 2025
702166b
update patch
wep21 Jun 12, 2025
06ac2e1
add patch
wep21 Jun 12, 2025
0cd5723
remove patch
wep21 Jun 13, 2025
5059bc6
update snapshot
wep21 Jun 13, 2025
ce3e9ba
update patch
wep21 Jun 13, 2025
f46c2a7
Update patch/ros-kilted-gz-ros2-control.osx.patch
wep21 Jun 13, 2025
3186188
update robostack yaml
wep21 Jun 13, 2025
9364cca
update patch
wep21 Jun 13, 2025
49cf8eb
remove patch
wep21 Jun 14, 2025
7fc3fa7
update patch
wep21 Jun 14, 2025
2982a2c
remove patch
wep21 Jun 14, 2025
5d35fd0
Update check_patches_clean_apply.py to work with rattler-build
traversaro Jun 14, 2025
bfb64fa
Update check_patches_clean_apply to work with ratler-build and add ch…
traversaro Jun 14, 2025
46bb5c8
Merge pull request #1 from traversaro/update-patch
wep21 Jun 15, 2025
468148d
fix
wep21 Jun 15, 2025
617c1bd
fix
wep21 Jun 15, 2025
1e7a460
add patch
wep21 Jun 15, 2025
d20cef8
update patch dependencies
wep21 Jun 15, 2025
bd80f7b
add patch
wep21 Jun 15, 2025
bbdb9dd
fix
wep21 Jun 15, 2025
b6c5d1c
update win patch
wep21 Jun 15, 2025
f473fbb
update build number of additional recipes
wep21 Jun 15, 2025
2b158f6
update
wep21 Jun 16, 2025
85a7fa4
update
wep21 Jun 16, 2025
89226d0
update patch
wep21 Jun 16, 2025
10245ce
add patch
wep21 Jun 16, 2025
4980028
add osx patch
wep21 Jun 16, 2025
b1ec4cb
add patch
wep21 Jun 16, 2025
8577970
Add explicit run dependency on libopencv qt6 variant for packages tha…
traversaro Jun 16, 2025
2d40af9
update ros-gz-sim patch
wep21 Jun 17, 2025
84aa1a1
update vs2019 to vs2022
wep21 Jun 10, 2025
b468a95
update patch
wep21 Jun 10, 2025
22784d9
update vinca
wep21 Jun 11, 2025
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
7 changes: 6 additions & 1 deletion .github/workflows/testpr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ jobs:
- os: macos-14
platform: osx-arm64
additional_recipes: []
- os: windows-2019
- os: windows-2022
platform: win-64
additional_recipes: []

Expand Down Expand Up @@ -131,29 +131,34 @@ jobs:
shell: bash -l {0}
if: steps.newrecipecheck.outputs.RECIPE_CREATED == 1 && matrix.platform == 'linux-64'
run: |
env -i $HOME/.pixi/bin/pixi run -e beta python check_patches_clean_apply.py
env -i $HOME/.pixi/bin/pixi run -e beta rattler-build build --recipe-dir additional_recipes --target-platform linux-64 -m ./conda_build_config.yaml -c robostack-kilted -c conda-forge --skip-existing
env -i $HOME/.pixi/bin/pixi run -e beta rattler-build build --recipe-dir recipes --target-platform linux-64 -m ./conda_build_config.yaml -c robostack-kilted -c conda-forge --skip-existing
- name: Build recipes for linux-aarch64
shell: bash -l {0}
if: steps.newrecipecheck.outputs.RECIPE_CREATED == 1 && matrix.platform == 'linux-aarch64'
run: |
env -i $HOME/.pixi/bin/pixi run -e beta python check_patches_clean_apply.py
env -i $HOME/.pixi/bin/pixi run -e beta rattler-build build --recipe-dir additional_recipes --target-platform linux-aarch64 -m ./conda_build_config.yaml -c robostack-kilted -c conda-forge --skip-existing
env -i $HOME/.pixi/bin/pixi run -e beta rattler-build build --recipe-dir recipes --target-platform linux-aarch64 -m ./conda_build_config.yaml -c robostack-kilted -c conda-forge --skip-existing
- name: Build recipes for osx-64
shell: bash -l {0}
if: steps.newrecipecheck.outputs.RECIPE_CREATED == 1 && matrix.platform == 'osx-64'
run: |
env -i $HOME/.pixi/bin/pixi run -e beta python check_patches_clean_apply.py
env -i $HOME/.pixi/bin/pixi run -e beta rattler-build build --recipe-dir additional_recipes --target-platform osx-64 -m ./conda_build_config.yaml -c robostack-kilted -c conda-forge --skip-existing
env -i $HOME/.pixi/bin/pixi run -e beta rattler-build build --recipe-dir recipes --target-platform osx-64 -m ./conda_build_config.yaml -c robostack-kilted -c conda-forge --skip-existing
- name: Build recipes for osx-arm64
shell: bash -l {0}
if: steps.newrecipecheck.outputs.RECIPE_CREATED == 1 && matrix.platform == 'osx-arm64'
run: |
env -i $HOME/.pixi/bin/pixi run -e beta python check_patches_clean_apply.py
env -i $HOME/.pixi/bin/pixi run -e beta rattler-build build --recipe-dir additional_recipes --target-platform osx-arm64 -m ./conda_build_config.yaml -c robostack-kilted -c conda-forge --skip-existing
env -i $HOME/.pixi/bin/pixi run -e beta rattler-build build --recipe-dir recipes --target-platform osx-arm64 -m ./conda_build_config.yaml -c robostack-kilted -c conda-forge --skip-existing
- name: Build recipes for win-64
shell: bash -l {0}
if: steps.newrecipecheck.outputs.RECIPE_CREATED == 1 && matrix.platform == 'win-64'
run: |
$HOME/.pixi/bin/pixi run -e beta python check_patches_clean_apply.py
$HOME/.pixi/bin/pixi run -e beta rattler-build build --recipe-dir additional_recipes --target-platform win-64 -m ./conda_build_config.yaml -c robostack-kilted -c conda-forge --skip-existing
$HOME/.pixi/bin/pixi run -e beta rattler-build build --recipe-dir recipes --target-platform win-64 -m ./conda_build_config.yaml -c robostack-kilted -c conda-forge --skip-existing
6 changes: 3 additions & 3 deletions additional_recipes/ros-kilted-livox-ros-driver2/recipe.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ source:

build:
script: ${{ '$RECIPE_DIR/build_ament_cmake.sh' if unix else '%RECIPE_DIR%\\bld_ament_cmake.bat' }}
number: 6
number: 7
skip:
- not linux
post_process:
Expand Down Expand Up @@ -91,7 +91,7 @@ requirements:
- ros-kilted-ros-workspace
- ros-kilted-rosidl-default-generators
- ros-kilted-sensor-msgs
- ros2-distro-mutex 0.8.* kilted_*
- ros2-distro-mutex 0.9.* kilted_*
- vtk-base
- if: linux
then:
Expand All @@ -111,7 +111,7 @@ requirements:
- ros-kilted-rclcpp-components
- ros-kilted-ros-workspace
- ros-kilted-sensor-msgs
- ros2-distro-mutex 0.8.* kilted_*
- ros2-distro-mutex 0.9.* kilted_*
- vtk-base
- if: osx and x86_64
then:
Expand Down
2 changes: 1 addition & 1 deletion additional_recipes/ros-kilted-octomap/recipe.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package:
version: "1.10.0"

build:
number: 5
number: 7

requirements:
run:
Expand Down
2 changes: 1 addition & 1 deletion additional_recipes/ros-kilted-urdfdom-headers/recipe.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package:
version: "1.1.2"

build:
number: 5
number: 7

requirements:
run:
Expand Down
2 changes: 1 addition & 1 deletion additional_recipes/ros-kilted-urdfdom-py/recipe.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package:
version: "1.2.1"

build:
number: 5
number: 7

requirements:
run:
Expand Down
2 changes: 1 addition & 1 deletion additional_recipes/ros-kilted-urdfdom/recipe.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package:
version: "4.0.1"

build:
number: 5
number: 7

requirements:
run:
Expand Down
200 changes: 162 additions & 38 deletions check_patches_clean_apply.py
Original file line number Diff line number Diff line change
@@ -1,48 +1,172 @@
# Useful script when checking whether patches apply cleanly.
# First, run `vinca` (without `-m` flag) to generate a recipe.yaml.
# Then, run this script to generate a new pseudo list that only contains sources that have patches applied.
# This you can then run through `boa` which will try and apply the patches.
#!/usr/bin/env python3
"""
check_patches_clean_apply.py
~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Scan *all* recipes inside the **recipes/** folder, keep only the parts
needed to verify that every declared *patch* still applies, and then
run **rattler-build** so the patch phase is executed – nothing else.

import yaml
Usage
-----

# From repository root
python .scripts/check_patches_clean_apply.py # prepare + run
python .scripts/check_patches_clean_apply.py --dry # prepare only
python .scripts/check_patches_clean_apply.py --clean # delete output

The script creates (or refreshes) a sibling folder named
*recipes_only_patch*. Every recipe that declares *patches:* gets a
**minimal** copy there; files referenced in *patches* are copied too.

Implementation details
----------------------

* Accepts both mapping or list forms of *source*.
* Strips out *requirements*, *test*, *outputs*… – only *package*,
*source* and a stub *build* section remain.
* Automatically invokes ``rattler-build build`` if *--dry* is **not**
given.
"""

from __future__ import annotations

import argparse
import shutil
import os
import subprocess
import sys
from pathlib import Path
from typing import Any, Dict, List, Union
import yaml

SCRIPT_DIR = './'

shutil.move(SCRIPT_DIR + '/recipe.yaml', SCRIPT_DIR + '/recipe.yaml.bak')
ROOT_DIR = Path.cwd()
RECIPES_DIR = ROOT_DIR / "recipes"
PATCH_RECIPES_DIR = ROOT_DIR / "recipes_only_patch"

# Load the YAML file
with open('recipe.yaml.bak', 'r') as file:
data = yaml.safe_load(file)

prepend_data = {
'package': {
'name': 'ros-dummy',
'version': '2024.01.17'
}
}

append_data = {
'build': {
'number': 0
},
'about': {
'home': 'https://www.ros.org/',
'license': 'BSD-3-Clause',
'summary': 'Robot Operating System'
},
'extra': {
'recipe-maintainers': [
'ros-forge'
]
def parse_args() -> argparse.Namespace:
ap = argparse.ArgumentParser(description="Check that patches apply cleanly.")
ap.add_argument(
"--dry",
action="store_true",
help="Only generate recipes_only_patch/, don’t run rattler-build",
)
ap.add_argument(
"--clean",
action="store_true",
help="Remove recipes_only_patch/ and exit",
)
return ap.parse_args()


def find_recipe_files() -> List[Path]:
return sorted(RECIPES_DIR.rglob("recipe.yaml"))


def filter_sources(src: Union[Dict[str, Any], List[Dict[str, Any]]]) -> List[Dict[str, Any]]:
if isinstance(src, dict):
return [src] if "patches" in src else []
elif isinstance(src, list):
return [entry for entry in src if isinstance(entry, dict) and "patches" in entry]
return []


def copy_patch_files(
filtered_sources: List[Dict[str, Any]], orig_recipe_dir: Path, dest_recipe_dir: Path
) -> None:
for entry in filtered_sources:
patches = entry["patches"]
if isinstance(patches, str):
patches = [patches]
for p in patches:
if p.startswith(("http://", "https://")):
# Remote patches – nothing to copy
continue
src_patch = (orig_recipe_dir / p).resolve()
dest_patch = dest_recipe_dir / p
dest_patch.parent.mkdir(parents=True, exist_ok=True)
shutil.copy2(src_patch, dest_patch)


def write_minimal_recipe(
dest_recipe_file: Path, pkg: Dict[str, Any], filtered_sources: List[Dict[str, Any]]
) -> None:
minimal = {
"package": pkg,
"source": filtered_sources,
"build": {"number": 0, "script": "echo patch-check"},
}
}
dest_recipe_file.parent.mkdir(parents=True, exist_ok=True)
with dest_recipe_file.open("w", encoding="utf-8") as fh:
yaml.dump(minimal, fh, sort_keys=False)


def prepare_patch_recipes() -> List[Path]:
recreated: List[Path] = []
for recipe_file in find_recipe_files():
with recipe_file.open("r", encoding="utf-8") as fh:
recipe = yaml.safe_load(fh) or {}

src_section = recipe.get("source")
if src_section is None:
continue
filtered = filter_sources(src_section)
if not filtered:
# No patches → skip
continue

pkg = recipe.get("package", {"name": recipe_file.parent.name, "version": "0"})
rel_dir = recipe_file.parent.relative_to(RECIPES_DIR)
dest_recipe_dir = PATCH_RECIPES_DIR / rel_dir
dest_recipe_file = dest_recipe_dir / "recipe.yaml"

copy_patch_files(filtered, recipe_file.parent, dest_recipe_dir)
write_minimal_recipe(dest_recipe_file, pkg, filtered)
recreated.append(dest_recipe_file)

return recreated


def run_rattler_build() -> None:
cmd = [
"rattler-build",
"build",
"--recipe-dir",
str(PATCH_RECIPES_DIR)
]
print("\n🔧 Running:", " ".join(cmd), "\n", flush=True)
subprocess.run(cmd, check=True)


def main() -> None:
args = parse_args()

if not RECIPES_DIR.is_dir():
print("❌ recipes/ folder not found – abort.")
return

if args.clean:
shutil.rmtree(PATCH_RECIPES_DIR, ignore_errors=True)
print("🧹 Removed recipes_only_patch/")
return

if PATCH_RECIPES_DIR.exists():
print("♻️ Refreshing recipes_only_patch/ …")
shutil.rmtree(PATCH_RECIPES_DIR)

recreated = prepare_patch_recipes()
if not recreated:
print("⚠️ No recipes with patches found – nothing to test.")
return

print(f"✅ Prepared {len(recreated)} minimal recipe(s) in {PATCH_RECIPES_DIR}/")

if not args.dry:
run_rattler_build()
else:
print("💡 --dry given – rattler-build not executed.")

# Filter out entries without 'patches'
filtered_data = [entry for entry in data['source'] if 'patches' in entry]

final_data = {**prepend_data, 'source': filtered_data, **append_data}
if __name__ == "__main__":
main()

# Write the filtered data back to a YAML file
with open('recipe.yaml', 'w') as file:
yaml.dump(final_data, file, sort_keys=False)
6 changes: 2 additions & 4 deletions conda_build_config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,7 @@ python_impl:
c_compiler:
- gcc # [linux]
- clang # [osx]
- vs2019 # [win and x86_64]
- vs2022 # [win and arm64]
- vs2022 # [win]
c_compiler_version: # [unix]
- 13 # [linux]
- 18 # [osx]
Expand All @@ -44,8 +43,7 @@ c_stdlib_version: # [unix]
cxx_compiler:
- gxx # [linux]
- clangxx # [osx]
- vs2019 # [win and x86_64]
- vs2022 # [win and arm64]
- vs2022 # [win]
cxx_compiler_version: # [unix]
- 13 # [linux]
- 18 # [osx]
Expand Down
Loading
Loading