Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

lib/types: Fix path type check #77133

Merged
merged 1 commit into from
Jan 7, 2020
Merged

Conversation

infinisil
Copy link
Member

@infinisil infinisil commented Jan 6, 2020

Motivation for this change

Previously when this function was called without a value coercible to a
string it would throw an error instead of returning false. Now it does.

As a result this now allows the use of a type like either path attrs
without it erroring out when a definition is an attribute set.

The warning about there not being a isPath primop was removed because
this is not the case anymore, there is builtins.isPath. But also there
always was builtins.typeOf x == "path" that could've been used
instead. However the path type now stands for more than just path types,
but absolute paths in general.

Fixes #76977, relevant for #76861

Ping @roberth

Things done
  • Tested that it doesn't throw an error anymore with attribute sets

@infinisil infinisil requested review from edolstra and nbp as code owners January 6, 2020 21:09
Previously when this function was called without a value coercible to a
string it would throw an error instead of returning false. Now it does.

As a result this now allows the use of a type like `either path attrs`
without it erroring out when a definition is an attribute set.

The warning about there not being a isPath primop was removed because
this is not the case anymore, there is builtins.isPath. But also there
always was `builtins.typeOf x == "path"` that could've been used
instead. However the path type now stands for more than just path types,
but absolute paths in general.
@ofborg ofborg bot added 10.rebuild-darwin: 0 This PR does not cause any packages to rebuild on Darwin 10.rebuild-linux: 0 This PR does not cause any packages to rebuild on Linux labels Jan 7, 2020
@infinisil infinisil merged commit 65872f4 into NixOS:master Jan 7, 2020
@infinisil infinisil deleted the fix-path-check branch January 7, 2020 15:43
@infinisil
Copy link
Member Author

Backported in 86bbfc0

@infinisil infinisil added the 6.topic: module system About "NixOS" module system internals label Mar 19, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
6.topic: module system About "NixOS" module system internals 10.rebuild-darwin: 0 This PR does not cause any packages to rebuild on Darwin 10.rebuild-linux: 0 This PR does not cause any packages to rebuild on Linux
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Reimplement lib.types.path.check
2 participants