lib.fileset.toSource: Mention fromSource in errors

This commit is contained in:
Silvan Mosberger
2023-11-08 21:44:44 +01:00
parent 73493584a7
commit e07e80e841
4 changed files with 19 additions and 3 deletions

View File

@@ -170,7 +170,12 @@ rec {
else
value
else if ! isPath value then
if isStringLike value then
if value ? _isLibCleanSourceWith then
throw ''
${context} is a `lib.sources`-based value, but it should be a file set or a path instead.
To convert a `lib.sources`-based value to a file set you can use `lib.fileset.fromSource`.
Note that this only works for sources created from paths.''
else if isStringLike value then
throw ''
${context} ("${toString value}") is a string-like value, but it should be a file set or a path instead.
Paths represented as strings are not supported by `lib.fileset`, use `lib.sources` or derivations instead.''