Rust 尼克松:我的自定义包派生在“货物生成”上失败`
我正在编写一个要安装的包派生,它在Rust 尼克松:我的自定义包派生在“货物生成”上失败`,rust,rust-cargo,nix,nixos,Rust,Rust Cargo,Nix,Nixos,我正在编写一个要安装的包派生,它在cargo build阶段失败 kryptco/kr有一个子模块kryptco/sigchain,它是由rust编写的。 在kryptco/sigchain中,他们使用cargo-web-deploy命令构建其子模块。我的包派生在此货物web部署阶段失败 给出了这两个错误 错误:警告:将忽略非根包的替换,请在工作区根目录下指定替换: 包:/build/src/github.com/kryptco/kr/sigchain/sigchain_client/Cargo
cargo build
阶段失败
kryptco/kr
有一个子模块kryptco/sigchain
,它是由rust编写的。
在kryptco/sigchain
中,他们使用cargo-web-deploy
命令构建其子模块。我的包派生在此货物web部署
阶段失败
给出了这两个错误
错误:警告:将忽略非根包的替换,请在工作区根目录下指定替换:
包:/build/src/github.com/kryptco/kr/sigchain/sigchain_client/Cargo.toml
工作区:/build/src/github.com/kryptco/kr/sigchain/Cargo.toml
错误:无法获取`https://github.com/rust-lang/crates.io-index`
原因:
[6] 无法解析主机名;类别=净(12)
前一个错误是编辑Cargo.toml
并添加[replace]
部分,但如果可以,我希望避免编辑源代码
这些错误的原因是什么
这是我的软件包派生:
# Original: https://github.com/bogsen/nixos-public/blob/a0dc497eab5de528ce3006d\
36c52bc601422cf87/pkgs/krypton/default.nix
{ config, lib, pkgs, ... }: with lib; let
cfg = config.services.krypton;
cargoWeb = with pkgs; rustPlatform.buildRustPackage rec {
...
};
dependencies = with pkgs; [
cargo
emscripten
go
makeWrapper
perl
];
kr = pkgs.stdenv.mkDerivation {
name = "kr";
src = pkgs.fetchFromGitHub {
owner = "kryptco";
repo = "kr";
rev = "2.4.10";
sha256 = "1xxhlkcw2d52q1y4h40iyvq25804w7hzv0lflqnib68aps491xnj";
fetchSubmodules = true;
};
buildInputs = dependencies ++ [cargoWeb];
dontBuild = true;
postUnpack = ''
# prevent referring /homeless-shelter
export HOME=$(pwd)
# https://github.com/kryptco/kr/issues/254#issuecomment-464890476
sed -i.bak -e '8,11d' source/sigchain/Cargo.toml
export GOPATH=$(pwd)
export GOCACHE=$GOPATH/.cache/go-build
mkdir -p src/github.com/kryptco
mv source src/github.com/kryptco/kr
ln -s src/github.com/kryptco/kr source
'';
postPatch = ''
substituteInPlace Makefile --replace sudo ""
'';
makeFlags = [ "PREFIX=$(out)" ];
};
in {
config = {
nixpkgs.config.packageOverrides = pkgs: { kr = kr; };
};
}
整个错误信息都在这里
#使用rsync,这样文件修改时间只会在内容更改时更新
cd dashboard_yew&cargo web deploy--发布--目标=wasm32未知emscripten&&rsync--校验和--删除-r../target/deploy/*../target/deploy final
错误:警告:将忽略非根程序包的替换,请在工作区根位置指定替换:
包:/build/src/github.com/kryptco/kr/sigchain/sigchain_client/Cargo.toml
工作区:/build/src/github.com/kryptco/kr/sigchain/Cargo.toml
更新crates.io索引
警告:虚假网络错误(剩余2次尝试):[6]无法解析主机名;类别=净(12)
警告:虚假网络错误(剩余1次尝试):[6]无法解析主机名;类别=净(12)
错误:无法获取`https://github.com/rust-lang/crates.io-index`
原因:
[6] 无法解析主机名;类别=净(12)
make[1]:***[Makefile:25:libsigchain with dashboard]错误101
make[1]:离开目录“/build/src/github.com/kryptco/kr/sigchain”
make:**[Makefile:71:all]错误2
“/nix/store/78r0kh34ljzgfx658f9n99f8lxydjfxy-kr.drv”的生成器失败,退出代码为2
我认为您无法绕过配置文件的[replace]
编辑。在cargo web deploy
上构建失败是由于openssl sys的过时版本(已停止使用)。看起来他们编辑了Cargo.lock文件以依赖于此库的较新版本