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?