Skip to content

fix(desktop): fix native build script not copying binaries to dist during local builds #18079

@thisisryanswift

Description

@thisisryanswift

Bug Description

When running npm run build-native locally without a specific --target argument, the Rust binaries (such as desktop_proxy on Linux) are compiled successfully but are not copied to the apps/desktop/desktop_native/dist/ directory.
This causes subsequent packaging commands (like npm run flatpak:dev) to fail because electron-builder expects the binaries to exist in dist/ with specific names (e.g., desktop_proxy.linux-x64).

Steps To Reproduce

  1. On a Linux machine, check out the repository.
  2. Navigate to apps/desktop.
  3. Run npm run build-native.
  4. Run npm run flatpak:dev.
    Expected Behavior:
    The Flatpak build should succeed.
    Actual Behavior:
    The build fails with an error from electron-builder stating that the source file desktop_native/dist/desktop_proxy.linux-x64 does not exist.

Root Cause

In apps/desktop/desktop_native/build.js, the buildProxyBin function wraps the file copy logic in an if (target) block. During local development, target is typically undefined, so the copy step is skipped.

Proposed Fix

Update build.js to perform the copy operation even when target is undefined, defaulting to the current platform/architecture naming convention expected by electron-builder.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions