!djTaTBQyWEPRQxrPTb:nixos.org

Nixpkgs Architecture Team

230 Members
https://github.com/nixpkgs-architecture, weekly public meetings on Wednesday 15:00-16:00 UTC at https://meet.jit.si/nixpkgs-architecture53 Servers

Load older messages


SenderMessageTime
13 Jul 2022
@kevincox:matrix.orgkevincox 1 Benefits from lower fixed-cost overhead while 2 benefits from lower per-lookup overhead. 11:32:36
@gytis-ivaskevicius:matrix.orgGytis IvaskeviciusI feel dumb suggesting this but how does it sound to have a folder for each letter of alphabeth and place projects depending on the letter they start with 😄12:21:51
@gytis-ivaskevicius:matrix.orgGytis Ivaskeviciusthats a 'fix' for github 1000 files limit12:22:14
@infinisil:matrix.orginfinisil Gytis Ivaskevicius: This was discussed a bunch if you scroll up :) 12:22:33
@gytis-ivaskevicius:matrix.orgGytis Ivaskeviciusah great, at least im not the only one considering that 😄12:22:59
@infinisil:matrix.orginfinisil Another idea I played around with is to extend the notion of packages and their versions. One of the goals of it is to clean up handling of versions, aka getting rid of the python, python2, python27, ffmpeg, ffmpeg_full, etc. inconsistencies 12:33:51
@infinisil:matrix.orginfinisil Main idea is to allow each package name to be associated with arbitrarily many versions. The interface might look something like python (default), python.version "2", python.version "2.7", ffmpeg, ffmpeg.version "full" 12:35:24
@kevincox:matrix.orgkevincox
In reply to @infinisil:matrix.org
Another idea I played around with is to extend the notion of packages and their versions. One of the goals of it is to clean up handling of versions, aka getting rid of the python, python2, python27, ffmpeg, ffmpeg_full, etc. inconsistencies
Maybe I lack creativity but I think that would be a different project. For now they will just end up in python.nix, python2.nix... Those files could just be trivial import stubs.
12:35:34
@infinisil:matrix.orginfinisilWell it is another idea, but it plays into the above ideas, let me explain a bit more12:36:19
@infinisil:matrix.orginfinisilAs implied with the "full", this can go a bit further, versions don't need to be a single string, but it can be something more abstract. A version could be a combination of: Multiple forks of a project, multiple semantic versions, different variants and more12:38:01
@kevincox:matrix.orgkevincox
In reply to @kevincox:matrix.org
I think we need to provide user overrides. For example I use a custom libvte in my system and it is important to me that all packages pick that up.

Also for overrides I think we can probably handle this basically the same we do today in all-packages.nix for now. We can think about changing those as a different project. For now it could look something like:

# foo.nix
{pkgs}: pkgs.callPackage foo/impl.nix { python = pkgs.python27 }

That isn't the prettiest but allows us to do overrides and maintains the current API. Then I think we can probably clean it up as a separate effort if we wanted too. Unless I am also missing a way that merging both projects returns a better result here.

12:38:22
@kevincox:matrix.orgkevincox
In reply to @infinisil:matrix.org
As implied with the "full", this can go a bit further, versions don't need to be a single string, but it can be something more abstract. A version could be a combination of: Multiple forks of a project, multiple semantic versions, different variants and more
At this point how is this different from regular package arguments that can be overridden? Sounds like you can have python.override { version = "2.7" } if we anted to.
12:39:48
@kevincox:matrix.orgkevincox
In reply to @infinisil:matrix.org
As implied with the "full", this can go a bit further, versions don't need to be a single string, but it can be something more abstract. A version could be a combination of: Multiple forks of a project, multiple semantic versions, different variants and more
* At this point how is this different from regular package arguments that can be overridden? Sounds like you can have python.override { version = "2.7" } if we wanted to.
12:39:52
@infinisil:matrix.orginfinisil
In reply to @infinisil:matrix.org
As implied with the "full", this can go a bit further, versions don't need to be a single string, but it can be something more abstract. A version could be a combination of: Multiple forks of a project, multiple semantic versions, different variants and more
And if we go even further, this can solve the problem of multiple projects having the same name, or projects renaming themselves: If two projects have the same name, in this new model this can be modeled as two versions of the same package. So this means that when there's two projects with the same name, they would both be accessible under pkgs.someName, but you then have to explicitly choose a version (no default)
12:40:43
@infinisil:matrix.orginfinisil And when a project gets renamed, it can be represented under two names, pkgs.oldName and pkgs.newName, but underneath it can be the same thing, and share its name with other projects of the same name 12:41:29
@kevincox:matrix.orgkevincoxOne question that raises is what does hydra build? Right now hydra builds basically anything with a name. If you force a version argument then hydra won't build anything.12:41:56
@infinisil:matrix.orginfinisilThis then ties a bit more into the whole "automating attributes from the file structure"12:41:58
@infinisil:matrix.orginfinisil kevincox: That won't be a problem, what hydra builds can be changed, needs some new conventions for that 12:42:51
@infinisil:matrix.orginfinisil
In reply to @kevincox:matrix.org

Also for overrides I think we can probably handle this basically the same we do today in all-packages.nix for now. We can think about changing those as a different project. For now it could look something like:

# foo.nix
{pkgs}: pkgs.callPackage foo/impl.nix { python = pkgs.python27 }

That isn't the prettiest but allows us to do overrides and maintains the current API. Then I think we can probably clean it up as a separate effort if we wanted too. Unless I am also missing a way that merging both projects returns a better result here.

(I like that idea btw)
12:43:39
@profpatsch:augsburg.oneprofpatschI feel like many people here are rediscovering that an attrset and a function are synonymous things :P12:44:40
@infinisil:matrix.orginfinisilOh also, this whole versioning thing then also ties into distributing nixpkgs, because it could allow third-party repos to add to the supported versions in a composition-friendly way. It also ties into allowing users to select specific versions in a generic way12:45:06
@infinisil:matrix.orginfinisil profpatsch: Well, sometimes at least 12:46:15
@infinisil:matrix.orginfinisil
In reply to @kevincox:matrix.org
At this point how is this different from regular package arguments that can be overridden? Sounds like you can have python.override { version = "2.7" } if we wanted to.
The idea would be to make it super easy to make multiple versions work. Something package authors won't have to think about unless they need it. With .override it would be a very manual process
12:47:23
@infinisil:matrix.orginfinisilThis goes into the direction of fundamentally defining what a "package" really is. With this idea it would be something along the lines of "A derivation with a name and a version", where the version expresses notions of variants, backwards compatibility, is constrainable, etc.12:49:47
@infinisil:matrix.orginfinisilWhile this is a different problem to solve, we need to make sure we aren't solving one problem and then realizing it prevents us from solving another problem12:53:29
@infinisil:matrix.orginfinisilWith nixpkgs, so many things tie into each other it feels like12:53:57
@j-k:matrix.orgj-k
In reply to @profpatsch:augsburg.one
I feel like many people here are rediscovering that an attrset and a function are synonymous things :P
nix-repl> {}
{ }

nix-repl> {} // { hello = "world"; }
{ hello = "world"; }

nix-repl> (a: b: a + b)
«lambda @ (string):1:2»

nix-repl> (a: b: a + b) // { hello = "world"; }
error: value is a function while a set was expected

well they're a bit different

13:20:53
@whentze:matrix.orgWanja Hentzethey're different types on the surface, but in Nix in particular they're also fundamentally different, I think13:24:58
@whentze:matrix.orgWanja HentzeAFAICT, because attr names are evaluated eagerly, you can only have finitely many of them in a set13:25:27
@whentze:matrix.orgWanja Hentze so you can not build an attrset that is equivalent to a: a + "world" or something 13:26:08

Show newer messages


Back to Room ListRoom Version: 9