about summary refs log tree commit diff
path: root/nixpkgs/pkgs/build-support/rust/import-cargo-lock.nix
diff options
context:
space:
mode:
authorAlyssa Ross <hi@alyssa.is>2022-03-30 13:30:47 +0000
committerAlyssa Ross <hi@alyssa.is>2022-03-31 10:13:20 +0000
commitf2e61678de300336b3666afd19af7565efb0c4cf (patch)
tree49f6906c9d557f7fdd58257ff85ec17fc4495f31 /nixpkgs/pkgs/build-support/rust/import-cargo-lock.nix
parentf920d5e07c29a9aa1b77d9b88bd604cf1a1f3664 (diff)
parent00e27c78d3d2de6964096ceee8d70e5b487365e3 (diff)
downloadnixlib-f2e61678de300336b3666afd19af7565efb0c4cf.tar
nixlib-f2e61678de300336b3666afd19af7565efb0c4cf.tar.gz
nixlib-f2e61678de300336b3666afd19af7565efb0c4cf.tar.bz2
nixlib-f2e61678de300336b3666afd19af7565efb0c4cf.tar.lz
nixlib-f2e61678de300336b3666afd19af7565efb0c4cf.tar.xz
nixlib-f2e61678de300336b3666afd19af7565efb0c4cf.tar.zst
nixlib-f2e61678de300336b3666afd19af7565efb0c4cf.zip
Merge commit '00e27c78d3d2de6964096ceee8d70e5b487365e3'
Conflicts:
	nixpkgs/nixos/modules/system/boot/systemd.nix
	nixpkgs/pkgs/applications/networking/browsers/firefox/common.nix
	nixpkgs/pkgs/applications/version-management/git-and-tools/cgit/common.nix
	nixpkgs/pkgs/applications/version-management/git-and-tools/cgit/default.nix
	nixpkgs/pkgs/applications/version-management/git-and-tools/cgit/pink.nix
	nixpkgs/pkgs/top-level/all-packages.nix
Diffstat (limited to 'nixpkgs/pkgs/build-support/rust/import-cargo-lock.nix')
-rw-r--r--nixpkgs/pkgs/build-support/rust/import-cargo-lock.nix7
1 files changed, 6 insertions, 1 deletions
diff --git a/nixpkgs/pkgs/build-support/rust/import-cargo-lock.nix b/nixpkgs/pkgs/build-support/rust/import-cargo-lock.nix
index fd3608741ea3..e571c01f95c5 100644
--- a/nixpkgs/pkgs/build-support/rust/import-cargo-lock.nix
+++ b/nixpkgs/pkgs/build-support/rust/import-cargo-lock.nix
@@ -128,8 +128,13 @@ let
 
         # If the target package is in a workspace, or if it's the top-level
         # crate, we should find the crate path using `cargo metadata`.
-        crateCargoTOML=$(${cargo}/bin/cargo metadata --format-version 1 --no-deps --manifest-path $tree/Cargo.toml | \
+        # Some packages do not have a Cargo.toml at the top-level,
+        # but only in nested directories.
+        # Only check the top-level Cargo.toml, if it actually exists
+        if [[ -f $tree/Cargo.toml ]]; then
+          crateCargoTOML=$(${cargo}/bin/cargo metadata --format-version 1 --no-deps --manifest-path $tree/Cargo.toml | \
           ${jq}/bin/jq -r '.packages[] | select(.name == "${pkg.name}") | .manifest_path')
+        fi
 
         # If the repository is not a workspace the package might be in a subdirectory.
         if [[ -z $crateCargoTOML ]]; then