jetify-com / devbox

Instant, easy, and predictable development environments
https://www.jetify.com/devbox/
Apache License 2.0
7.94k stars 191 forks source link

Devbox should handle spaces in paths #1914

Open Lagoja opened 3 months ago

Lagoja commented 3 months ago

What problem are you trying to solve?

I'm frustrated when I try to use Devbox with a path that has a space in it. For example: if my Devbox project is in the following path:

~/src/repros/spaced path

Devbox will fail with the following error:

Error: nix print-dev-env --json "path:/Users/johnlago/src/repros/spaced path/.devbox/gen/flake": exit status 1

With DEVBOX_DEBUG=1:

...
2024/03/20 16:54:06 Running print-dev-env cmd: /nix/var/nix/profiles/default/bin/nix print-dev-env path:/Users/johnlago/src/repros/spaced path/.devbox/gen/flake --extra-experimental-features ca-derivations --option experimental-features nix
✓ Computed the Devbox environment.
Error: nix print-dev-env --json "path:/Users/johnlago/src/repros/spaced path/.devbox/gen/flake": exit status 1

2024/03/20 16:54:07 Command stderr: path '/Users/johnlago/src/repros/spaced path/path:/Users/johnlago/src/repros/spaced path/.devbox/gen/flake' does not contain a 'flake.nix', searching up
error: getting status of '/Users/johnlago/src/repros/spaced path/path:/Users/johnlago/src/repros/spaced path/.devbox/gen/flake': No such file or directory
...

What solution would you like?

As of Nix 2.19, flakes + print-dev-env support paths that are URL or percent encoded. We should adapt our command to use percent encoding, so we can support spaced paths.

Alternatives you've considered

Not using paths with spaces

Lagoja commented 3 months ago

Related issues #1876 #1429 #971

ademlabs commented 2 days ago

Is this in the latest release (0.12)? Still having this issue currently.