Skip to content

Commit 2e31133

Browse files
CodeGhost21claude
andcommitted
fix: remove standalone bins from Cargo.toml to fix Tauri bundler failure
Tauri's bundler reads all [[bin]] entries from Cargo.toml and tries to copy them into the app bundle, even when gated behind required-features. This caused CI to fail with "openhuman-cli does not exist" because only the OpenHuman binary was compiled. - Remove openhuman-cli and openhuman-core [[bin]] entries from Cargo.toml - Add autobins = false to prevent Cargo auto-discovering src/bin/*.rs - Remove --bin OpenHuman flag from build/package-and-publish/release workflows - In release.yml, inject [[bin]] entries temporarily for standalone build step Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent cd2b292 commit 2e31133

4 files changed

Lines changed: 14 additions & 12 deletions

File tree

.github/workflows/build.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,6 @@ jobs:
7373
run: cd skills && yarn install --frozen-lockfile
7474

7575
- name: Build Tauri app
76-
run: yarn tauri build -- --target x86_64-unknown-linux-gnu -- --bin OpenHuman
76+
run: yarn tauri build -- --target x86_64-unknown-linux-gnu
7777
env:
7878
NODE_ENV: production

.github/workflows/package-and-publish.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -305,7 +305,7 @@ jobs:
305305
# macOS 10.15+ required for std::filesystem used by llama.cpp
306306
MACOSX_DEPLOYMENT_TARGET: ${{ matrix.settings.platform == 'macos-latest' && '10.15' || '' }}
307307
with:
308-
args: '-c ${{ steps.config-overrides.outputs.json }} ${{ matrix.settings.args }} -- -- --bin OpenHuman'
308+
args: '-c ${{ steps.config-overrides.outputs.json }} ${{ matrix.settings.args }}'
309309
includeDebug: ${{ needs.get-version.outputs.should-publish == '' && inputs.forceRelease != 'true' }}
310310
includeRelease: ${{ needs.get-version.outputs.should-publish != '' || inputs.forceRelease == 'true' }}
311311
# TDLib dylibs are now bundled natively via build.rs + tauri.conf.json macOS.frameworks

.github/workflows/release.yml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -328,7 +328,7 @@ jobs:
328328
# the desktop UI app binary is packaged.
329329
# Yarn v1 strips one "--" layer when invoking scripts, hence the
330330
# double-separator when forwarding flags to Cargo.
331-
args: -c ${{ steps.config-overrides.outputs.json }} ${{ matrix.settings.args }} -- -- --bin OpenHuman
331+
args: -c ${{ steps.config-overrides.outputs.json }} ${{ matrix.settings.args }}
332332
includeDebug: false
333333
includeRelease: true
334334
releaseId: ${{ needs.create-release.outputs.release_id }}
@@ -350,6 +350,10 @@ jobs:
350350
- name: Build standalone CLI binaries
351351
shell: bash
352352
run: |
353+
# Temporarily inject [[bin]] entries that were removed from Cargo.toml
354+
# to prevent Tauri's bundler from trying to copy them into app bundles.
355+
printf '\n[[bin]]\nname = "openhuman-core"\npath = "src/bin/openhuman-core.rs"\n\n[[bin]]\nname = "openhuman-cli"\npath = "src/bin/openhuman-cli.rs"\n' >> src-tauri/Cargo.toml
356+
353357
CARGO_TARGET=""
354358
if [ -n "$MATRIX_TARGET" ]; then
355359
CARGO_TARGET="--target $MATRIX_TARGET"

src-tauri/Cargo.toml

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ description = "OpenHuman - AI-powered Super Assistant"
55
authors = ["OpenHuman"]
66
edition = "2021"
77
default-run = "OpenHuman"
8+
autobins = false
89

910
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
1011

@@ -19,15 +20,12 @@ crate-type = ["staticlib", "cdylib", "rlib"]
1920
name = "OpenHuman"
2021
path = "src/main.rs"
2122

22-
[[bin]]
23-
name = "openhuman-core"
24-
path = "src/bin/openhuman-core.rs"
25-
required-features = ["standalone-bins"]
26-
27-
[[bin]]
28-
name = "openhuman-cli"
29-
path = "src/bin/openhuman-cli.rs"
30-
required-features = ["standalone-bins"]
23+
# NOTE: openhuman-core and openhuman-cli bin entries are NOT declared here.
24+
# Tauri's bundler tries to copy ALL [[bin]] targets into the app bundle,
25+
# even when they are gated behind required-features and not compiled.
26+
# The standalone bins are built separately in release.yml by temporarily
27+
# injecting [[bin]] entries before `cargo build --features standalone-bins`.
28+
# Source files: src/bin/openhuman-core.rs, src/bin/openhuman-cli.rs
3129

3230
[build-dependencies]
3331
tauri-build = { version = "2", features = [] }

0 commit comments

Comments
 (0)