Skip to content

Commit 46aaeba

Browse files
Merge pull request #157 from datum-cloud/ci/macos-dsym-resolve-app-path
ci(macos): fix dSYM/Sentry paths when Dioxus output dir differs
2 parents a067264 + 2ea89be commit 46aaeba

4 files changed

Lines changed: 166 additions & 38 deletions

File tree

.github/workflows/bundle.yml

Lines changed: 90 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,15 @@ on:
77
- "v*"
88
pull_request:
99
branches: [main]
10+
# PRs only re-bundle when something that affects the output changed.
11+
# Doc / workflow / other changes get a free pass.
12+
paths:
13+
- "**/Cargo.toml"
14+
- "Cargo.lock"
15+
- "cli/**"
16+
- "lib/**"
17+
- "ui/**"
18+
- ".github/workflows/bundle.yml"
1019
workflow_dispatch:
1120

1221
jobs:
@@ -15,7 +24,11 @@ jobs:
1524
strategy:
1625
fail-fast: false
1726
matrix:
18-
os: [macos-latest, ubuntu-latest, windows-latest]
27+
# PRs run linux only as a smoke check; main/tag/manual runs cover all three OSes.
28+
# windows-2022 (not windows-latest): windows-latest aliases to VS18 preview,
29+
# whose MSVC 14.50 headers + cmake-rs can't resolve a Visual Studio generator
30+
# for aws-lc-sys, breaking `dx bundle`. Revisit once the ecosystem catches up.
31+
os: ${{ fromJSON(github.event_name == 'pull_request' && '["ubuntu-latest"]' || '["macos-latest","ubuntu-latest","windows-2022"]') }}
1932

2033
env:
2134
BUILD_N0DES_API_SECRET: ${{ secrets.N0DES_API_SECRET }}
@@ -28,9 +41,14 @@ jobs:
2841

2942
- uses: dtolnay/rust-toolchain@stable
3043

31-
- uses: cargo-bins/cargo-binstall@main
32-
44+
# Use a stable shared-key per OS instead of the default Cargo.toml/Cargo.lock hash.
45+
# `cargo generate-lockfile` and the in-place version bump otherwise rotate the
46+
# default cache key on every run, throwing away dep compile artefacts.
47+
# Only save the cache from main / tag / manual runs so PRs don't pollute it.
3348
- uses: Swatinem/rust-cache@v2
49+
with:
50+
shared-key: bundle-${{ matrix.os }}
51+
save-if: ${{ github.event_name != 'pull_request' }}
3452

3553
- name: Install system dependencies (Linux)
3654
if: runner.os == 'Linux'
@@ -45,15 +63,43 @@ jobs:
4563
libfuse2 \
4664
libxdo-dev
4765
48-
- name: Install Dioxus CLI
49-
# Library deps in ui/Cargo.toml are pinned to dioxus =0.7.9, but the CLI is
50-
# held back at 0.7.2 because dx bundle path resolution regressed in 0.7.3+
51-
# and the upstream fix is still open:
52-
# https://github.com/DioxusLabs/dioxus/issues/5233
53-
# Bump in lockstep with the lib once that issue is resolved.
54-
run: cargo binstall dioxus-cli@0.7.2 --disable-telemetry --locked --force -y
55-
env:
56-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
66+
# Library deps in ui/Cargo.toml are pinned to dioxus =0.7.9, but the CLI is
67+
# held back at 0.7.2 because dx bundle path resolution regressed in 0.7.3+
68+
# and the upstream fix is still open:
69+
# https://github.com/DioxusLabs/dioxus/issues/5233
70+
# Bump in lockstep with the lib once that issue is resolved.
71+
#
72+
# Download the prebuilt `dx` binary from GitHub releases rather than
73+
# `cargo install dioxus-cli`, which compiles the whole CLI from source
74+
# (5–10 min per matrix leg, every run).
75+
- name: Install Dioxus CLI (Unix)
76+
if: runner.os != 'Windows'
77+
shell: bash
78+
run: |
79+
set -euo pipefail
80+
DX_VER=0.7.2
81+
TRIPLE=$(rustc -Vv | awk '/^host:/{print $2}')
82+
URL="https://github.com/DioxusLabs/dioxus/releases/download/v${DX_VER}/dx-${TRIPLE}.tar.gz"
83+
echo "Downloading $URL"
84+
mkdir -p "$HOME/.cargo/bin"
85+
curl -fsSL "$URL" | tar -xz -C "$HOME/.cargo/bin"
86+
chmod +x "$HOME/.cargo/bin/dx"
87+
"$HOME/.cargo/bin/dx" --version
88+
89+
- name: Install Dioxus CLI (Windows)
90+
if: runner.os == 'Windows'
91+
shell: pwsh
92+
run: |
93+
$DX_VER = '0.7.2'
94+
$TRIPLE = ((rustc -Vv | Select-String '^host: ').ToString() -replace '^host: ','').Trim()
95+
$URL = "https://github.com/DioxusLabs/dioxus/releases/download/v$DX_VER/dx-$TRIPLE.zip"
96+
Write-Host "Downloading $URL"
97+
$tmp = Join-Path $env:RUNNER_TEMP 'dx.zip'
98+
Invoke-WebRequest -Uri $URL -OutFile $tmp -UseBasicParsing
99+
$dst = Join-Path $env:USERPROFILE '.cargo\bin'
100+
New-Item -ItemType Directory -Force -Path $dst | Out-Null
101+
Expand-Archive -Path $tmp -DestinationPath $dst -Force
102+
& (Join-Path $dst 'dx.exe') --version
57103
58104
- uses: actions/setup-node@v4
59105
if: runner.os == 'macOS'
@@ -167,8 +213,15 @@ jobs:
167213
APPLE_SIGNING_IDENTITY: ${{ secrets.APPLE_SIGNING_IDENTITY }}
168214
run: |
169215
mkdir -p ui/dist
170-
if [ ! -d ui/dist/Datum.app ] && [ -d ui/target/dx/Datum/release/macos/Datum.app ]; then
171-
cp -R ui/target/dx/Datum/release/macos/Datum.app ui/dist/
216+
if [ ! -d ui/dist/Datum.app ]; then
217+
if [ -d ui/target/dx/Datum/release/macos/Datum.app ]; then
218+
cp -R ui/target/dx/Datum/release/macos/Datum.app ui/dist/
219+
else
220+
APP=$(find ui/target/dx -path '*/release/macos/*.app' -type d 2>/dev/null | head -1)
221+
if [ -n "$APP" ]; then
222+
cp -R "$APP" ui/dist/Datum.app
223+
fi
224+
fi
172225
fi
173226
test -d ui/dist/Datum.app
174227
./ui/packaging/dmg/mk-dmg-icns-from-linux-png.sh
@@ -197,11 +250,22 @@ jobs:
197250
# sentry-cli has nothing to symbolicate against on macOS, so we run
198251
# dsymutil manually and stage the result outside the .app bundle so
199252
# it doesn't get packaged into the DMG.
200-
BIN="ui/target/dx/Datum/release/macos/Datum.app/Contents/MacOS/Datum"
253+
APP="ui/dist/Datum.app"
254+
if [ ! -d "$APP" ]; then
255+
APP=$(find ui/target/dx -path '*/release/macos/*.app' -type d 2>/dev/null | head -1)
256+
fi
257+
if [ -z "$APP" ] || [ ! -d "$APP" ]; then
258+
echo "macOS .app not found (expected ui/dist/Datum.app after DMG step)" >&2
259+
find ui/target/dx -type d -name '*.app' 2>/dev/null | head -20 >&2 || true
260+
exit 1
261+
fi
262+
EXEC=$(/usr/libexec/PlistBuddy -c 'Print :CFBundleExecutable' "$APP/Contents/Info.plist")
263+
BIN="$APP/Contents/MacOS/$EXEC"
201264
DSYM_DIR="$RUNNER_TEMP/dsyms"
202265
mkdir -p "$DSYM_DIR"
203266
if [ ! -f "$BIN" ]; then
204-
echo "Bundled binary not found at $BIN" >&2
267+
echo "Bundled binary not found at $BIN (app: $APP)" >&2
268+
ls -la "$APP/Contents/MacOS" >&2 || true
205269
exit 1
206270
fi
207271
dsymutil "$BIN" -o "$DSYM_DIR/Datum.dSYM"
@@ -221,9 +285,18 @@ jobs:
221285
mkdir -p "$INSTALL_DIR"
222286
export PATH="$INSTALL_DIR:$PATH"
223287
curl -sL https://sentry.io/get-cli/ | SENTRY_CLI_VERSION=3.2.3 sh
288+
MACOS_BIN_DIR="ui/dist/Datum.app/Contents/MacOS"
289+
if [ ! -d "$MACOS_BIN_DIR" ]; then
290+
APP=$(find ui/target/dx -path '*/release/macos/*.app' -type d 2>/dev/null | head -1)
291+
MACOS_BIN_DIR="${APP}/Contents/MacOS"
292+
fi
293+
if [ ! -d "$MACOS_BIN_DIR" ]; then
294+
echo "Sentry: macOS Contents/MacOS not found under ui/dist or ui/target/dx" >&2
295+
exit 1
296+
fi
224297
sentry-cli debug-files upload --include-sources \
225298
"$RUNNER_TEMP/dsyms" \
226-
ui/target/dx/Datum/release/macos/Datum.app/Contents/MacOS/
299+
"$MACOS_BIN_DIR"
227300
else
228301
echo "SENTRY_AUTH_TOKEN not set, skipping debug symbol upload"
229302
fi

