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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Slight refactors in preparation for #10480 #10494

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

Ericson2314
Copy link
Member

@Ericson2314 Ericson2314 commented Apr 13, 2024

Motivation

Code operating on store objects (including creating them) should, in general, use ContentAddressMethod rather than FileIngestionMethod.

Context

#10480

See also dfc8765 which included some similar refactors.

Priorities and Process

Add 馃憤 to pull requests you find important.

The Nix maintainer team uses a GitHub project board to schedule and track reviews.

Code operating on store objects (including creating them) should, in
general, use `ContentAddressMethod` rather than `FileIngestionMethod`.

See also dfc8765 which included some
similar refactors.
@@ -2395,7 +2394,9 @@ static void prim_path(EvalState & state, const PosIdx pos, Value * * args, Value
else if (n == "filter")
state.forceFunction(*(filterFun = attr.value), attr.pos, "while evaluating the `filter` parameter passed to builtins.path");
else if (n == "recursive")
method = FileIngestionMethod { state.forceBool(*attr.value, attr.pos, "while evaluating the `recursive` attribute passed to builtins.path") };
Copy link
Member Author

Choose a reason for hiding this comment

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

Casting a bool is bad for relying on internal representation details too much, so I made it more explicit.

Copy link
Member

@roberth roberth left a comment

Choose a reason for hiding this comment

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

I can't easily infer why this is an improvement, based on the documentation of the ContentAddressMethod and FileIngestionMethod types.

Specifically, it'd be good to describe how they relate, and perhaps add some guidance on which to pick, if we even need both.

@Ericson2314
Copy link
Member Author

Ericson2314 commented Apr 14, 2024

Hehe very fair. #10479 and a follow-up for store object content addressing are supposed to finally, thoroughly answer that question. OK leaving this open until they are done!

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