Devbox does not pull *-dev outputs into build environment (headers missing)
维护者通常 1 天内回复
还没有人认领这个 Issue。
评估
- 难度
- 4/5
- 预计耗时
- 3-5 天
- 新手友好度
- 55/100
- Issue 类型
- 缺陷
- 描述清晰度
- 基本清楚
- 活跃度
- 活跃
- 技术栈
- go
调研方向
The report identifies package handling in Devbox environments but names no source files or tests. Start by tracing how packages such as libyaml are turned into shell build inputs, then compare that behavior with the described nix-shell semantics. Done means the reproduction with devbox add libyaml gcc makes yaml.h available without manually adding libyaml.dev; add or run relevant tests if you locate them.
由索引模型根据 Issue 内容生成。
描述
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:
devbox add libyaml.dev
After this, compilation succeeds.
Why this is a problem
- In
nixpkgs, headers live in thedevoutput by design. nix-shellusers 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:
devbox init -
Add packages:
devbox add libyaml gcc -
Create a test file:
echo '#include <yaml.h> void main(){}' > main.c -
Enter shell:
devbox shell -
Compile:
gcc main.c
Command
devbox add libyaml
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
0.16.0
Nix version
nix (Nix) 2.31.2+2
What system does this bug occur on?
Linux (x86_64)
Debug logs
No response
- 主要语言
- Go
- 星标
- 12.4k
- 派生
- 358
- 平均合并
- 17 小时 12 分钟
- 30 天内合并 PR
- 31
环境准备
- 没有 Dockerfile 或 Docker Compose 文件
- 有 Pull Request 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
jetify-com/devbox 的其他 Issue
-
feature triage
难度 2/5 1-3 小时 新手友好度 62/100
jetify-com/devbox#3038 ·
维护者通常 1 天内回复
-
bug p4 package processed triage unrelated
难度 2/5 1-3 小时 新手友好度 66/100
jetify-com/devbox#2898 · 2 条评论 ·
维护者通常 1 天内回复
-
p4 processed unrelated
难度 2/5 1-3 小时 新手友好度 65/100
jetify-com/devbox#2750 · 1 条评论 ·
维护者通常 1 天内回复
-
Storyden未关闭p4 package processed triage unrelated
难度 2/5 1-3 小时 新手友好度 62/100
jetify-com/devbox#2685 · 1 条评论 ·
维护者通常 1 天内回复
-
looks easy p4 package processed triage
难度 2/5 1-3 小时 新手友好度 60/100
jetify-com/devbox#2656 · 1 条评论 ·
维护者通常 1 天内回复
查看 jetify-com/devbox 的全部 Issue
相似的 Issue
-
area: frontend priority: normal
难度 2/5 1-3 小时 新手友好度 78/100
维护者通常 1 天内回复
-
TestAutonomousStop_ReportsObservedState fails under host load: 1s wall-clock ceiling vs 250ms cycle未关闭type:bug
难度 2/5 1-3 小时 新手友好度 65/100
nightgauge/nightgauge#2909 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 62/100
jasonfen/terminal-space-program#842 ·
维护者通常 1 天内回复
-
enhancement good first issue
难度 2/5 1-3 小时 新手友好度 78/100
MustacheCase/zanadir#521 ·
维护者通常 1 天内回复
-
v3.1.0: spread placement groups fail — label key uses the reserved hetzner.cloud prefix可能已有人在做 @ScrimReaper 今天认领。 未关闭
难度 2/5 1-3 小时 新手友好度 86/100
stubbi/karpenter-provider-hetzner#120 ·
维护者通常 4 天内回复