.github/workflows/ci.yml

Lines changed: 15 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,18 +10,21 @@ jobs:
1010
ci:
1111
runs-on: ${{ matrix.os }}
1212
strategy:
13+
fail-fast: false
1314
matrix:
14-
os: [macos-latest, ubuntu-latest, windows-latest]
15+
# windows-2022 (not windows-latest) — see bundle.yml: windows-latest's VS18
16+
# preview breaks the aws-lc-sys cmake build via rustls.
17+
os: [macos-latest, ubuntu-latest, windows-2022]
1518

1619
steps:
1720
- uses: actions/checkout@v4
1821

1922
- uses: dtolnay/rust-toolchain@stable
2023

21-
- uses: cargo-bins/cargo-binstall@main
22-
2324
- uses: Swatinem/rust-cache@v2
24-
25+
with:
26+
shared-key: ci-${{ matrix.os }}
27+
2528
- name: Install system dependencies (Linux)
2629
if: runner.os == 'Linux'
2730
run: |
@@ -30,16 +33,24 @@ jobs:
3033
libwebkit2gtk-4.1-dev \
3134
libgtk-3-dev
3235
36+
# cargo check runs everywhere — catches OS-specific compile errors
37+
# (objc2 on macOS, winapi on Windows, gtk on Linux).
3338
- name: Cargo check
3439
run: cargo check --locked
3540

41+
# The remaining steps only need one OS: lib has no OS-specific code paths,
42+
# clippy lints are portable, and rustfmt is OS-agnostic. Running on Linux
43+
# only saves ~5 min per CI run.
3644
- name: Cargo test
45+
if: runner.os == 'Linux'
3746
env:
3847
RUST_LOG: warn,lib=trace,iroh_proxy_utils=trace
3948
run: cargo test -p lib --locked
4049

4150
- name: Cargo clippy
51+
if: runner.os == 'Linux'
4252
run: cargo clippy --workspace --all-features --all-targets --lib --bins --tests --benches --examples
4353

4454
- name: Cargo fmt
55+
if: runner.os == 'Linux'
4556
run: cargo fmt --check --all

.github/workflows/manual-release.yml

Lines changed: 50 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,9 @@ jobs:
1919
strategy:
2020
fail-fast: false
2121
matrix:
22-
os: [macos-latest, ubuntu-latest, windows-latest]
22+
# windows-2022 (not windows-latest) — see bundle.yml: windows-latest's VS18
23+
# preview breaks the aws-lc-sys cmake build via rustls.
24+
os: [macos-latest, ubuntu-latest, windows-2022]
2325

2426
env:
2527
BUILD_N0DES_API_SECRET: ${{ secrets.N0DES_API_SECRET }}
@@ -32,9 +34,10 @@ jobs:
3234

3335
- uses: dtolnay/rust-toolchain@stable
3436

35-
- uses: cargo-bins/cargo-binstall@main
36-
37+
# Stable shared-key per OS — see bundle.yml for rationale.
3738
- uses: Swatinem/rust-cache@v2
39+
with:
40+
shared-key: bundle-${{ matrix.os }}
3841

