leptos-rs / cargo-leptos

Build tool for Leptos (Rust)
MIT License
315 stars 88 forks source link

Unable to compile cargo-leptos on M1 pro chip using nix-shell #221

Closed gravityvi closed 4 months ago

gravityvi commented 6 months ago

Unable to compile cargo-leptos using nix shell on a macbook M1 pro:

Error:

note: ld: framework not found SystemConfiguration
       >           clang-11: error: linker command failed with exit code 1 (use -v to see invocation)
       >           
       >
       > error: could not compile `cargo-leptos` (bin "cargo-leptos") due to previous error
benwis commented 6 months ago

On macos you need to manually provide some of the darwin only packages, in a process similar to the one described by this reddit post. https://old.reddit.com/r/rust/comments/ptagz8/cargo_build_fails_ld_framework_not_found_security/

benwis commented 4 months ago

Closing, please reopen if you're still having this issue

erikkrieg commented 4 months ago

I'm also hitting this error (with cargo-leptos-0.2.2) M1 Mac w/ Nix:

ld: framework not found SystemConfiguration
clang-16: error: linker command failed with exit code 1 (use -v to see invocation)

I've tried adding the following to my flake without success so far:

buildInputs = [
  # for cargo-leptos
  darwin.apple_sdk.frameworks.Security
  darwin.apple_sdk.frameworks.SystemConfiguration
];

Still working on this and will follow up with another comment if I figure it out.

erikkrieg commented 4 months ago

Okay, I went and used the unstable package for cargo-leptos and that worked. This change included the fix I needed: https://github.com/NixOS/nixpkgs/commit/3d3a4f69bb9b43ffb820130cab7f17571d72f19d