mirror of
https://github.com/oven-sh/bun
synced 2026-02-11 11:29:02 +00:00
## Summary Fixes Clang 19 detection in the Nix flake environment by explicitly setting CMAKE compiler environment variables in the shellHook. ## Problem When using `nix develop` or `nix print-dev-env`, CMake was unable to detect the Clang 19 compiler because the `CMAKE_C_COMPILER` and `CMAKE_CXX_COMPILER` environment variables were not being set, even though the compiler was available in the environment. The `shell.nix` file correctly sets these variables (lines 80-87), but `flake.nix` was missing them. ## Solution Updated `flake.nix` shellHook to export the same compiler environment variables as `shell.nix`: - `CC`, `CXX`, `AR`, `RANLIB` - `CMAKE_C_COMPILER`, `CMAKE_CXX_COMPILER`, `CMAKE_AR`, `CMAKE_RANLIB` This ensures consistent compiler detection across both Nix entry points (`nix develop` with flakes and `nix-shell` with shell.nix). ## Testing Verified that all compiler variables are now properly set: ```bash nix develop --accept-flake-config --impure --command bash -c 'echo "CMAKE_C_COMPILER=$CMAKE_C_COMPILER"' # Output: CMAKE_C_COMPILER=/nix/store/.../clang-wrapper-19.1.7/bin/clang ``` Also tested with the profile workflow: ```bash nix develop --accept-flake-config --impure --profile ./dev-profile --command true eval "$(nix print-dev-env ./dev-profile --accept-flake-config --impure)" echo "CMAKE_C_COMPILER=$CMAKE_C_COMPILER" # Output: CMAKE_C_COMPILER=/nix/store/.../clang ``` 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-authored-by: Claude Bot <claude-bot@bun.sh> Co-authored-by: Claude <noreply@anthropic.com>
5.4 KiB
5.4 KiB