-
-
Notifications
You must be signed in to change notification settings - Fork 161
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 0040] "Ret-cont" recursive Nix #40
Conversation
Also: - Allow fixed output builds (in that temp store) - Clean up drawbacks and alternatives.
I don’t entirely understand the proposal. From experience, naïvely recursive systems are usually extremely constrained, so I can see that problem. You should split out the problem with the current proposal from “Motivation” into its own section and start with that. Can you frame the idea in terms of already existing systems? Scheme’s |
So in a nutshell instead of importing nix files from a derivation, this will import derivation files from a derivation? The idea sounds to me the equivalent to autotools/automake, where before a release the |
It would be good to add an example and/or some use cases where this approach would apply. For example, I can see it working in the case where you want to build a single derivation (e.g. building Hydra from the |
Thanks @siddharthist! Co-Authored-By: Ericson2314 <[email protected]>
Yeah, sometime I swear have to open the PR before I can see all the places I dropped in media res to no one's benefit. I'll rewrite things in the next draft to fix that.
There's a notion of applicative vs monadic build systems. The DRV langauge today is strictly applicative: data Drv a -- derivation which makes 'a'
type CCompiler = CCode -> Binary
iCanWriteThis :: Drv (CCode -> Binary) -> Drv CCode -> Drv (CCode -> Binary) This proposal makes it monadic by defining join: -- | switch to inner after building outer
join :: Drv (Drv a) -> Drv a Maybe I should make note of this in the RFC :). Fun fact, operationally, that |
@Mic92 Yes, you can imagine trying to run Nix to the point where there are no drv-producing drvs left, which is a lot like that process those autoconf projects do before release. |
Sure, I'll do that with the rephrase @Profpatsch was thinking of.
Indeed it would.
Well, with this + intentional store, you all would hopefully have no need for Bazel anymore :). But upstream projects will still use it and so it's still worth answering. With this RFC, there's no reason for Bazel to do any building. Instead, we can have a (A brief aside: A naive |
Thanks @Mic92 Co-Authored-By: Ericson2314 <[email protected]>
Thanks @globin Co-Authored-By: Ericson2314 <[email protected]>
Per meeting of the @NixOS/rfc-steering-committee this RFC is open for shepherding nominations. |
This pull request has been mentioned on Nix community. There might be relevant details there: |
I'd like to be considered for the shepherd team. |
Thanks @siddharthist! Co-Authored-By: Ericson2314 <[email protected]>
@volth Your |
71efda4
to
c6b6ef9
Compare
c6b6ef9
to
5564fdb
Compare
That's fine with me. Should we might more about this or ought we to have a prototype implementation / do we even need RFCs for experimental features or only when they become stable. I suspect the answer is "no", so a lack of meeting on #56 is actually holding me back more than a lack of meeting in this. |
5c9fa56
to
3fe1c3d
Compare
Nix finally has some competition with https://www.usenix.org/conference/atc19/presentation/fouladi . The deal with dynamism exactly as this RFC proposes. In their words "a thunk can write another thunk as its output"; just substitute "thunk" for "derivation", and you have this RFC. |
Thanks @volth |
@fpletz did you to create a new meeting for this one? |
@Mic92 While I am happy to talk about this again, I was just gong to implement it after I work on CA derivations. The basic idea for both is clear to me, but in doing the programming little intricacies arise that I would never need to anticipate. I suppose the main thing I'd like to discuss would be a new process RFC ---- getting PRs merged for Nix has been incredibly slow because it is unclear who can review and merge besides @edolstra, and Eelco is busy with many other things. We need a "chain of command" for Nix, deciding who is responsible for reviewing or merging what. |
@fpletz @edolstra @shlevy @copumpkin Considering there hasn't been any activity on this RFC for a while, maybe you should consider appointing a new shepherd leader for this RFC to get things going again |
In addition to what I said above about doing this after CA derivations, there are a few things I want to revise here and an intermediate feature/RFC we could do. Given all that, I am going to close this for now to be reopened when the time is ripe. |
I like that ret-cont avoids the problem with fixed-output derivations in recursive Nix (as implemented). See NixOS/nix#3205 (comment) |
I believe it is more like There's no Nixlang Functor for Ret-cont recursive Nix does not allow IFD. If it were implemented in the language, like RFC 92, it would look like The power spectrum works out the same way. By caller power we have *: I'm not including full recursive Nix, I should probably look into Comonad some more and all my steps are too hand-wavy. However, my comment ends here. |
@roberth I think |
That's how I read it and it makes total sense at the store level. 👍 Just reading back my comment makes me dizzy though, with three 'languages' to try to keep in my head: derivations, expressions and some sort of meta-language thing consisting of types that we never really defined unambiguously. Pseudo-types as in pseudo-code? Anyway, probably best to just focus on RFC 92. |
Yes, thinking about all 3 always got me dizzy too! |
"Ret-cont" recursive Nix is a restricted form of recursive Nix, where one builds a derivations instead of executing builds during the builds. This avoids some platform-specific contortions relating to nested sandboxing. More importantly, it prevents imperative and overly linear direct-style build scripts; easy to write but throwing away the benefits of Nix.
Rendered