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