-
-
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 0092] Computed derivations #92
Conversation
Also: - Allow fixed output builds (in that temp store) - Clean up drawbacks and alternatives.
Thanks @siddharthist! Co-Authored-By: Ericson2314 <[email protected]>
Thanks @Mic92 Co-Authored-By: Ericson2314 <[email protected]>
Thanks @globin Co-Authored-By: Ericson2314 <[email protected]>
Thanks @siddharthist! Co-Authored-By: Ericson2314 <[email protected]>
Break off some previously inline observations into their own subsection.
Thanks @Mic92! Co-Authored-By: Ericson2314 <[email protected]>
The later examples with `nix-instantiate` automatically get all the outputs of the final rewritten drv, so there's no output iteration needed. `"$o"` was mistakenly copied over from the earlier examples. Thanks to @ocharles for asking me the question that led me to this. Hopefully this change answers that?
Co-Authored-By: Domen Kožar <[email protected]>
about -> out
No `let`, so don't need `in`.
This was in the "wrapper" derivation example.
We already cache builds just fine, thanks! Thanks @globin for catching
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.
Left a couple of comments to make this more accessible.
rfcs/0000-plan-dynanism.md
Outdated
e ⇓ e' | ||
e' is derivation | ||
------ | ||
builtins.assumeDerivation e ⇓ e' | ||
``` |
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.
Could you add a section explaining this syntax? I assume it's familiar for PLT folks, but it's very cryptic to me :)
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.
Those are inference rules expressed in operational semantics.
You can read that as if e evaluates to e' and e' is a derivation, then builtins.assumeDerivation e evaluates to e'
.
I agree with asymmetric, we're not a PLT-focused symposium, prose is fine here.
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 a more accessible presentation would be better. This is pseudo-formal, because (AFAIK) the ⇓
and is derivation
judgements aren't actually defined anywhere.
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.
Agreed. Unfortunately not everyone has that background.
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.
A "translation" would suffice. Those compaxt bits of formalisms are great, once one has learned to parse them.
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.
Well.....I'll put it this way:
-
I think CA derivations' various notions of store coherence (by far the subtlest part), GUIX-style "grafting", mixing native- and cross-compiled packages, and probably other things I can't anticipate are going to repeatedly keep us thinking about these sorts of inductive relations. Some sort of sequent-ish syntax, or prolog's horn clause syntax, or many other such things are far and away the clearest and most concise way to convey this information once the reader is familiar --- it's supposed to be nice and "pictoral" not inscrutable ivory tower. I think it be best if we start moving in that direction.
-
Even if I right some prose now, It's going to a pain to update. VS with this sort of syntax it can be easier to just stare at and have all the important bits come out, so it's easier to revise.
So I am fine writing some sort of prose explanation, but I rather do it once the RFC is further along.
P.S. whether you love our hate this stuff, https://www.youtube.com/watch?v=dCuZkaaou0Q is a fun talk.
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.
You could include a link to a short introduction to natural deduction.
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.
Since this is gone we can remove this.
rfcs/0000-plan-dynanism.md
Outdated
| <single-installable> ! * | ||
``` | ||
|
||
Now that we have `path` vs `path!*`, we also don't need `---derivation` as a disambiguator, and so that should be removed along with all the complexity that goes with 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.
This should probably be clarified. I took me three readings to figure out that /nix/store/…foo.drv!*
is to build all outputs (which is the current default behavior unless --derivation
is specified, I assume?) and /nix/store/…foo.drv
would just build the derivation.
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.
Oh sheesh, yes I never said what the semantics were. Did that in addition to the examples @asymmetric asked for.
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.
Does it make sense now? (before I mark this 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.
The example clarifies things yeah! I am unsure though if the mention of --derivation
is detremental at this point since it is a nixUnstable
only thing and I could not find any documentation of the flag that even remotely explained to me what it does.
I guess we have a bit of a problem that this RFC somewhat overlaps with problems related to the Installables abstraction and the unstable CLI?
Yes indeed, so I've merged the RFC. Thanks all! |
This pull request has been mentioned on NixOS Discourse. There might be relevant details there: https://discourse.nixos.org/t/nixpkgss-current-development-workflow-is-not-sustainable/18741/73 |
This pull request has been mentioned on NixOS Discourse. There might be relevant details there: https://discourse.nixos.org/t/recent-nix-change-worthy-of-greater-attention/18972/1 |
We should post the pseudoshepherd meeting notes somewhere |
I know our RFC process has the concept of shepherd teams, but what's a "pseudoshepherd meeting"? |
@das-g We talked about this RFC at NixCon. |
Notes from NixCon opportunistic meeting in the courtyard: Summary
History
Summary of internals
next step brainstorm
there are simple advantages, but unclear if we can get the benefits for large projects makes the sizes of necessary locks much smaller, making previously unpalatable appoaches better Steps
dependencies
recursive-nix followup"can we limit recursive-nix to only build from dynamic-derivation and use only nix-instantiate?" question: dynamic derivation
|
Computed derivations could provide a means to access old packages in case of a major change to the language. I'm not suggesting we should change the language in backwards incompatible ways, but if we were to do it, this feature would let us preserve Nix's unique selling point of being able to use very old software alongside very up to date software. It will not generalize to any expression though; mostly just to derivations, so things like NixOS modules would still have to be ported, but this is much less effort than porting the entire toolchain and dependencies that produced the legacy package. (And you should probably review an old module anyway, if you even dare to run it as part of your OS) Interestingly, this could be one way in which we'd have a need for nested computed derivations: if the legacy package before the language change was itself a computed derivation, because it uses a derivation-supported build system. Though for now it's a bit hard to imagine such a fancy package to be old. More likely we'll first see a derivation-supported build system to rely on a computed derivation (to build the build system), though that seems to be a different kind of nesting, as such a build system is parented by Nixpkgs and could be injected into the final dynamic derivation by means of a store path, rather than having to do a double |
This pull request has been mentioned on NixOS Discourse. There might be relevant details there: https://discourse.nixos.org/t/nixcon-governance-workshop/32705/9 |
This pull request has been mentioned on NixOS Discourse. There might be relevant details there: |
* Initial draft "ret-cont" recursive Nix * Fix typos and finish trailing sentance * Switch to advocating temp store rather than daemon socket Also: - Allow fixed output builds (in that temp store) - Clean up drawbacks and alternatives. * ret-cont-recursive-nix: Fix typo Thanks @siddharthist! Co-Authored-By: Ericson2314 <[email protected]> * ret-cont-recursive-nix: Fix typo Thanks @Mic92 Co-Authored-By: Ericson2314 <[email protected]> * ret-cont-recursive-nix: Fix typo Thanks @globin Co-Authored-By: Ericson2314 <[email protected]> * ret-cont-recursive-nix: Fix typo Thanks @siddharthist! Co-Authored-By: Ericson2314 <[email protected]> * ret-cont-recursive-nix: Clean up motivation, adding examples * ret-cont-recursive-nix: Improve syntax highlighting * Do a lousy job formalizing the detailed design Break off some previously inline observations into their own subsection. * ret-cont-recursive-nix: Mention `builtins.exec` in alternatives * ret-cont-recursive-nix: Fix typo Thanks @Mic92! Co-Authored-By: Ericson2314 <[email protected]> * ret-cont-recursive-nix: Remove dangling "$o" The later examples with `nix-instantiate` automatically get all the outputs of the final rewritten drv, so there's no output iteration needed. `"$o"` was mistakenly copied over from the earlier examples. Thanks to @ocharles for asking me the question that led me to this. Hopefully this change answers that? * Update rfcs/0000-ret-cont-recursive-nix.md Co-Authored-By: Domen Kožar <[email protected]> * ret-cont-recursive: Fix typo about -> out * ret-cont: Add examples and expand future work * ret-cont: Fix syntax error No `let`, so don't need `in`. * ret-cont: Mention Ninja's upcomming `dyndep` and C++ oppertunity * ret-cont: Fix missing explicit `outputs` and `__recursive` This was in the "wrapper" derivation example. * ret-cont: "caching builds" -> "caching evaluation" We already cache builds just fine, thanks! Thanks @globin for catching * ret-cont: Improve formalism and reference NixOS#62 * drv-build-drv: Start drafting from old ret-cont-recursive-nix RFC * drv-buiild-drv: WIP rewrite * plan-dynamism: Rewrite RFC yet again * plan-dynamism: Rename file accordingly * plan-dynanism: Fix typo Thanks @mweinelt. * plan-dynanism: Fix formalism slightly * Apply suggestions from code review Thanks! Co-authored-by: Rosario Pulella <[email protected]> Co-authored-by: Ninjatrappeur <[email protected]> * plan-dynamism: `Buildables` -> `DerivedPathsWithHints` Thanks @sternenseemann for catching. * plan-dynamism: Add semantics and examples for `!` syntax * plan-dynamism: Too many dashes in `--derivation` * plan-dynanism: Put pupose of text hashing before name * Apply suggestions from code review Co-authored-by: Ollie Charles <[email protected]> * Apply suggestions from code review Co-authored-by: Ollie Charles <[email protected]> * Apply suggestions from code review * Update rfcs/0000-plan-dynanism.md * plan-dynanism: Fix bad sentence Thanks @roberth! * plan-dynamism: Number the two parts * plan-dynamism: Rip out part 2 There is more to do I'm sure, but I wanted to get the ball rolling. * plan-dynamism: New motivation * plan-dynamism: Fix typo Thanks @L-as * TEMP PLES AMEND * [RFC 0092] Rename file * [RFC 0092] Fix YAML header * [RFC 0092] Rewrite summary * [RFC 0092] Add link to documentation * [RFC 0092] Rewrite example section * [RFC 0092] Small fix * [RFC 0092] Rewrite drawbacks and alternatives * [RFC 0092] Improve alternatives section * [RFC 0092] Fix syntax error * [RFC 0092] Small change * [RFC 0092] Remove unnecessary file * [RFC 0092] Add comment about IFD * [RFC 0092] Fix typo * Update rfcs/0092-plan-dynamism.md Co-authored-by: Jörg Thalheim <[email protected]> * plan-dynamism-experiment: Make clear is experimental * plan-dynamism-experiment: Fix typo Thanks @L-as Co-authored-by: Langston Barrett <[email protected]> Co-authored-by: Jörg Thalheim <[email protected]> Co-authored-by: Robin Gloster <[email protected]> Co-authored-by: Domen Kožar <[email protected]> Co-authored-by: Rosario Pulella <[email protected]> Co-authored-by: Ninjatrappeur <[email protected]> Co-authored-by: Ollie Charles <[email protected]> Co-authored-by: Las Safin <[email protected]> Co-authored-by: Eelco Dolstra <[email protected]>
This pull request has been mentioned on NixOS Discourse. There might be relevant details there: https://discourse.nixos.org/t/state-of-haskell-nix-ecosystem-2024/53740/8 |
This is the spiritual successor of #40.
Rendered merged
Tracking issue