devbox
devbox copied to clipboard
devbox global puts nixpkgs stdenv in my PATH
Current Behavior (bug)
Running eval "$(devbox global shellenv)" adds the nixpkgs stdenv packages to my PATH, even though those packages weren't added with devbox global add. This includes packages like:
- clang
- bash
- coreutils
which can have unintentional (and surprising) effects on the rest of the system.
For example, the clang wrapper sets flags that modify the system frameworks/libraries that get linked by default, which can break compiling macOS programs. For example, the linker fails to find the macOS Virtualization Framework with:
$ clang -framework Foundation -framework Virtualization -framework Cocoa ...
fatal error: 'Virtualization/Virtualization.h' file not found
#import <Virtualization/Virtualization.h>
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
3 warnings and 1 error generated.
Running the same exact command with /usr/bin/clang succeeds.
This also happens with a non-global devbox shell, making it difficult to use Devbox with native macOS development.
Expected Behavior (fix)
Don't add packages to my PATH unless I've explicitly added it to my devbox global profile. This might mean not using the print-dev-env environment for global and instead only adding the nix profile's bin directory to the PATH.
One thing to be aware of is that these packages might be needed so that other packages work as expected. For example, python/pip might need clang in order to compile native extensions. We should test this out to better understand the effects.
Packages in ~/.local/share/devbox/global/default:
{
"packages": [
"awscli2@latest",
"bash@latest",
"brotli@latest",
"cmark@latest",
"dash@latest",
"delve@latest",
"direnv@latest",
"fish@latest",
"flyctl@latest",
"gh@latest",
"git@latest",
"gnupg@latest",
"go@latest",
"golangci-lint@latest",
"graphviz@latest",
"jq@latest",
"k6@latest",
"kubernetes-helm@latest",
"nginx@latest",
"nixpkgs-fmt@latest",
"nodejs@20",
"openssh@latest",
"postgresql@latest",
"python3@latest",
"readline@latest",
"ripgrep@latest",
"sentry-cli@latest",
"shellcheck@latest",
"sqlfluff@latest",
"sqlite@latest",
"terraform@latest",
"tree@latest",
"vim@latest",
"xz@latest",
"yq@latest",
"zsh@latest",
"zstd@latest"
]
}