Big Sur & frameworks issue

I upgraded from Catalina to Big Sur, and my rust code is not linking properly:

  = note: ld: framework not found Security
          clang-7: error: linker command failed with exit code 1 (use -v to see invocation)

I already have Security framework in buildInputs:

    buildInputs = [ rust ] ++ (
       stdenv.lib.optionals stdenv.isDarwin [
         frameworks.Security
         frameworks.CoreServices
         frameworks.CoreFoundation
         frameworks.Foundation
         frameworks.AppKit
       ]
    );

Also I am setting the NIX_LDFLAGS:

    shellHook = (
      if pkgs.stdenv.isDarwin then
        ''
            export NIX_LDFLAGS="-F${frameworks.AppKit}/Library/Frameworks -framework AppKit -F${frameworks.Security}/Library/Frameworks -framework Security -F${frameworks.CoreServices}/Library/Frameworks -framework CoreServices -F${frameworks.CoreFoundation}/Library/Frameworks -framework CoreFoundation $NIX_LDFLAGS";
        ''
      else
        ""
    )
      +
    ''
      export LD_LIBRARY_PATH=$(rustc --print sysroot)/lib:${stdenv.cc.cc.lib}/lib:$LD_LIBRARY_PATH:/System/Library/Frameworks/;
      export LIBCLANG_PATH="${llvmPackages.libclang}/lib"
      export ZDOTDIR=`pwd`;
      export HISTFILE=~/.zsh_history
      export CARGO_TARGET_DIR=`pwd`/target-nix
      echo "Using ${python38.name}, ${elmPackages.elm.name}, ${rust.name} and ${postgresql_12.name}."
      unset MACOSX_DEPLOYMENT_TARGET
    '';

Worked well on Catalina. Any pointers?

for big sur, you need to be following the unstable branch, the big sur changes haven’t been tested or backported yet.

1 Like

Can you confirm this is still the case?

I believe so, as there was many changes. IIRC, the backport PR was closed because of other changes were missing and hard to capture.

Any progress @jonringer ?
I’ve been following https://github.com/NixOS/nix/issues/4621. Is there any issue covering this?

Got similar issue, details here Dev environment setup failure with MacOS · Issue #37 · holochain/launcher · GitHub
Any updates?