Repository navigation
Conversation
Bun lists all of /nix/store, 260k entries on tower, when it starts on a script there (oven-sh/bun#32389) or resolves an import from there, so every writeBunBin script took about 155 ms. Bundling at build time leaves no import to resolve, and reading the bundle from stdin leaves no script path: auto-brightness now runs in about 6 ms. The bundle step also fails the build on an unresolved import, which the --no-bundle check missed. Scripts can no longer read their own stdin. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Owner
Author
|
Closing in favour of #1354 (Node + zx), which was merged. Bun is dropped until oven-sh/bun#32389 is fixed. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Stacked on #1353, to compare against #1354 (Node + zx).
Bun lists all of
/nix/store(259,842 entries on tower) when it starts on a script stored there, oven-sh/bun#32389, or resolves an import from there. So everywriteBunBinscript took about 155 ms, whatever it does:straceshows 2,648getdents64calls on/nix/store/per run. The same script copied to/tmpruns in 14 ms.writeBunBinnow:bun build --target bunat build time, so no import is resolved at runtime. The open fix, resolver: resolve the entry point by stat instead of reading its directory oven-sh/bun#32392, only covers the script's own path, not imports.bun run - "$@" < bundle.js, so Bun has no script path to walk up from.Bun.argvkeeps its usual shape (["-", ...args]).Bundling alone (155 ms), a symlink outside the store (153 ms) and stdin without bundling (157 ms) all stay slow; only both together help.
hyperfine on tower, stub
noctalia, 50 runs:Trade-offs:
[stdin], not a file.Could not resolve: "not-installed-pkg"), which the--no-bundlecheck missed. A syntax error still fails it (error: Unexpected ;).Tested on tower: the table from #1353 under libfaketime, the real
noctaliawith the systemd unit'sPATH(ok), and an invalid value, which surfaces noctalia's error. Both host toplevels build;nix fmt --ciandnix flake check --all-systems --no-buildpass.🤖 Generated with Claude Code