What happened?
When using nix-shell / nix develop, adding a library package implicitly makes its headers available via the dev output (through normal buildInputs semantics).
Devbox does not do this. As a result, headers are missing unless the user manually adds <package>.dev.
This breaks common C/C++ expectations and makes Devbox environments subtly incomplete compared to standard Nix shells.
Expected result
yaml.h should be available automatically, as it is in nix-shell / nix develop when adding libyaml.
Actual result
Compilation fails because headers are missing:
main.c:1:10: fatal error: yaml.h: No such file or directory
Workaround
Manually add the dev output:
After this, compilation succeeds.
Why this is a problem
- In
nixpkgs, headers live in the dev output by design.
nix-shell users reasonably expect headers to be present when a library is added.
- Devbox requires users to know about and manually add output-specific derivations, which defeats the abstraction Devbox aims to provide.
- This is especially painful for newcomers unfamiliar with
outputs = [ "out" "dev" ].
Suggested fix
Devbox should automatically include the dev output for library packages (or at least for packages commonly used as build dependencies), matching nix-shell / mkShell behavior.
At minimum, this behavior should be documented very clearly.
Steps to reproduce
-
Initialize devbox:
-
Add packages:
-
Create a test file:
echo '#include <yaml.h>
void main(){}' > main.c
-
Enter shell:
-
Compile:
Command
devbox.json
Without workaround
With workaround (devbox add libyaml.dev)
Devbox version
Nix version
What system does this bug occur on?
Linux (x86_64)
Debug logs
No response
What happened?
When using
nix-shell/nix develop, adding a library package implicitly makes its headers available via thedevoutput (through normalbuildInputssemantics).Devbox does not do this. As a result, headers are missing unless the user manually adds
<package>.dev.This breaks common C/C++ expectations and makes Devbox environments subtly incomplete compared to standard Nix shells.
Expected result
yaml.hshould be available automatically, as it is innix-shell/nix developwhen addinglibyaml.Actual result
Compilation fails because headers are missing:
Workaround
Manually add the
devoutput:After this, compilation succeeds.
Why this is a problem
nixpkgs, headers live in thedevoutput by design.nix-shellusers reasonably expect headers to be present when a library is added.outputs = [ "out" "dev" ].Suggested fix
Devbox should automatically include the
devoutput for library packages (or at least for packages commonly used as build dependencies), matchingnix-shell/mkShellbehavior.At minimum, this behavior should be documented very clearly.
Steps to reproduce
Initialize devbox:
Add packages:
Create a test file:
Enter shell:
Compile:
Command
devbox.json
Without workaround
{ "$schema": "https://raw.githubusercontent.com/jetify-com/devbox/0.16.0/.schema/devbox.schema.json", "packages": [ "libyaml@latest" ], "shell": { "init_hook": [ "echo 'Welcome to devbox!' > /dev/null" ], "scripts": { "test": [ "echo \"Error: no test specified\" && exit 1" ] } } }With workaround (
devbox add libyaml.dev){ "$schema": "https://raw.githubusercontent.com/jetify-com/devbox/0.16.0/.schema/devbox.schema.json", "packages": [ "libyaml@latest", "libyaml.dev" ], "shell": { "init_hook": [ "echo 'Welcome to devbox!' > /dev/null" ], "scripts": { "test": [ "echo \"Error: no test specified\" && exit 1" ] } } }Devbox version
Nix version
What system does this bug occur on?
Linux (x86_64)
Debug logs
No response