Conversation
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.
This was referenced Oct 13, 2023
0effb5d to
c8c8e56
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This improves on #158 by making the default module location automatic.
When
moduleLocationis specified, it behaves as in #158.If not, the default module location is determined from the
inputsattribute position, with fallback.I believe
moduleLocationis sufficient for the use cases in the flake-parts modules that were changed.I am currently not aware of a case where
errorLocationwould have to be exposed to the modules, so I'd like to keep the interface minimal until we find that.