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

moduleLocation, but also automatic #192

Merged
merged 5 commits into from
Oct 29, 2023
Merged

moduleLocation, but also automatic #192

merged 5 commits into from
Oct 29, 2023

Conversation

roberth
Copy link
Member

@roberth roberth commented Oct 13, 2023

This improves on #158 by making the default module location automatic.

When moduleLocation is specified, it behaves as in #158.
If not, the default module location is determined from the inputs attribute position, with fallback.

I believe moduleLocation is sufficient for the use cases in the flake-parts modules that were changed.
I am currently not aware of a case where errorLocation would have to be exposed to the modules, so I'd like to keep the interface minimal until we find that.

Atry and others added 5 commits May 9, 2023 09:53
This would not be advisable for anything other than error messages,
because Nix does not commit to any semantics for that function.
The difference is that moduleLocation is "guaranteed" reliable data,
whereas errorLocation is the best choice for error messages in the core.

moduleLocation is suitable for the module key attribute.
errorLocation is best for the *ROOT* module _file attribute.

Initially I applied errorLocation in too many places. It is only needed
when the flake output attribute names are strict in it.
To avoid confusion, I'm not exposing errorLocation to the modules, until
we have a concrete use case for it.
As mentioned in the previous commit, we don't have a use case for
this in flake-parts yet, as far as I'm aware. It can be exposed
when we do have a concrete use case where it is needed.
Copy link
Contributor

@Atry Atry left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants