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.
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
[RFC 0134] Carve out a store-only Nix #134
[RFC 0134] Carve out a store-only Nix #134
Changes from 10 commits
02519f0
9d8a26c
fb641e8
3410991
9bce871
fbb0720
6f11ff9
c17e63b
8fd8c47
008243f
5aa53f1
b8df7cc
d8738d3
ec44f73
063f872
7b6cdbc
5bc6ea6
cae00b1
3194ad4
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"layering" does not really capture what this is about.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The layered architecture of Nix is not very prominent.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
how is this?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes. (Although I would prefer to phrase it as separation of concerns instead of layering, but that may be me having Heard- and read "layering" way too often.)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is that a term? I think in the Bazel/Buck world they are called dynamic dependencies.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
By derivation language, you mean the ATerm-based language that drv files are written in?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The abstract syntax of that. Basically "a derivation is an execve system call arguments (prog, args, env vars), input black box data, and input other drvs' outputs". I think that right there is a very natural design.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That terms needs a more formal introduction at some point, I think. I wrote about it in this blog post, if you care about a more detailed explanation.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't know what to make of this sentence. Is this what you mean? https://en.wiktionary.org/wiki/factor_through
Maybe we can just remove it?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So will the daemon protocol need to be standardized as part of this work? it seems to me that it wouldn't make sense to have a defined external executable without a defined way to talk to it (in the long run). The answer could be to link against
libnixstore
and use that to communicate with the (same version of) the store daemon. Is that so?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@andir We do have a defined deamon protocol, in that you could implement it yourself instead of using
libnixstore
and it is versioned. Yes, it is a not nice, but I don't think improving the situation should be a blocker on this PR.Rather, I think this PR will help make this sort of thing more noticeable, allowing us to build momentum / community interest about improving the daemon protocol. I think that's great!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, I don't mean this PR should implement it. It is just that the protocol might currently be defined but not documented or carries any guarantees. It has been subtly broken several times and (as you know) it isn't currently being tested across a broad set of nix versions.
I already implemted it (several times in fact) but the protocol isn't fun to reverse engineer from the current code base. My big hope is that with this RFC passing we could move to another RFC that defines a (new) interface that doesn't just allow exchanging implementations but embraces it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Might you be interested in documenting these fruits of your protocol-reverse-engineering labors?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Where do you get all of this info about go-nix (e.g. what they want to experiment with, and where)? I can't find it in the links you mention.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Taking on https://matrix.to/#/!YUnRYAzgytLSZbBhbx:hackint.org more information should be published soon after which I'll update the RFC to link it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
https://code.tvl.fyi/about/tvix/docs/components.md I'll update this once I can get permalink.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think this is a given. I seem to recall @edolstra stating that he does not want to guarantee interoperability between Nix versions[citation needed]. I think people disagreed on this and I'm not sure if they changed his mind, but it would be good to have a clear statement on this -- perhaps we could make it true as part of the RFC?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Perhaps but I would also just cut ", which we have" here too.
My point here was just to acknowledge that merely having a protocol so someone could rewrite the client end is "good enough". My main point is just that I don't want the server end with C++ to have to be an overkill binary that is capable of doing both.
I just brought up stability to try to steelman the other side: a protocol stable enough that it was practical to write an non-official client.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
TVL has taught me an excellent software engineering trick: if you want to ensure a clean separation between two parts of your codebase, write the two parts in two different languages whose communities see each other as competitors.
Absolutely brilliant; I tip my hat to these folks for figuring that out. :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
And still keep both in a monorepo, that is.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I heard that Guix started out using a store format which was compatible with Nix's
libstore
(presumably so they could use the Nix tools to bootstrap their development process) but that their store is no longer perfectly compatible.If this is true, does anybody know what motivated them to diverge? Or did they simply not adopt some forward-incompatible change that Nix made to its store format?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I find this sentence hard to understand, I think it tries to make too many points at once.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How's this?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we move the store-only parts of Nix into a separate drv output where non-dependency on the "full" output is enforced?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Right now it would just be a separate derivation, but it would be nice to try to build both where possible.
Separate outputs might play funny with NixOS but I think we can. We can also just build libraries and exes in separate derivations.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I see no reason to emphasize this.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should implementation of this be migrated to a model where no executable links
libstore
andlibexpr
at once, and the CLI executable invokes the store-only backend (possibly for multiple stores as in case ofnix copy
)?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think I lean against that, but regardless I would defer such questions until after this RFC and this first step. If we can be sure full Nix stays the same in the short run, that makes this a lot less risky — hardly any risk at all, I think.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think that's relevant.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nix-store
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think we need to decide on a new name. It could be just a build configuration of the already named components.
For an analogy, in Nixpkgs both
docker
anddocker-client
packages provide thedocker
command, both of which are produced by the same package function.On the other hand, renaming would be a nice gesture, if we drop
nix
from the names:libstore
,store add-file FILE
, etc.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've been liking:
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I agree with @roberth's idea of not needing a rename. For the purposes of somebody wanting to make sure they only depend on the store-only Nix, we can have
nix --version
indicate that it's a store-only Nix.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Moved to future work in 3194ad4. If everyone is good with that we can mark this thread resolved.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Have you reached out to Guix yet? When do you think it would be valuable to get their input?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have! But I think for this RFC the ball is purely in our court. This RFC is not about making technical decisions that would impact Guix, but about ratifying the idea of a store layer that is usable in arbitrary ways including the Nix language and Scheme via Guix.
I'll continue talking to them, and I encourage anyone else that wants to reach and say hi too — let's build more bridges between our communities — but if we don't do something like this I don't see why they should take us very seriously about store layer interop.