Skip to content

A release build can take its app folder from the working directory #956

Closed

Description

@thcp

Problem

At start the desktop shell looked for its app root in the current working directory before looking beside its own executable. That probe exists for development runs. In a release build, an exe started from a terminal whose current folder is a StemDeck source checkout used that checkout as its app root instead of its own folder, so it ran the wrong backend against the wrong data.

Who is affected: anyone who starts a release or portable build from a terminal inside a StemDeck project folder. Rare, but silent.

Where

  • desktop/src-tauri/src/main.rs:5398 app_root
  • desktop/src-tauri/src/main.rs:5430 cwd_repo_root

Current state

Fixed in PR #891 (merged into big-release, ships with 0.21.0).

Proposed fix

What the merged fix does: the working directory probe lives in cwd_repo_root(cwd, debug_build), and app_root passes cfg!(debug_assertions). A release build skips it and goes from STEMDECK_ROOT straight to the folder beside the executable. Debug runs keep the probe.

Verification

  • cargo test --manifest-path desktop/src-tauri/Cargo.toml only_debug_builds_take_the_app_root_from_the_working_directory
  • By hand: open a terminal in a StemDeck checkout, start a release StemDeck.exe that lives in another folder by its full path, and confirm it runs the backend beside that exe, not the one in the checkout.

Activity

  1. added
    bugSomething isn't working
    on Nov 3, 2026
  2. thcp commented on Nov 3, 2026

    @thcp
    CollaboratorAuthor

    This is fixed in PR #891, merged into big-release. It ships with 0.21.0, so I am closing this issue now.

    This comment was written with the help of AI.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions