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

[RFC 0017] Intensional Store #17

Draft
wants to merge 11 commits into
base: master
Choose a base branch
from
Draft

Conversation

wmertens
Copy link

@wmertens wmertens commented Aug 11, 2017

This RFC builds on the implementation of RFC #62 to maximize its benefits.

  • Decouple metadata (Trust DB) from the Store, keep per-user
  • Move the Store to /var/lib/nix for better compatibility with other platforms
  • Store can be shared read-write on a network share
  • nix-daemon becomes optional
  • Store paths provide dependencies without database

Rendered

rfcs/0017-intensional-store.md Outdated Show resolved Hide resolved
Copy link
Member

@zimbatm zimbatm left a comment

Choose a reason for hiding this comment

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

👍 overall

Terms used:
* derivation: a `nix-build` output product depending on some inputs and resulting in a file or directory under `/nix/store`
* dependent derivation: a derivation built using the currently considered derivation
* `$out`: name of the location where a derivation is built, e.g., `zyb6qaasr5yhh2r4484x01cy87xzddn7-unit-script-1.12`
Copy link
Member

Choose a reason for hiding this comment

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

it should be mentioned that it's an absolute path

rfcs/0017-intensional-store.md Outdated Show resolved Hide resolved
rfcs/0017-intensional-store.md Show resolved Hide resolved
rfcs/0017-intensional-store.md Outdated Show resolved Hide resolved
Copy link
Member

@Ericson2314 Ericson2314 left a comment

Choose a reason for hiding this comment

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

We've all wanted this for a long time! Your proposal does a good job of finding a minimal set of features to make this change less daunting.

rfcs/0017-intensional-store.md Outdated Show resolved Hide resolved
rfcs/0017-intensional-store.md Outdated Show resolved Hide resolved
@veprbl
Copy link
Member

veprbl commented Aug 31, 2017

I wonder if this can already be (partly) implemented as a wrapper applied in mkDerivation by using NixOS/nix#1502 to define __toString.

@edolstra edolstra changed the title Intensional Store [RFC 0017] Intensional Store Oct 31, 2017
@zimbatm
Copy link
Member

zimbatm commented Nov 5, 2017

Even if we only have a manual way of transforming a drv to CAS, it would already be useful and we don't have to make it work for corner-cases like when $out has references to $out.

@7c6f434c
Copy link
Member

7c6f434c commented Nov 5, 2017

I think $out has references to $out most of the time

@zimbatm
Copy link
Member

zimbatm commented Nov 5, 2017

It would allow to break unnecessary coupling, for example here:
https://github.com/moretea/yarn2nix/blob/ebde7ffe0f515900d591a9786d29898d5cea63bb/default.nix#L102-L104

A src is given which is written to the /nix/store. Then helpfully we deduce the package.json from that src. But because the src store path will change if any of the files have changed, the package.json reference will also necessarily change and create unnecessarily rebuild of the node_modules.

@wmertens
Copy link
Author

wmertens commented Nov 5, 2017 via email

@zimbatm
Copy link
Member

zimbatm commented Nov 5, 2017

Do you think that there is a way to implement a prototype that doesn't require a new nix builtin?

@wmertens
Copy link
Author

wmertens commented Nov 5, 2017 via email

self-references may not be discoverable by grep
@tomberek
Copy link
Contributor

I’d like to contribute to this, but not quite sure where to begin.

@Profpatsch
Copy link
Member

Profpatsch commented Nov 26, 2018

@tomberek iirc @edolstra has started adding intensional features to nix, not sure whether those conform to the ideas in this RFC.

@edolstra
Copy link
Member

@wmertens We're doing triage on the backlog of open RFCs. Are you still interested in pursuing this RFC?

BTW, I made a bit of progress towards content-addressable stores: edolstra/nix@a4d0a11. It doesn't support automatically moving derivation outputs to content-addressable locations yet, though.

@wmertens
Copy link
Author

wmertens commented Jan 17, 2019 via email

@edolstra
Copy link
Member

The next step is to get an RFC shepherd team. @globin I think you said you would open it for nominations?

@tomberek
Copy link
Contributor

I am interested in this.

@nixos-discourse

This comment has been minimized.

@Ekleog
Copy link
Member

Ekleog commented Jan 19, 2019

I'd like to nominate @vcunat and @fpletz for NixOS/nix#859 and https://github.com/orgs/NixIPFS/people

@shlevy
Copy link
Member

shlevy commented Jan 19, 2019

I'd like to nominate @edolstra and myself for the shepherd team

@vcunat
Copy link
Member

vcunat commented Jan 20, 2019

Yes, I'd like to review the design for (future) "intensional store", regardless of getting into the team.

@shlevy
Copy link
Member

shlevy commented Jan 20, 2019

Before reviewing the details, I do have one high level concern.

To quote from the README:

Furthermore, the fact that a given RFC has been accepted implies nothing about what priority is assigned to its implementation, nor does it imply anything about whether a Nix/nixpkgs developer has been assigned the task of implementing the feature. While it is not necessary that the author of the RFC also write the implementation, it is by far the most effective way to see an RFC through to completion: authors should not expect that other project developers will take on responsibility for implementing their accepted feature.

Assuming this does get accepted, do we have someone ready to implement it? Changes this deep to the store model involve a significant amount of work, I'm a bit worried about this RFC getting approved but no one implementing it for a long time, at which point many of the considerations that go into the current design may have changed drastically.

@7c6f434c
Copy link
Member

@shlevy I wonder if it would be a good idea to try making a survey of what parts are currently available (even before answering your question, maybe)

@domenkozar
Copy link
Member

I nominate @nbp

@layus layus mentioned this pull request May 19, 2023
7 tasks
@nyabinary
Copy link

What's the status of this RFC? What are the blockers, and what needs to be done to make this RFC happen?

infinisil added a commit that referenced this pull request Mar 5, 2024
* 166: Nix formatting

Create 0101-nix-formatting.md

WIP

Go through a large part and agree on it

Co-Authored-By: @piegamesde

Update 0101-nix-formatting.md

Rework a lot of things

Update 0101-nix-formatting.md

Move around some sections

Reword the detailed section

Minor updates

Slight header changes again

Updates

Update 0101-nix-formatting.md

Update after today's meeting

Update 0101-nix-formatting.md

Further updates in the meeting

Update 0101-nix-formatting.md

After todays meeting

Update after meeting

Rename to probably the right number

Only use anchor links

Improvements and additions

- The sub-expression rule is now reworded and its own section with
  examples and rationale
- Line length limit is now specified as we agreed-upon in the meeting
- The operator section is rewritten to align more with the consensus

Redo and explain operator special case

Also remove the special case for non-chainable operators, barely any benefit
in Nixpkgs

* Operator chains outside bindings can also have a compact form

* Make the operator compact form specific to binders

* Fix accidentally formatted semicolons in alternatives

* Minor changes

* Light copy editing

* Fix .git-blame-ignore-revs

* Improve assert/with wording

* Be more flexible with single-line element count

* binder -> binding

* unindent inherit semicolon, reshuffle binding/inherit sections (#14)

* unindent inherit semicolon, reshuffle binding/inherit sections

* fixup! Stuff

* Give alternatives to `in` formatting

* Expand on line break preservation

* Add editorconfig

* Expand argumentation against leading commas

* Add @dasJ to the formatter team

* Add shepherd team

Co-authored-by: Linus Heckemann <[email protected]>

* Various improvements (#15)

* Various improvements

- Remove unnecessary **Description** headers
- Rename **Rationale and Alternatives** to just **Alternatives**
- Insert must/may/should more diligently
- Add some TODOs where things are unclear
- Remove numberings from examples when not needed
- Minor clarity improvements and simplifications throughout

* Apply suggestions from code review

Co-authored-by: Ryan Hendrickson <[email protected]>

---------

Co-authored-by: Ryan Hendrickson <[email protected]>

* Address TODOs and rework with/assert

* Minor adjustments

* Mention formatting Nix code in documentation

* Working towards finalization (#16)

- Defined absorption and absorbable terms
- Adapted the existing RFC text to make use of these definitions,
  resulting in simplications of the text in many cases.
- Updated `with` section to match the implementation
- Updated the function declaration section to match the implementation
  - Sometimes, the function body may get absorbed
  - This used to be a special case scoped to bindings only, so it got removed there
- Updated the operators section to match the implementation
  - Specify the format of non-chainable operators (somehow those got lost in the past)
- Reworked bindings section. It should now be clear and specific enough.
- Minor wording fixes

* String section

* Specify assert conditions

* More absorption for multi-line arguments

* How to update the standard format

* Fix minor typos

* Less lines for common function call patterns

* Specify comments

* Specify that the formatter should be as pure as possible

With some exceptions

* nit: fix list concatenation example (#17)

* Update rfcs/0166-nix-formatting.md

Co-authored-by: Doron Behar <[email protected]>

* Add good indentation examples (#18)

* Add another chainable operators example

* justify difference in semicolon placement

* Allow different parenthesized argument style

* Clarify non-vertical alignment rule

* Improved clarity of bindings rule

* Improve bindings semicolon alternatives section

---------

Co-authored-by: Silvan Mosberger <[email protected]>
Co-authored-by: Silvan Mosberger <[email protected]>
Co-authored-by: Ryan Hendrickson <[email protected]>
Co-authored-by: Yuriy Taraday <[email protected]>
Co-authored-by: Linus Heckemann <[email protected]>
Co-authored-by: Janne Heß <[email protected]>
Co-authored-by: Doron Behar <[email protected]>
@brianmcgee
Copy link

I can understand that efforts have been diverted these last few months for various reasons. That being said, is there still an appetite to move this RFC forward, and what are the next steps?

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.