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 lib: move assertMsg and assertOneOf to their own library file 2018-09-06 18:14:27 +02:00
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 lib/debug: Update documentation comments for docs generation 2018-10-29 10:45:25 +01:00
default.nix Merge pull request #78337 from Profpatsch/lib-improve-cli-module 2020-01-24 21:05:53 +01:00
deprecated.nix treewide: remove redundant rec 2019-08-28 11:07:32 +00:00
fetchers.nix Convert libs to a fixed-point 2017-09-16 21:36:43 -04:00
filesystem.nix Convert libs to a fixed-point 2017-09-16 21:36:43 -04:00
fixed-points.nix lib.converge: optimise 2019-04-17 15:55:57 +01:00
generators.nix lib/generators: floats are not supported in mkValueStringDefault 2020-01-23 14:47:38 +01:00
kernel.nix treewide: remove redundant rec 2019-08-28 11:07:32 +00:00
licenses.nix Notion custom license: exclude 2020-01-17 08:31:22 -03:00
lists.nix Merge master into staging-next 2019-09-06 22:46:05 +02:00
meta.nix lib: implement setPrio 2018-11-22 08:59:48 +00:00
minver.nix Nix minimal version: 1.11 -> 2.0 2018-08-30 08:09:54 -04:00
modules.nix nixos/lib: Inherit type for doRename options 2020-01-20 22:06:20 +01:00
options.nix lib/options: fix path in comment 2019-08-26 02:01:49 +02:00
sources.nix cleanSourceWith: don't use baseNameOf 2020-03-23 09:53:07 +00:00
strings-with-deps.nix Convert libs to a fixed-point 2017-09-16 21:36:43 -04:00
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 lib/versions: expose splitVersion 2019-09-26 17:42:42 +02:00
zip-int-bits.nix lib/trivial: move zipIntBits to its own file 2018-07-26 20:36:45 +02:00