Skip to content

Commit d7c0cf3

Browse files
committed
Add native macOS releases and cache CI builds
1 parent f2f89eb commit d7c0cf3

46 files changed

Lines changed: 694 additions & 55 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

‎.github/workflows/check.yml‎

Lines changed: 29 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -21,31 +21,55 @@ jobs:
2121
with:
2222
version: "0.13.6"
2323
python-version: "3.14"
24+
enable-cache: true
2425
- run: uv sync --locked
2526
- run: uv run rua-dev validate --lane python
2627
- run: uv lock --check --project examples/python
2728

2829
rust:
30+
strategy:
31+
fail-fast: false
32+
matrix:
33+
os: [ubuntu-24.04, macos-15, macos-15-intel]
2934
if: github.repository == 'Hebbian-Robotics/rua'
30-
runs-on: ubuntu-24.04
35+
runs-on: ${{ matrix.os }}
3136
timeout-minutes: 60
32-
env:
33-
CC: clang-21
34-
CXX: clang++-21
3537
steps:
3638
- uses: actions/checkout@d23441a48e516b6c34aea4fa41551a30e30af803 # v6
3739
with:
3840
persist-credentials: false
39-
- name: Install native build tools
41+
- name: Install Linux build tools
42+
if: runner.os == 'Linux'
4043
run: |
4144
curl -fsSL https://apt.llvm.org/llvm-snapshot.gpg.key | sudo gpg --dearmor -o /usr/share/keyrings/llvm.gpg
4245
echo 'deb [signed-by=/usr/share/keyrings/llvm.gpg] https://apt.llvm.org/noble/ llvm-toolchain-noble-21 main' | sudo tee /etc/apt/sources.list.d/llvm.list
4346
sudo apt-get update
4447
sudo apt-get install -y pkg-config mold libudev-dev libglib2.0-dev clang-21 libclang-21-dev ffmpeg
48+
{
49+
echo 'CC=clang-21'
50+
echo 'CXX=clang++-21'
51+
} >> "$GITHUB_ENV"
52+
- name: Install macOS build tools
53+
if: runner.os == 'macOS'
54+
run: |
55+
brew install ffmpeg pkg-config
56+
{
57+
echo 'CC=clang'
58+
echo 'CXX=clang++'
59+
echo 'MACOSX_DEPLOYMENT_TARGET=14.0'
60+
echo 'TMPDIR=/tmp'
61+
} >> "$GITHUB_ENV"
4562
- uses: astral-sh/setup-uv@c771a70e6277c0a99b617c7a806ffedaca235ff9 # v9.0.0
4663
with:
4764
version: "0.13.6"
4865
python-version: "3.14"
66+
enable-cache: true
67+
- name: Restore Rust build cache
68+
uses: Swatinem/rust-cache@d1527c8f67ef9af357290475d4af4b0fab8f12e0 # v2.9.3
69+
with:
70+
shared-key: checks-${{ matrix.os }}
71+
env-vars: CC CXX MACOSX_DEPLOYMENT_TARGET
72+
save-if: ${{ github.ref == 'refs/heads/main' || github.event_name == 'release' }}
4973
- name: Prepare pinned robot assets
5074
run: uv run rua-dev setup
5175
- run: rustup show active-toolchain

‎.github/workflows/publish.yml‎

Lines changed: 38 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -19,13 +19,11 @@ jobs:
1919
build:
2020
if: github.repository == 'Hebbian-Robotics/rua'
2121
strategy:
22+
fail-fast: false
2223
matrix:
23-
os: [ubuntu-24.04]
24+
os: [ubuntu-24.04, macos-15, macos-15-intel]
2425
runs-on: ${{ matrix.os }}
2526
timeout-minutes: 60
26-
env:
27-
CC: clang-21
28-
CXX: clang++-21
2927
steps:
3028
- uses: actions/checkout@d23441a48e516b6c34aea4fa41551a30e30af803 # v6
3129
with:
@@ -34,6 +32,7 @@ jobs:
3432
with:
3533
version: "0.13.6"
3634
python-version: "3.14"
35+
enable-cache: true
3736
- name: Verify the release tag matches the package version
3837
env:
3938
RELEASE_TAG: ${{ github.event.release.tag_name }}
@@ -43,21 +42,48 @@ jobs:
4342
echo "Release tag ${RELEASE_TAG} must equal v${package_version}." >&2
4443
exit 1
4544
fi
46-
- name: Install native build tools
45+
- name: Install Linux build tools
46+
if: runner.os == 'Linux'
4747
run: |
4848
curl -fsSL https://apt.llvm.org/llvm-snapshot.gpg.key | sudo gpg --dearmor -o /usr/share/keyrings/llvm.gpg
4949
echo 'deb [signed-by=/usr/share/keyrings/llvm.gpg] https://apt.llvm.org/noble/ llvm-toolchain-noble-21 main' | sudo tee /etc/apt/sources.list.d/llvm.list
5050
sudo apt-get update
5151
sudo apt-get install -y pkg-config mold libudev-dev libglib2.0-dev clang-21 libclang-21-dev ffmpeg
52+
{
53+
echo 'CC=clang-21'
54+
echo 'CXX=clang++-21'
55+
} >> "$GITHUB_ENV"
56+
- name: Install macOS build tools
57+
if: runner.os == 'macOS'
58+
run: |
59+
brew install ffmpeg pkg-config
60+
{
61+
echo 'CC=clang'
62+
echo 'CXX=clang++'
63+
echo 'MACOSX_DEPLOYMENT_TARGET=14.0'
64+
echo 'TMPDIR=/tmp'
65+
} >> "$GITHUB_ENV"
66+
- name: Restore Rust build cache
67+
uses: Swatinem/rust-cache@d1527c8f67ef9af357290475d4af4b0fab8f12e0 # v2.9.3
68+
with:
69+
shared-key: release-${{ matrix.os }}
70+
env-vars: CC CXX MACOSX_DEPLOYMENT_TARGET
71+
save-if: ${{ github.ref == 'refs/heads/main' || github.event_name == 'release' }}
5272
- name: Check source and generated contracts
5373
run: |
5474
uv run --locked rua-dev setup
5575
uv run --locked rua-dev validate --lane python
5676
uv run --locked rua-dev contracts --check
57-
- name: Build and repair the release wheel
77+
- name: Build the release wheel
78+
run: uv run --locked rua-dev package rua
79+
- name: Repair Linux libraries
80+
if: runner.os == 'Linux'
5881
run: |
59-
uv run --locked rua-dev package rua
6082
uvx --with patchelf auditwheel repair --plat manylinux_2_39_x86_64 --wheel-dir dist/repaired dist/hebbian_rua-*.whl
83+
- name: Bundle macOS libraries
84+
if: runner.os == 'macOS'
85+
run: |
86+
uvx --from delocate delocate-wheel --require-archs "$(uname -m)" --wheel-dir dist/repaired dist/hebbian_rua-*.whl
6187
- name: Upload wheels for installation checks
6288
uses: actions/upload-artifact@cf430e030ddbb5b0abf93d22962f4752f3646cd9 # v7.0.2
6389
with:
@@ -69,20 +95,20 @@ jobs:
6995
needs: build
7096
strategy:
7197
matrix:
72-
python: ["3.12", "3.14"]
73-
runs-on: ubuntu-24.04
98+
os: [ubuntu-24.04, macos-15, macos-15-intel]
99+
runs-on: ${{ matrix.os }}
74100
steps:
75101
- uses: actions/checkout@d23441a48e516b6c34aea4fa41551a30e30af803 # v6
76102
with:
77103
persist-credentials: false
78104
- uses: astral-sh/setup-uv@c771a70e6277c0a99b617c7a806ffedaca235ff9 # v9.0.0
79105
with:
80106
version: "0.13.6"
81-
python-version: ${{ matrix.python }}
107+
python-version: "3.14"
108+
enable-cache: true
82109
- uses: actions/download-artifact@9000827ccba6bdab643e8b6fd33ac0654aef8333 # v8.0.2
83110
with:
84-
pattern: rua-wheels-*
85-
merge-multiple: true
111+
name: rua-wheels-${{ matrix.os }}
86112
path: dist/repaired
87113
- name: Verify a clean wheel installation and simulator connection
88114
run: |

‎Cargo.lock‎

Lines changed: 3 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎README.md‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,8 @@ uv run rua serve --profile ./robot.toml
2020
```
2121

2222
Already have a uv project? Start with `uv add`. Choose just the extras you need.
23+
Prebuilt wheels support Linux x86-64 (glibc 2.39+) and macOS 14+ on Apple Silicon
24+
or Intel. On Windows, use [WSL2](docs/windows-wsl.md).
2325

2426
See [getting started](docs/getting-started.md) and the [Python examples](examples/python/README.md) to try it,
2527
and the [example applications](examples/applications/README.md) for example toy projects.

‎docs/cameras.md‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,5 +70,7 @@ that page yourself.
7070
for user-owned camera streams.
7171
- Source builds need the [native prerequisites](https://github.com/Hebbian-Robotics/livekit-cameras/blob/main/CONTRIBUTING.md#native-rust),
7272
then `CC=clang-21 CXX=clang++-21 cargo build -p livekit-cameras` on Linux.
73+
On macOS, use `CC=clang CXX=clang++ cargo build -p livekit-cameras`.
74+
Allow camera access for your terminal in macOS System Settings when prompted.
7375
RUA finds the media binary beside the server in `target/debug`.
7476
Recording additionally needs [FFmpeg](recording.md).

‎docs/getting-started.md‎

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
11
# Get started
22

33
`hebbian-rua` bundles the Python SDK, Rust server, media companion and robot
4-
models in one wheel. The prebuilt wheel targets Ubuntu 24.04 x86-64
5-
(Linux with glibc 2.39 or newer). No Rust compiler is needed for that install.
4+
models in one wheel. Prebuilt wheels support Linux x86-64 with glibc 2.39+
5+
(such as Ubuntu 24.04) and macOS 14+ on Apple Silicon or Intel.
6+
No Rust compiler is needed for those installs.
7+
On Windows, see [Windows with WSL2](windows-wsl.md) for setup considerations.
68

79
Use [uv](https://docs.astral.sh/uv/) for your agent project:
810

‎docs/hardware.md‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,8 @@ and keep a physical power cutoff accessible.
1414
1. Follow [LeRobot's SO-101 setup](https://huggingface.co/docs/lerobot/en/so101)
1515
to identify the port and calibrate with a unique robot ID. The station reads
1616
`~/.cache/huggingface/lerobot/calibration/robots/so_follower/<id>.json`.
17-
Prefer a stable `/dev/serial/by-id/` path on Linux.
17+
Prefer a stable `/dev/serial/by-id/` path on Linux; on macOS, use the arm's
18+
`/dev/cu.*` serial device.
1819
2. Create a private profile such as `$HOME/.config/rua/so101.toml`:
1920

2021
```toml

‎docs/install-from-source.md‎

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,14 @@
22

33
The published `hebbian-rua` wheel includes the SDK, native binaries and robot
44
models. Source development additionally needs Rust, Python and uv. This workflow
5-
is exercised on Ubuntu 24.04 x86-64; macOS and Windows are not validated for RUA.
5+
is exercised on Ubuntu 24.04 x86-64 and macOS 14+ (Apple Silicon and Intel).
6+
Native Windows is not validated for RUA.
7+
For Windows setup considerations, see [Windows with WSL2](windows-wsl.md).
68

79
Install [uv](https://docs.astral.sh/uv/), the pinned Rust toolchain and, on Ubuntu,
8-
`build-essential`, `pkg-config`, `libudev-dev` and `mold`. From the checkout root:
10+
`build-essential`, `pkg-config`, `libudev-dev` and `mold`. On macOS, install
11+
Xcode Command Line Tools (`xcode-select --install`) and use the default Apple
12+
Clang compiler. From the checkout root:
913

1014
```sh
1115
uv run rua-dev setup

‎docs/recording.md‎

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,9 @@ launches `rua serve`. Installing it only on a remote SDK client is insufficient.
1111
The RUA wheel does not bundle FFmpeg.
1212

1313
These instructions install FFmpeg across platforms. The current prebuilt RUA
14-
wheel supports Linux x86-64 with glibc 2.39+ (such as Ubuntu 24.04); installing
15-
FFmpeg does not add RUA support for macOS, Windows or older Linux systems.
14+
wheels support Linux x86-64 with glibc 2.39+ (such as Ubuntu 24.04) and
15+
macOS 14+ on Apple Silicon or Intel. Installing FFmpeg does not add native
16+
Windows support or support for older systems.
1617

1718
### Ubuntu / Debian
1819

‎docs/windows-wsl.md‎

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
# Windows with WSL2
2+
3+
RUA's prebuilt package targets Linux x86-64 with glibc 2.39 or newer. On an
4+
x86-64 Windows PC, use Ubuntu 24.04 under WSL2 and run the normal
5+
[installation and agent commands](getting-started.md) inside Ubuntu. Native
6+
Windows and WSL hardware operation are not validated for RUA yet.
7+
8+
For a USB arm, follow [Microsoft's WSL USB guide](https://learn.microsoft.com/en-us/windows/wsl/connect-usb).
9+
Installing usbipd and sharing a device require administrator access on Windows;
10+
attaching it does not. Attach again after unplugging or restarting WSL, or use
11+
usbipd's auto-attach functionality. An attached device is unavailable to Windows.
12+
13+
Before starting RUA:
14+
15+
- Confirm the arm appears inside Ubuntu and your user can access its serial port.
16+
USB forwarding does not install missing kernel drivers or grant device permissions.
17+
- Follow [per-arm setup](hardware.md). Use the serial path visible **inside WSL**,
18+
preferably `/dev/serial/by-id/`, rather than a Windows COM port. Check each
19+
arm's identity after reconnecting; VID:PID identifies a device type, not an arm.
20+
- For cameras, see [LiveKit Cameras](https://github.com/Hebbian-Robotics/livekit-cameras)
21+
for browser capture options and [RUA camera setup](cameras.md) for connecting
22+
streams to the agent. A USB camera captured inside WSL also needs forwarding
23+
and a compatible kernel driver; browser capture can avoid that requirement.
24+
25+
Keep the arm supported with torque off during setup. USB forwarding has not been
26+
benchmarked for RUA control loops; verify timing and disconnect behavior on your
27+
hardware before relying on it.

0 commit comments

Comments
 (0)