jetify-com / devbox

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

[Bug]: devbox add <package_name> command crash when path not looks like url #1429

Open Akiyamka opened 1 year ago

Akiyamka commented 1 year ago

Current Behavior (bug) devbox add <package_name> command crash with error

Error: There was an error installing nix packages
source: Command: /home/user_name/.nix-profile/bin/nix print-dev-env /home/user_name/Downloads/an path with spaces/or/non_latin_chars/Åα«Ñ¬Γ/.devbox/gen/flake/flake.nix --extra-experimental-features ca-derivations --option experimental-features nix-command flakes --json: exit status 1

[DEBUG] 2023/08/29 11:02:03 go.jetpack.io/devbox/internal/boxcli/midcobra/debug.go:72: Command stderr: error: '/home/user_name/.nix-profile/bin/nix print-dev-env /home/user_name/Downloads/an path with spaces/or/non_latin_chars/Åα«Ñ¬Γ/.devbox/gen/flake/flake.nix ' is not a valid URL

Expected Behavior (fix) I expect that devbox supports all that filesystem can - spaces, non latin letters

Additional context

devbox version -v
Version:     0.5.11
Platform:    linux_amd64
Commit:      1052c4e37c16ce0df5d60afb8c82076cd290eee8
Commit Time: 2023-08-10T23:32:09Z
Go Version:  go1.20.7
Launcher:    0.2.0

cat devbox.json
{
  "packages": [],
  "shell": {
    "init_hook": [
      "echo 'Welcome to devbox!' > /dev/null"
    ],
    "scripts": {
      "test": [
        "echo \"Error: no test specified\" && exit 1"
      ]
    }
  }
}
savil commented 1 year ago

@Akiyamka which package did you try to install?

Akiyamka commented 1 year ago

I am trying install nodejs

devbox add nodejs
savil commented 1 year ago

oh I think I understand now. Its not the package-name that is important. The directory you are in is: /home/user_name/Downloads/an path with spaces/or/non_latin_chars/Åα«Ñ¬Γ/ and you'd like that to be supported.

Akiyamka commented 1 year ago

@savil yep. I try to avoid such names for directories, but inexperienced developers may encounter problems when trying to run the environment using devbox. For example, the user name can often contain the most unexpected characters.

rexfordkelly commented 4 months ago

Yeah, I just uninstalled and reinstalled Nix and Devbox... only to find that it was a space in a parent directory which had been causing the issues.

If this is not supported, an error or warning should be thrown...