nixpkgs/lib
Michael Peyton Jones 07f363fae3
cleanSourceWith: don't use baseNameOf
Currently, not providing `name` to `cleanSourceWith` will use the name
of the imported directory. However, a common case is for this to be the
top level of some repository. In that case, the name will be the name of
the checkout on the current machine, which is not necessarily
reproducible across different settings, and can lead to e.g. cache
misses in CI.

This is documented in the comment on `cleanSourceWith`, but this does
not stop it being a subtle trap for users.

There are different tradeoffs in each case:

1. If `cleanSourceWith` defaults to `"source"`, then we may end up with a
user not knowing what directory a source store path corresponds to.
However, it being called "unnamed" may give them a clue that there is a
way for them to name it, and lead them to the definition of the
function, which has a clear `name` parameter.

2. If `cleanSoureWith` defaults to the directory name, then a user may face
occasional loss of caching, which is hard to notice, and hard to track
down. Tracking it down likely requires use of more advanced tools like
`nix-diff`, and reading the source of a lot of nix code.

I think the downside of the status quo is worse.

This is really another iteration of
https://github.com/NixOS/nix/issues/1305: that led to adding the `name`
argument in the first place, this just makes us use a better default
`name`.
2020-03-23 09:53:07 +00:00
..
systems stdenv: Remove isArm (use isAarch32 instead) 2020-02-05 10:56:14 -08:00
tests lib/cli,lib/tests/misc: somewhat more standard formatting 2020-01-23 14:47:38 +01:00
asserts.nix
attrsets.nix lib/attrsets: Fix error in comment for getAttrFromPath 2020-01-20 22:42:38 +01:00
cli.nix lib/cli: mkKey -> mkOptionName, use generators.mkValueStringDefault 2020-01-23 14:47:38 +01:00
customisation.nix Merge pull request #67809 from Infinisil/propagate-override-args 2019-10-22 14:37:40 +02:00
debug.nix
default.nix Merge pull request #78337 from Profpatsch/lib-improve-cli-module 2020-01-24 21:05:53 +01:00
deprecated.nix
fetchers.nix
filesystem.nix
fixed-points.nix
generators.nix lib/generators: floats are not supported in mkValueStringDefault 2020-01-23 14:47:38 +01:00
kernel.nix
licenses.nix Notion custom license: exclude 2020-01-17 08:31:22 -03:00
lists.nix
meta.nix
minver.nix
modules.nix nixos/lib: Inherit type for doRename options 2020-01-20 22:06:20 +01:00
options.nix
sources.nix cleanSourceWith: don't use baseNameOf 2020-03-23 09:53:07 +00:00
strings-with-deps.nix
strings.nix Revert "Revert "Merge master into staging-next"" 2020-02-05 19:41:25 +01:00
trivial.nix nixos/version: fix case where .git is a symlink 2020-01-20 00:53:44 +01:00
types.nix Replace short URL from #63103 with full URL. 2020-01-15 13:47:49 +00:00
versions.nix
zip-int-bits.nix