Skip to content

nested shells make it harder to debug issues; document workarounds for better local dev #2699

@jay-aye-see-kay

Description

@jay-aye-see-kay

What problem are you trying to solve?

When debugging devbox (and trying to submit a fix) many commands spawn a nested devbox subprocess with the --run-in-current-shell flag. The current process doesn't really do any work, just spawns the subprocess. This means adding debug logs and running devbox services up won't emit any - all the interesting stuff will happen in the subprocess, which is the installed version of devbox.

I have a couple workarounds but I feel this should be documented in the repo

What solution would you like?

The most robust fix I've found is instead of doing devbox run build && ./dist/devbox <whatever> (what I would expect to work)

  1. build and move it
    devbox run build
    mkdir -p ~/.cache/devbox/bin/0.0.0-dev_darwin_arm64/
    mv dist/devbox ~/.cache/devbox/bin/0.0.0-dev_darwin_arm64/
  2. then in any shell, any directory
    export DEVBOX_USE_VERSION=0.0.0-dev
    devbox <whatever>

Alternatives you've considered

An alternative fix is to pass the --run-in-current-shell flag, but this behavior will slightly differ from a real devbox build, meaning some issues can't be reproduced (in my current case).

./dist/devbox <whatever> --run-in-current-shell

Metadata

Metadata

Assignees

No one assigned

    Labels

    featureNew feature or requesttriageIssue needs triage

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions