From 887ac4d3d479b2c5c991ed718792bba7a38b4948 Mon Sep 17 00:00:00 2001 From: sterni Date: Thu, 16 Dec 2021 17:28:21 +0100 Subject: feat(nix/utils): handle toString-able sets produced by builtins.path When preparing cl/4381 I noticed that we actually handle this case properly. depot.nix.utils.storePathName depot.path now works as expected. Change-Id: Ice9329c67b2e2210852012f5abe82fbbb13193de Reviewed-on: https://cl.tvl.fyi/c/depot/+/4382 Tested-by: BuildkiteCI Reviewed-by: tazjin Autosubmit: sterni --- nix/utils/tests/default.nix | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'nix/utils/tests/default.nix') diff --git a/nix/utils/tests/default.nix b/nix/utils/tests/default.nix index 1ba68486077e..8a078684f3aa 100644 --- a/nix/utils/tests/default.nix +++ b/nix/utils/tests/default.nix @@ -85,6 +85,8 @@ let cheddarStorePath = builtins.unsafeDiscardStringContext depot.tools.cheddar.outPath; + cleanedSource = lib.cleanSource ./.; + storePathNameTests = it "correctly gets the basename of a store path" [ (assertEq "base name of a derivation" (storePathName depot.tools.cheddar) depot.tools.cheddar.name) @@ -94,6 +96,8 @@ let (storePathName "${cheddarStorePath}/bin/cheddar") "cheddar") (assertEq "base name of a path" (storePathName ../default.nix) "default.nix") + (assertEq "base name of a cleanSourced path" + (storePathName cleanedSource) cleanedSource.name) ]; in -- cgit 1.4.1