2022-08-13 02:48:53 +03:00
|
|
|
# Regression test for https://github.com/ipetkov/crane/issues/60
|
|
|
|
|
|
|
|
{ buildPackage
|
|
|
|
, lib
|
|
|
|
, linkFarmFromDrvs
|
|
|
|
, runCommand
|
|
|
|
, vendorGitDeps
|
|
|
|
}:
|
|
|
|
|
|
|
|
let
|
|
|
|
src = ./git-repo-with-many-crates;
|
|
|
|
lock = builtins.fromTOML (builtins.readFile "${src}/Cargo.lock");
|
|
|
|
|
|
|
|
# Ensure crate still builds
|
|
|
|
crate = buildPackage {
|
|
|
|
inherit src;
|
|
|
|
};
|
|
|
|
|
|
|
|
vendoredGit = vendorGitDeps {
|
|
|
|
lockPackages = lock.package;
|
|
|
|
};
|
|
|
|
|
|
|
|
checkSubset = runCommand "vendorGitSubsetAsExpected" { } ''
|
|
|
|
cat >expected <<EOF
|
2023-02-08 02:47:42 +03:00
|
|
|
tokio-1.20.4
|
2022-08-13 02:48:53 +03:00
|
|
|
tokio-macros-1.8.0
|
|
|
|
tokio-util-0.7.3
|
|
|
|
EOF
|
|
|
|
|
|
|
|
${builtins.concatStringsSep "\n" (builtins.map
|
|
|
|
(s: "ls -1 ${lib.escapeShellArg s} >>./actual")
|
|
|
|
(builtins.attrValues vendoredGit.sources)
|
|
|
|
)}
|
|
|
|
|
|
|
|
diff ./expected ./actual
|
|
|
|
touch $out
|
|
|
|
'';
|
|
|
|
in
|
|
|
|
linkFarmFromDrvs "vendorGitSubset" [
|
|
|
|
checkSubset
|
|
|
|
crate
|
|
|
|
]
|