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

Do not store the store dir in the store path #216

Merged
merged 4 commits into from
Oct 30, 2023

Conversation

Ericson2314
Copy link
Member

I disagree with myself in #62 (maybe I was confused on real vs virtual store dir, or maybe I was just being stupid!)

I agree with #148 too, which is an issue to undo it.

As a first step, I present this, which merely make StorePath not store the store dir, with any type-level stuff TBD. Yes, this is not ideal, but I think it's a good start. It is how C++ Nix and TVix do it these day. It is essentially never safe to mix up store paths with different store dirs, and so this is an improvement under the "make illegal states unrepresentative front".

Some of the daemon code got uglier, but I have a WIP big overhaul of that I'd hope to finish up at some point. That undoes the slight nuisance of these "get store dirs" that crop up everywhere with this PR.

@sorki
Copy link
Member

sorki commented Oct 30, 2023

Thank you! I've fixed one warning where expectedStore vs parsed results was ignored.

Feel free to dump the ideas into issues or even the WIP stuff to some branch so I can take a look. I have some ideas I would like to implement this year so we don't step over our work (I mostly want to refactor -remote to use typeclasses / tagless style, move/improve test harness so it can be used by hnix as well and possibly rework ad-hoc binary parsers a bit).

I've spent some time recently staring at a class hierarchy of libnixstore but I'm not much wiser yet as how to actually structure various store implementations here.. I guess typeclasses would get us quite far for now.

@sorki sorki merged commit 883bea6 into haskell-nix:master Oct 30, 2023
@Ericson2314 Ericson2314 deleted the store-path-like-nix branch October 30, 2023 18:00
@Ericson2314
Copy link
Member Author

Thanks @sorki. Do you still have a working matrix account btw?

@sorki
Copy link
Member

sorki commented Oct 31, 2023

Thanks @sorki. Do you still have a working matrix account btw?

Not yet, but I was looking at dendrite last week and it looks pretty good, so I'll deploy it when I hit infra mood. We used to run our own synapse for a local NGO but it was scraped for "cost saving reasons" in favor of Slack. The real reason was that it was too transparent as anyone could join while their Slack is private and invite only 🙃

@sorki sorki mentioned this pull request Nov 13, 2023
5 tasks
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.

3 participants