Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Devbox should handle spaces in paths #1914

Closed
Lagoja opened this issue Mar 20, 2024 · 4 comments
Closed

Devbox should handle spaces in paths #1914

Lagoja opened this issue Mar 20, 2024 · 4 comments
Labels
feature New feature or request triage Issue needs triage
Milestone

Comments

@Lagoja
Copy link
Contributor

Lagoja commented Mar 20, 2024

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 Lagoja added feature New feature or request triage Issue needs triage labels Mar 20, 2024
@Lagoja Lagoja added this to the 0.11 milestone Mar 20, 2024
@Lagoja
Copy link
Contributor Author

Lagoja commented Mar 20, 2024

Related issues #1876 #1429 #971

savil added a commit that referenced this issue Mar 22, 2024
In aid of #1914

Added some basic support for spaces. I think this requires more extensive testing around:
1. plugins
2. flake packages

I should try to have the examples tests run in cicd with a space in their path.
savil added a commit that referenced this issue Mar 22, 2024
In aid of #1914

Added some basic support for spaces. I think this requires more extensive testing around:
1. plugins
2. flake packages

I should try to have the examples tests run in cicd with a space in their path.
savil added a commit that referenced this issue Mar 22, 2024
## Summary
In aid of #1914

Added some basic support for spaces. I think this requires more
extensive testing around:
1. plugins
2. flake packages

I should try to have the examples tests run in cicd with a space in
their path.


## How was it tested?

```
mkdir -p `/Users/<omitted>/code/jetpack/devbox-projects/path with space`
devbox init
devbox shell
devbox add hello
devbox add cowsay
```

could run:
```
cowsay hello
```

set `export FISH=$(which fish)` and repeat the above steps
savil added a commit that referenced this issue Mar 25, 2024
## Summary

Related to #1914

Ran into this scenario during further testing

## How was it tested?

move the plugins examples:
`mv devbox/examples "devbox/examples with plugins"`

`cd examples/plugins with spaces/v2-github`
`devbox run run_test` -> this would previously fail
@ademlabs
Copy link

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

@Lagoja
Copy link
Contributor Author

Lagoja commented Oct 8, 2024

Spaces in Paths should be fixed as of Devbox 0.13.1

@Lagoja Lagoja closed this as completed Oct 8, 2024
@deftdawg
Copy link

deftdawg commented Nov 1, 2024

EDIT: Nevermind, I see there's a change to 0.13.6 which should address it (#2393)

Unfortunately it's still broken in 0.13.4...

I think this change was supposed to resolve it (my system is running bash):
ac07204#diff-38f085ff12c1d3451f41d90ca82ba777f763554116f422c12c8ca92d722f583fR59

devbox version
# 0.13.4
mkdir -p parent\ space/devbox-test
cd parent\ space/devbox-test/
devbox init
devbox gen direnv
# Info: Ensuring packages are installed.
# ✓ Computed the Devbox environment.
# Success: generated .envrc file
# Success: ran `direnv allow`
# direnv: loading ~/source/parent space/devbox-test/.envrc
# direnv: using devbox
# ./.envrc:179: /home/deftdawg/source/parent: No such file or directory
# direnv: export +AR +AS +CC +CONFIG_SHELL +CXX +DEVBOX_CONFIG_DIR +DEVBOX_INIT_PATH +DEVBOX_NIX_ENV_PATH_bc3de5263524d52266b11898d6cb33e3bc0d50777a2551a0bebd8d2ac9a45a20 +DEVBOX_PACKAGES_DIR +DEVBOX_PATH_STACK +DEVBOX_PROJECT_ROOT +DEVBOX_SYSTEM_BASH +DEVBOX_SYSTEM_SED +DEVBOX_WD +HOST_PATH +IN_NIX_SHELL +LD +NIX_BINTOOLS +NIX_BINTOOLS_WRAPPER_TARGET_HOST_x86_64_unknown_linux_gnu +NIX_BUILD_CORES +NIX_CC +NIX_CC_WRAP

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature New feature or request triage Issue needs triage
Development

No branches or pull requests

3 participants