Skip to content

Commit 1cf67a0

Browse files
committed
Add macOS as a first-tier platform including CI support
This commit adds macOS to the CI build matrix including all needed infrastructure to support macOS builds in CI. Changes: - Add macOS to the CI matrix in ci.yml - Install libftdi and libusb dependencies using Homebrew on macOS runner - Relocate Linux dependency installation to separate step for clarity - Build Humility from source on macOS in the absence of pre-built binaries - Enable Humility manifest tests on macOS - Enable clippy checking on macOS - Fix clippy install by explicitly specifying active toolchain - Update README documenting macOS as first-tier platform - Add macOS prerequisites section including Homebrew setup instructions Testing: Verified on macOS 15.6.1 (Intel x86_64): - Built demo-stm32f4-discovery and demo-stm32h7-nucleo - Passing all tests (cargo test --verbose --workspace) - Passing all format checks (cargo fmt --all --check) - Clippy checks are passing with no warnings This addresses the request in README.mkdn for help maintaining macOS support and continuous builds.
1 parent 837813b commit 1cf67a0

File tree

3 files changed

+59
-11
lines changed

3 files changed

+59
-11
lines changed

.github/workflows/build-boards.yml

Lines changed: 25 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,19 @@ jobs:
7777
run: |
7878
rustup show active-toolchain || rustup toolchain install
7979
rustup show
80-
rustup component add clippy
80+
# Add clippy to the active toolchain
81+
TOOLCHAIN=$(rustup show active-toolchain | cut -d' ' -f1)
82+
rustup component add --toolchain "$TOOLCHAIN" clippy
83+
84+
- name: Install dependencies (macOS)
85+
if: runner.os == 'macOS'
86+
run: |
87+
brew install libusb libftdi
88+
89+
- name: Install dependencies (Linux)
90+
if: runner.os == 'Linux'
91+
run: |
92+
sudo apt-get update && sudo apt-get install -y libusb-1.0-0-dev libftdi1-dev
8193
8294
- name: Cache build output
8395
uses: Swatinem/rust-cache@v2
@@ -106,15 +118,21 @@ jobs:
106118
RUST_BACKTRACE: 1
107119

108120
- name: Fetch Humility
109-
if: runner.os == 'Linux'
121+
if: runner.os == 'Linux' || runner.os == 'macOS'
110122
run: |
111-
curl -fLo target/release/humility https://github.com/oxidecomputer/humility/releases/download/nightly/humility
112-
chmod +x target/release/humility
123+
if [[ "$RUNNER_OS" == "macOS" ]]; then
124+
# Build from source on macOS until pre-built binaries are available
125+
cargo install --git https://github.com/oxidecomputer/humility.git --locked humility-bin
126+
mkdir -p target/release
127+
cp ~/.cargo/bin/humility target/release
128+
else
129+
curl -fLo target/release/humility https://github.com/oxidecomputer/humility/releases/download/nightly/humility
130+
chmod +x target/release/humility
131+
fi
113132
114133
- name: Test Humility manifest
115-
if: runner.os == 'Linux'
134+
if: runner.os == 'Linux' || runner.os == 'macOS'
116135
run: |
117-
sudo apt-get update && sudo apt-get install -y libusb-1.0-0-dev libftdi1-dev
118136
for image in ${images}; do
119137
mv "target/${name}/dist/${image}/build-${name}-image-${image}.zip" "target/${name}/dist/";
120138
target/release/humility -a "target/${name}/dist/build-${name}-image-${image}.zip" manifest;
@@ -124,7 +142,7 @@ jobs:
124142
images: ${{ matrix.image }}
125143

126144
- name: Clippy
127-
if: runner.os == 'Linux'
145+
if: runner.os == 'Linux' || runner.os == 'macOS'
128146
run: |
129147
cargo xtask clippy ${{ matrix.app_toml }} -- --deny warnings
130148

.github/workflows/ci.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,8 @@ jobs:
2929
name: Linux
3030
- os: windows-latest
3131
name: Windows
32+
- os: macos-latest
33+
name: macOS
3234
uses: ./.github/workflows/build-boards.yml
3335
with:
3436
os: ${{ matrix.os }}

README.mkdn

Lines changed: 32 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -57,10 +57,9 @@ The repo is laid out as follows.
5757

5858
# Developing
5959

60-
We currently support Linux and Windows as first-tier platforms. macOS is also
61-
used on a daily basis by Oxide employees, but is not tested in CI. The build
62-
probably also works on Illumos; if anyone would like to step up to maintain
63-
support and a continuous build for Illumos or macOS, we'd love the help.
60+
We currently support Linux, Windows, and macOS as first-tier platforms with continuous integration testing.
61+
The build probably also works on Illumos; if anyone would like to step up to maintain
62+
support and a continuous build for Illumos, we'd love the help.
6463

6564
To submit changes for review, push them to a branch in a fork and submit a pull
6665
request to merge that branch into `master`. For details, see
@@ -93,6 +92,35 @@ You will need:
9392
- `cargo install --git https://github.com/oxidecomputer/humility.git --locked humility-bin`
9493
- Requires `cargo-readme` as a dependency: `cargo install cargo-readme`
9594

95+
### macOS
96+
97+
Install dependencies using Homebrew:
98+
99+
```console
100+
$ brew install libusb libftdi
101+
```
102+
103+
If you will be running GDB, you can install ARM GDB tools:
104+
105+
```console
106+
$ brew install arm-none-eabi-gdb
107+
```
108+
109+
Note: The `gcc-arm-embedded` cask may have checksum mismatches. If you encounter issues, `arm-none-eabi-gdb` is a reliable alternative.
110+
111+
To install Humility:
112+
113+
```console
114+
$ cargo install cargo-readme
115+
$ cargo install --git https://github.com/oxidecomputer/humility.git --locked humility-bin
116+
```
117+
118+
Note: When building Hubris, rustup will automatically install the required nightly toolchain. You'll also need to add clippy to that toolchain:
119+
120+
```console
121+
$ rustup component add clippy
122+
```
123+
96124
### Windows
97125

98126
There are three alternative ways to install OpenOCD:

0 commit comments

Comments
 (0)