fix(shell): make CC linker available for cargo #8

Merged
aviac merged 1 commit from fix/cargo-run into main 2025-12-14 13:07:48 +00:00

We need the CC linker for cargo run to work inside the devShell.

Without this change, you get the following error:

$ cargo build
   Compiling proc-macro2 v1.0.103
   Compiling quote v1.0.42
   Compiling unicode-ident v1.0.22
   Compiling libc v0.2.177
   Compiling cfg-if v1.0.4
   Compiling pin-project-lite v0.2.16
   Compiling log v0.4.28
   Compiling smallvec v1.15.1
   Compiling bytes v1.11.0
   Compiling futures-core v0.3.31
   Compiling shlex v1.3.0
   Compiling find-msvc-tools v0.1.5
   Compiling parking_lot_core v0.9.12
   Compiling pkg-config v0.3.32
   Compiling itoa v1.0.15
   Compiling scopeguard v1.2.0
error: linker `cc` not found
  |
  = note: No such file or directory (os error 2)

error: could not compile `parking_lot_core` (build script) due to 1 previous error
warning: build failed, waiting for other jobs to finish...
error: could not compile `quote` (build script) due to 1 previous error
error: could not compile `proc-macro2` (build script) due to 1 previous error
error: could not compile `libc` (build script) due to 1 previous error

Afterwards the build succeeds.

We need the CC linker for `cargo run` to work inside the devShell. Without this change, you get the following error: ``` $ cargo build Compiling proc-macro2 v1.0.103 Compiling quote v1.0.42 Compiling unicode-ident v1.0.22 Compiling libc v0.2.177 Compiling cfg-if v1.0.4 Compiling pin-project-lite v0.2.16 Compiling log v0.4.28 Compiling smallvec v1.15.1 Compiling bytes v1.11.0 Compiling futures-core v0.3.31 Compiling shlex v1.3.0 Compiling find-msvc-tools v0.1.5 Compiling parking_lot_core v0.9.12 Compiling pkg-config v0.3.32 Compiling itoa v1.0.15 Compiling scopeguard v1.2.0 error: linker `cc` not found | = note: No such file or directory (os error 2) error: could not compile `parking_lot_core` (build script) due to 1 previous error warning: build failed, waiting for other jobs to finish... error: could not compile `quote` (build script) due to 1 previous error error: could not compile `proc-macro2` (build script) due to 1 previous error error: could not compile `libc` (build script) due to 1 previous error ``` Afterwards the build succeeds.
we actually need CC inside the devShell so cargo run works
aviac merged commit 7686e09e15 into main 2025-12-14 13:07:48 +00:00
aviac deleted branch fix/cargo-run 2025-12-14 13:07:48 +00:00
aviac requested review from aviac 2025-12-14 13:07:51 +00:00
Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
solarpunk-kollektiv-dd/nix-rust!8
No description provided.