[英]How do I override the libc in a Nix package to be musl?
I'm using Nix as a dependency manager for a Rust program. 我正在使用Nix作为Rust程序的依赖管理器。 I have the following default.nix (simplified, but working):
我有以下default.nix(简化,但工作):
rec {
pkgs = import <nixpkgs> {};
hello = pkgs.stdenv.mkDerivation rec {
name = "rust-hello";
buildInputs = [
pkgs.rustc
];
src = ./source;
buildPhase = "rustc main.rs -o rust-hello";
installPhase = ''
mkdir -p $out/bin
install -s rust-hello $out/bin
'';
};
}
I'm trying to override the libc for all dependencies (including the Rust compiler) to be pkg.musl, but I fail to do so. 我试图覆盖所有依赖项(包括Rust编译器)的libc为pkg.musl,但我没有这样做。 How can this be achieved?
怎么能实现这一目标?
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.