3942
- name: Install system dependencies (Linux)
4043
if: runner.os == 'Linux'
@@ -49,15 +52,41 @@ jobs:
4952
libfuse2 \
5053
libxdo-dev
5154
52-
- name: Install Dioxus CLI
53-
# Library deps in ui/Cargo.toml are pinned to dioxus =0.7.9, but the CLI is
54-
# held back at 0.7.2 because dx bundle path resolution regressed in 0.7.3+
55-
# and the upstream fix is still open:
56-
# https://github.com/DioxusLabs/dioxus/issues/5233
57-
# Bump in lockstep with the lib once that issue is resolved.
58-
run: cargo binstall dioxus-cli@0.7.2 --disable-telemetry --locked --force -y
59-
env:
60-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
55+
# Library deps in ui/Cargo.toml are pinned to dioxus =0.7.9, but the CLI is
56+
# held back at 0.7.2 because dx bundle path resolution regressed in 0.7.3+
57+
# and the upstream fix is still open:
58+
# https://github.com/DioxusLabs/dioxus/issues/5233
59+
# Bump in lockstep with the lib once that issue is resolved.
60+
#
61+
# Download the prebuilt `dx` binary; see bundle.yml for rationale.
62+
- name: Install Dioxus CLI (Unix)
63+
if: runner.os != 'Windows'
64+
shell: bash
65+
run: |
66+
set -euo pipefail
67+
DX_VER=0.7.2
68+
TRIPLE=$(rustc -Vv | awk '/^host:/{print $2}')
69+
URL="https://github.com/DioxusLabs/dioxus/releases/download/v${DX_VER}/dx-${TRIPLE}.tar.gz"
70+
echo "Downloading $URL"
71+
mkdir -p "$HOME/.cargo/bin"
72+
curl -fsSL "$URL" | tar -xz -C "$HOME/.cargo/bin"
73+
chmod +x "$HOME/.cargo/bin/dx"
74+
"$HOME/.cargo/bin/dx" --version
75+
76+
- name: Install Dioxus CLI (Windows)
77+
if: runner.os == 'Windows'
78+
shell: pwsh
79+
run: |
80+
$DX_VER = '0.7.2'
81+
$TRIPLE = ((rustc -Vv | Select-String '^host: ').ToString() -replace '^host: ','').Trim()
82+
$URL = "https://github.com/DioxusLabs/dioxus/releases/download/v$DX_VER/dx-$TRIPLE.zip"
83+
Write-Host "Downloading $URL"
84+
$tmp = Join-Path $env:RUNNER_TEMP 'dx.zip'
85+
Invoke-WebRequest -Uri $URL -OutFile $tmp -UseBasicParsing
86+
$dst = Join-Path $env:USERPROFILE '.cargo\bin'
87+
New-Item -ItemType Directory -Force -Path $dst | Out-Null
88+
Expand-Archive -Path $tmp -DestinationPath $dst -Force
89+
& (Join-Path $dst 'dx.exe') --version
6190
6291
- uses: actions/setup-node@v4
6392
if: runner.os == 'macOS'
@@ -153,8 +182,15 @@ jobs:
153182
APPLE_SIGNING_IDENTITY: ${{ secrets.APPLE_SIGNING_IDENTITY }}
154183
run: |
155184
mkdir -p ui/dist
156-
if [ ! -d ui/dist/Datum.app ] && [ -d ui/target/dx/Datum/release/macos/Datum.app ]; then
157-
cp -R ui/target/dx/Datum/release/macos/Datum.app ui/dist/
185+
if [ ! -d ui/dist/Datum.app ]; then
186+
if [ -d ui/target/dx/Datum/release/macos/Datum.app ]; then
187+
cp -R ui/target/dx/Datum/release/macos/Datum.app ui/dist/
188+
else
189+
APP=$(find ui/target/dx -path '*/release/macos/*.app' -type d 2>/dev/null | head -1)
190+
if [ -n "$APP" ]; then
191+
cp -R "$APP" ui/dist/Datum.app
192+
fi
193+
fi
158194
fi
159195
test -d ui/dist/Datum.app
160196
./ui/packaging/dmg/mk-dmg-icns-from-linux-png.sh

ui/packaging/dmg/build-dmg.sh

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -57,9 +57,17 @@ if [[ "$DO_BUNDLE" == true ]]; then
5757
fi
5858

5959
mkdir -p "$UI_ROOT/dist"
60-
if [[ ! -d "$UI_ROOT/dist/Datum.app" ]] && [[ -d "$UI_ROOT/target/dx/Datum/release/macos/Datum.app" ]]; then
61-
echo "Copying Datum.app from target/dx → dist/"
62-
cp -R "$UI_ROOT/target/dx/Datum/release/macos/Datum.app" "$UI_ROOT/dist/"
60+
if [[ ! -d "$UI_ROOT/dist/Datum.app" ]]; then
61+
if [[ -d "$UI_ROOT/target/dx/Datum/release/macos/Datum.app" ]]; then
62+
echo "Copying Datum.app from target/dx → dist/"
63+
cp -R "$UI_ROOT/target/dx/Datum/release/macos/Datum.app" "$UI_ROOT/dist/"
64+
else
65+
APP=$(find "$UI_ROOT/target/dx" -path '*/release/macos/*.app' -type d 2>/dev/null | head -1)
66+
if [[ -n "$APP" ]]; then
67+
echo "Copying $APP → dist/Datum.app"
68+
cp -R "$APP" "$UI_ROOT/dist/Datum.app"
69+
fi
70+
fi
6371
fi
6472

6573
if [[ ! -d "$UI_ROOT/dist/Datum.app" ]]; then

0 commit comments

Comments
 (0)