相关疑难解决方法(0)

如何在Nix环境中使macOS框架可用于clang?

我在macOS 10.13.5上,正在学习对Rust进行编程,并且使用Nix来控制我的开发环境。

某些操作(例如包括jsonwebtoken库或安装 cargo-watch模块)会导致构建需要一个似乎未安装的macOS框架。我收到此错误消息:

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

error: aborting due to previous error

error: failed to compile `cargo-watch v6.0.0`, intermediate artifacts can be found at `/var/folders/13/84dj8yr54_1c_pn0s8n7444h0000gn/T/cargo-install.lYPZaEduUBdu`

Caused by:
  Could not compile `cargo-watch`.
Run Code Online (Sandbox Code Playgroud)

这是失败的clang命令的缩写版本:

error: linking with `/nix/store/9j864incgjx7kqggbpisdi3nmssy4qm5-clang-wrapper-5.0.2/bin/cc` failed: exit code: 1
  |
  = note: "/nix/store/9j864incgjx7kqggbpisdi3nmssy4qm5-clang-wrapper-5.0.2/bin/cc" "-m64" "-L" ... "/nix/store/rfp87664xzhl6zv7dx5c1hixasqfxkp4-rustc-1.24.0/lib/rustlib/x86_64-apple-darwin/lib/libcompiler_builtins-ba331b20e371c580.rlib" "-framework" "CoreServices" "-framework" "CoreServices" "-l" "System" "-l" "resolv" "-l" "pthread" …
Run Code Online (Sandbox Code Playgroud)

macos rust rust-cargo nix

5
推荐指数
1
解决办法
670
查看次数

标签 统计

macos ×1

nix ×1

rust ×1

rust-cargo ×1