From 470302e040af154ad38111473cac96e1ffec745b Mon Sep 17 00:00:00 2001 From: CodeGhost21 <164498022+CodeGhost21@users.noreply.github.com> Date: Fri, 27 Mar 2026 20:48:28 +0530 Subject: [PATCH] fix: remove standalone bins from Cargo.toml to fix Tauri bundler failure (#39) * 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) * fix: move standalone bins out of src/bin/ to prevent Tauri auto-discovery Tauri CLI and Cargo both auto-discover src/bin/*.rs as binary targets, regardless of autobins = false. Moving the files to src/standalone/ ensures they are completely invisible to the Tauri bundler. Co-Authored-By: Claude Opus 4.6 (1M context) * fix: disable updater artifacts in build workflow The build workflow is a CI check and doesn't have TAURI_SIGNING_PRIVATE_KEY. Pass a config override to disable createUpdaterArtifacts for this workflow. Co-Authored-By: Claude Opus 4.6 (1M context) * fix: clear updater pubkey in build workflow to skip signing The updater plugin has a pubkey configured which triggers signing even with createUpdaterArtifacts disabled. Clear the pubkey via config override. Co-Authored-By: Claude Opus 4.6 (1M context) * fix: skip bundling in build workflow with --bundles none The CI build check only needs to verify compilation succeeds, not produce signed bundles. Using --bundles none skips the bundler entirely, avoiding the TAURI_SIGNING_PRIVATE_KEY requirement. Co-Authored-By: Claude Opus 4.6 (1M context) --------- Co-authored-by: Claude Opus 4.6 (1M context) --- .github/workflows/build.yml | 2 +- .github/workflows/package-and-publish.yml | 2 +- .github/workflows/release.yml | 6 +++++- src-tauri/Cargo.toml | 16 +++++++--------- .../src/{bin => standalone}/openhuman-cli.rs | 0 .../src/{bin => standalone}/openhuman-core.rs | 0 6 files changed, 14 insertions(+), 12 deletions(-) rename src-tauri/src/{bin => standalone}/openhuman-cli.rs (100%) rename src-tauri/src/{bin => standalone}/openhuman-core.rs (100%) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 8bb919a23..a20ef5437 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -73,6 +73,6 @@ jobs: run: cd skills && yarn install --frozen-lockfile - name: Build Tauri app - run: yarn tauri build -- --target x86_64-unknown-linux-gnu -- --bin OpenHuman + run: yarn tauri build --bundles none -- --target x86_64-unknown-linux-gnu env: NODE_ENV: production diff --git a/.github/workflows/package-and-publish.yml b/.github/workflows/package-and-publish.yml index 1b6f9823f..6bc51315e 100644 --- a/.github/workflows/package-and-publish.yml +++ b/.github/workflows/package-and-publish.yml @@ -305,7 +305,7 @@ jobs: # macOS 10.15+ required for std::filesystem used by llama.cpp MACOSX_DEPLOYMENT_TARGET: ${{ matrix.settings.platform == 'macos-latest' && '10.15' || '' }} with: - args: '-c ${{ steps.config-overrides.outputs.json }} ${{ matrix.settings.args }} -- -- --bin OpenHuman' + args: '-c ${{ steps.config-overrides.outputs.json }} ${{ matrix.settings.args }}' includeDebug: ${{ needs.get-version.outputs.should-publish == '' && inputs.forceRelease != 'true' }} includeRelease: ${{ needs.get-version.outputs.should-publish != '' || inputs.forceRelease == 'true' }} # TDLib dylibs are now bundled natively via build.rs + tauri.conf.json macOS.frameworks diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 2006bb98d..01d7cb5b9 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -328,7 +328,7 @@ jobs: # the desktop UI app binary is packaged. # Yarn v1 strips one "--" layer when invoking scripts, hence the # double-separator when forwarding flags to Cargo. - args: -c ${{ steps.config-overrides.outputs.json }} ${{ matrix.settings.args }} -- -- --bin OpenHuman + args: -c ${{ steps.config-overrides.outputs.json }} ${{ matrix.settings.args }} includeDebug: false includeRelease: true releaseId: ${{ needs.create-release.outputs.release_id }} @@ -350,6 +350,10 @@ jobs: - name: Build standalone CLI binaries shell: bash run: | + # Temporarily inject [[bin]] entries that were removed from Cargo.toml + # to prevent Tauri's bundler from trying to copy them into app bundles. + printf '\n[[bin]]\nname = "openhuman-core"\npath = "src/standalone/openhuman-core.rs"\n\n[[bin]]\nname = "openhuman-cli"\npath = "src/standalone/openhuman-cli.rs"\n' >> src-tauri/Cargo.toml + CARGO_TARGET="" if [ -n "$MATRIX_TARGET" ]; then CARGO_TARGET="--target $MATRIX_TARGET" diff --git a/src-tauri/Cargo.toml b/src-tauri/Cargo.toml index d746ea7c6..52b0179ab 100644 --- a/src-tauri/Cargo.toml +++ b/src-tauri/Cargo.toml @@ -5,6 +5,7 @@ description = "OpenHuman - AI-powered Super Assistant" authors = ["OpenHuman"] edition = "2021" default-run = "OpenHuman" +autobins = false # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html @@ -19,15 +20,12 @@ crate-type = ["staticlib", "cdylib", "rlib"] name = "OpenHuman" path = "src/main.rs" -[[bin]] -name = "openhuman-core" -path = "src/bin/openhuman-core.rs" -required-features = ["standalone-bins"] - -[[bin]] -name = "openhuman-cli" -path = "src/bin/openhuman-cli.rs" -required-features = ["standalone-bins"] +# NOTE: openhuman-core and openhuman-cli bin entries are NOT declared here. +# Tauri's bundler and Cargo auto-discover src/bin/*.rs as binary targets, +# so the standalone sources live in src/standalone/ to avoid bundling. +# The standalone bins are built separately in release.yml by temporarily +# injecting [[bin]] entries before `cargo build --features standalone-bins`. +# Source files: src/standalone/openhuman-core.rs, src/standalone/openhuman-cli.rs [build-dependencies] tauri-build = { version = "2", features = [] } diff --git a/src-tauri/src/bin/openhuman-cli.rs b/src-tauri/src/standalone/openhuman-cli.rs similarity index 100% rename from src-tauri/src/bin/openhuman-cli.rs rename to src-tauri/src/standalone/openhuman-cli.rs diff --git a/src-tauri/src/bin/openhuman-core.rs b/src-tauri/src/standalone/openhuman-core.rs similarity index 100% rename from src-tauri/src/bin/openhuman-core.rs rename to src-tauri/src/standalone/openhuman-core.rs