devbox
devbox copied to clipboard
Q: Support for multiple devbox environments?
Is it possible to have different environments with different shells? I move to a different directory and create a new devbox.json but running devbox shell still contains the installed packages from the original devbox.json.
Perhaps this is a question pertinent only to Rust? I installed Clojure via one of the shells and it didn't show in the other shell.
Edit: Okay, I think I have it sorted, but perhaps some clarification on how it works?
Rust doesn't seem to work on macOS in a devbox shell. A simple default app created with cargo doesn't link properly. Not sure what the issue is. Probably on the Rust side?
@icosahedron We do support different shells with different environments. I suspect you ran into an issue by accidentally calling devbox shell inside devbox shell. It's happened to us a few times internally.
We just released a new version of devbox that prevents you from making that mistake (shell-inception is what we call it)
Re: rust compilation, I can't tell if that's due to the nested shells ... or something else. Would you mind making sure you're not in a nested shell, and then trying to compile again? If it doesn't work:
- Would you be able to send me the output of
env? (do scrub any sensitive env variables first) Mainly looking to see if there's something else interfering. - Is there a sample rust project you could point me that is representative of what you're trying to do? That way I could try building it myself to see if I can get it to work.
I too have been accidentally a few shells deep ¯_(ツ)_/¯, but the rust issue isn't related to that. (😆 at the name of shell inception). I've pushed a repo with the little project that I'm working on.
https://codeberg.org/icosahedron/rust-roguelike/src/branch/devbox
It fails linking with the errors cargo-build-error.txt
And here are the requested environment variables. devbox-env.txt
I should state that I used devbox add rustup and then used that to install the Rust toolchain from inside devbox shell. It seems to install correctly, in that cargo and rustc are in nix directories?
Hey @icosahedron, I did some digging and testing on my end, and I think the error you posted above is because AppKit framework is not available in your devbox shell. I was able to add it to my devbox by running:
devbox add darwin.apple_sdk.frameworks.AppKit
Can you try that in your project and see if that helps?
Nice. Thanks for researching that. I guess I misunderstood how nix works. I thought it would pick up the existing installed framework, so I was trying to figure out how my path was wrong.