Skip to content

fix(nix): restore worker-build and lld in the devshell - #39

Open
Farhan (farhankhalaf) wants to merge 1 commit into
mainfrom
fix/devshell-rust-worker-tools
Open

Farhan (farhankhalaf) wants to merge 1 commit into
mainfrom
fix/devshell-rust-worker-tools

Conversation

@farhankhalaf

Copy link
Copy Markdown

Summary

Restores pkgs.worker-build and pkgs.lld in the devshell. #38 added them for crates/cloudflare-worker-example; #37 merged 92 seconds later, rewrote the package list and dropped both. The crate README and AGENTS.md still say the devshell provides them.

 nix/flake/devShells/default.nix
+  hasRustWorker = builtins.pathExists ../../../crates/cloudflare-worker-example;
 ...
         ++ lib.optionals hasRust [pkgs.cargo pkgs.rustc pkgs.rustfmt pkgs.clippy pkgs.rust-analyzer]
+        ++ lib.optionals hasRustWorker [pkgs.lld pkgs.worker-build]

Gated on the worker crate rather than on hasRust, so a template slice without the crate does not pull the wasm tooling. The nix-rust-lib slice copies all of crates/, so it keeps the tools.

Evidence

  • Devshell inputs on aarch64-darwin (nix eval .#devShells.aarch64-darwin.default.nativeBuildInputs):
    • main 5514f44: git treefmt bun nodejs cargo rustc rustfmt clippy rust-analyzer prelude age jq kubectl kustomize sops yq-go (no worker-build, no lld)
    • this branch: same list plus lld worker-build
  • Without lld, a wasm32 build with nixpkgs rustc fails with error: linker `lld` not found.
  • With the template's locked nixpkgs (f13ff45, worker-build 0.8.5): worker-build --release in crates/cloudflare-worker-example succeeds (build/index.js + index_bg.wasm).
  • alejandra --check nix/flake/devShells/default.nix: passes.

Not run: a full nix develop of this repo on darwin. The prelude derivation build hung locally on both main and this branch, which is unrelated to this change.

Merge Danger

Door: two-way

Revert removes two packages from the devshell again.

Blast Radius: devshell

Adds lld and worker-build to nix develop when the worker crate exists. CI is unaffected apart from nix flake check evaluating the shell.

🤖 Generated with Claude Code

https://claude.ai/code/session_01RdyTmsnUzihkE8KMmq9qHo

PR #38 added pkgs.worker-build and pkgs.lld so `alchemy deploy` and
`alchemy dev` of packages/infra can build crates/cloudflare-worker-example.
PR #37 merged 92 seconds later and rewrote the package list, dropping both.
On main the devshell has no worker-build, so the RustCloudflareWorkerBuild
step fails on a fresh checkout, and nixpkgs rustc cannot link wasm32
without lld.

Add both back, gated on the worker crate being present so library
template slices without it stay lean.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01RdyTmsnUzihkE8KMmq9qHo
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 27, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-27T04:43:13.660907Z 73b6049 Manual request
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@farhankhalaf

Copy link
Copy Markdown
Author

Codex (@codex) review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Nice work!

Reviewed commit: 73b604930c

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "Codex (@codex) review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "Codex (@codex) address that feedback".

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant