You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Every time we run racket2nix we get a self-contained nix expression, and the user can't do much with it, or rather to it.
#17 would make it output an attribute set instead, which is better, but still not good enough -- you can't override one package and have other packages depend on your override.
Solution: Support outputting an overlay.
I'm not even talking about just outputting a recursive function, and wrapping it in lib.makeExtensible. That's great, and we want that for the base catalog. No, I'm talking about the next layer of abstraction.
We can output a thin Nix expression and do zero lookup in package catalogs. No definition of mkRacketDerivation, no knowledge of where "rackunit-lib" or "pict-lib" is going to come from, just output a self: super: { "my-package" = self.mkRacketDerivation { pname = "my-package"; src = blah; racketBuildInputs = [ self."base" self."rackunit-lib" self."pict-lib" ]; }; } and that's the whole expression. You can do this from the info.rkt alone and rely on Someone Else to provide the greater package universe.
With #176 you could even have a {buildRacketOverlay}: buildRacketOverlay [ ./my-package ] be the whole Nix expression and not even bother with an info.rkt.
Benefits:
No catalog generation in fractals
Overridability everywhere
Quicker buildRacket
Allows us to not even generate a catalog.rktd, just need a nix expression full of self.mkRacketDerivation.
This supersedes #17 and #123.
This requires solving #24 and probably #158 (which in turn hopefully solves #78).
It'll be glorious. Biting into this in September. It may not even be much work, mostly the prerequisite issues have some unknowns.
The text was updated successfully, but these errors were encountered:
When generating the catalog, we will have to take care of circular dependencies. For people creating their own derivations, just tell them not do do circular.
clacke
added a commit
to clacke/racket2nix-clacke
that referenced
this issue
Sep 3, 2018
Solution: Use makeExtensible.
Closesfractalide#175
- Wrap all the dependencies in an attribute set.
- Export that attribute set as an attribute of the package.
- Wrap the attribute set in a function called with makeExtensible.
- Move our functions into a sub-attribute 'lib', minimize collision.
- Take the chance to rename attributes to names without a '_' prefix.
Example:
$ nix-build -A racket-packages.racket2nix
error: attribute 'racket2nix' in selection path 'racket-packages.racket2nix' not found
$ nix-build -A racket-packages.nix
/nix/store/l5dnla8gjg04v7v4q8pzkqaxqgp0l8cd-racket-minimal-7.0-nix
$ nix-build -E 'with import ./. {}; (racket-packages.extend (self: super: { racket2nix = self.nix.overrideRacketDerivation (oldAttrs: { pname = "racket2nix-stage1"; }); })).racket2nix'
/nix/store/zqlpq7iqcbia8wqiv03v9nlfdl637wvf-racket-minimal-7.0-racket2nix-stage1
Every time we run racket2nix we get a self-contained nix expression, and the user can't do much with it, or rather to it.
#17 would make it output an attribute set instead, which is better, but still not good enough -- you can't override one package and have other packages depend on your override.
Solution: Support outputting an overlay.
I'm not even talking about just outputting a recursive function, and wrapping it in
lib.makeExtensible
. That's great, and we want that for the base catalog. No, I'm talking about the next layer of abstraction.We can output a thin Nix expression and do zero lookup in package catalogs. No definition of mkRacketDerivation, no knowledge of where
"rackunit-lib"
or"pict-lib"
is going to come from, just output aself: super: { "my-package" = self.mkRacketDerivation { pname = "my-package"; src = blah; racketBuildInputs = [ self."base" self."rackunit-lib" self."pict-lib" ]; }; }
and that's the whole expression. You can do this from theinfo.rkt
alone and rely on Someone Else to provide the greater package universe.With #176 you could even have a
{buildRacketOverlay}: buildRacketOverlay [ ./my-package ]
be the whole Nix expression and not even bother with aninfo.rkt
.Benefits:
self.mkRacketDerivation
.This supersedes #17 and #123.
This requires solving #24 and probably #158 (which in turn hopefully solves #78).
It'll be glorious. Biting into this in September. It may not even be much work, mostly the prerequisite issues have some unknowns.
The text was updated successfully, but these errors were encountered: