我正在尝试为HyperLeDger Fabric项目构建NIX推导。
源根是源
with import <nixpkgs> {};
stdenv.mkDerivation {
name = "hyperledger-fabric";
src = builtins.fetchGit {
url = "https://github.com/hyperledger/fabric";
rev = "d0eaa0646fc83bf17066a82f54b3c99370914a02";
};
depsBuildBuild = [curl which git];
nativeBuildInputs = [go docker];
}
运行nix-build fabric.nix
时,我会收到:
nix-build fabric.nix
these derivations will be built:
/nix/store/8z0wlnf8897ng5wkfjja66m31fafsqyp-hyperledger-fabric.drv
building '/nix/store/8z0wlnf8897ng5wkfjja66m31fafsqyp-hyperledger-fabric.drv'...
unpacking sources
unpacking source archive /nix/store/q4mq48i1f7sp7d8f3n8w6q8kp053h9ny-source
source root is source
patching sources
configuring
no configure script, doing nothing
building
build flags: SHELL=/nix/store/n9hba031gjky8hpjgx9fnlaxhidyzxbz-bash-4.4-p23/bin/bash
gotools.mk:22: *** target pattern contains no '%'. Stop.
builder for '/nix/store/8z0wlnf8897ng5wkfjja66m31fafsqyp-hyperledger-fabric.drv' failed with exit code 2
error: build of '/nix/store/8z0wlnf8897ng5wkfjja66m31fafsqyp-hyperledger-fabric.drv' failed
错误指向https://github.com/hyperledger/fabric/blob/release-1.4/gotools.mk#l22
我需要设置环境变量还是导致问题的是什么?
通过使用buildGoPackage
解决,请参见https://github.com/nixos/nixpkgs/pull/52551