This is related to Repology. Basically all of the haskell packages use the name attribute for just their name. It would be nice to prefix it with something like "haskell-" to make it obvious that this is the "haskell" version of the package and not something else with the same name.
See: https://repology.org/metapackage/a50/related
/cc @peti
This should also be part of a discussion on standardization among the sub package sets.
We used to have haskell- prefixes but dropped them a long time ago because they serve no purpose inside of Nixpkgs.
Having something in the name would be nice when looking at store paths.
It鈥檚 interesting how many different ways package managers name them. Here are all packages for the containers module:
https://repology.org/metapackage/haskell:containers/versions
It doesn鈥檛 rreally matter which one we use just that there鈥檚 a way to differentiate between haskell and nonhaskell packages.
In case of Python we have a prefix that describes what interpreter it is for, both implementation and language version.
Shouldn't we be telling Repology attr paths, not names in derivations? Then we'd tell them haskellPackages.foo with no effort.
@dezgeg The attrpaths feel like some internal nixpkgs detail to me.
On the other hand, we are saying we want people to use nix-env -A all the time, so maybe not.
This file in the Repology source is good inspiration for how other package repositories handle this this kind of problem:
Repology disambiguates sub package sets by using a name: prefix, like haskell:a50.
If we added a rule like this, it would handle this for us on Repology:
- { setname: "haskell:$0", noflag: not_haskell, name-pat:"(.*)", wwwpart: hackage.haskell.org, family: [nix-unstable, nix-stable] }
I'll work on getting that rule in, but it seems like it would be worth changing the name of the package for more general usage.
Oh, sorry, that doesn't work because not all haskellPackages packages have a Hackage homepage. It looks like I can fix the rPackages though because they are all prefixed by r-.
Here is the fix for the rPackages https://github.com/repology/repology-rules/pull/30
That doesn't work because not all haskellPackages packages have a Hackage homepage.
It would be fine to change our package set so that Hackage package refer meta.homepage to Hackage rather than the URL given in the Cabal file. Those URLs are oftentimes flat out wrong. The Hackage URL, however, is definitely correct and it's also not going to disappear over time, so arguable it's more valuable for our users.
Generally speaking, I think this problem should be solved in the code that generates the package list, i.e. there should be some general-purpose mechanism that maps from a nested attribute path into a prefixed package name so that haskellPackages.foo can come out as haskell-${haskellPackages.foo.name}. The same mechanism can be useful for other cases, like Emacs packages, gnome packages, and whatnot.
@AMDmi3 has already said he's ok with our current format: https://github.com/repology/repology/issues/560
@globin, do I understand that repology ticket correctly when I interpret it as saying that they will extend their harvester so that it no longer classifies our R and Haskell packages as "meta packages"?
I wanted to do this, but I hoped that it would only be a temporary fix. If nix haskell packages are prefixed, it won't be needed.
@AMDmi3 I have a solution: we can update the nix.py parser to look for keys starting with haskellPackages and immediately prefix "haskell:" to the package name. I'm working on this currently
I guess this is fine to look at other things in repology. But shouldn鈥檛 haskell packages be prefixed regardless of how repology works? That鈥檚 at least consistent with how most other language packages work. In addition they鈥檒l be grouped together in the package search & avoid potential name collisions with non-Haskell packages.
I guess this is fine to look at other things in repology. But shouldn鈥檛 haskell packages be prefixed regardless of how repology works?
I completely agree. After 4a8797d8276aa1bd9c09d1f591eef1bd04adf2ec was commited, nix's "to be built" list became really confusing, so I reverted that commit. I'm really surprised nobody voiced the intention to do the same before now.
In case anyone cares I vote for ghc-${version}- prefix. You'd be surprised how helpful that is. Like you'd immediately notice that older ghcs are build just for a single jailbreak-cabal binary.
Another issue to consider is that some Haskell packages are already prefixed with haskell-. For example, https://hackage.haskell.org/package/haskell-abci . It seems nice that Repology uses : for separating the package namespaces because a : is less likely to appear in the name of a package.
@oxij, can you please share more detail about which particular jailbreak binary is build with an older version of ghc? I looked around the source code in master and I can find any such case.
Ah, nevermind. I found haskell.packages.ghc822.jailbreak-cabal. That override is necessary, unfortunately, because of issues with Cabal 1.22.x. I'll try whether I can find a less expensive solution.
@globin Can we reopen this because it does not seem like there is consensus on prefixing?
I fixed the prefixing issue relating to Repology by using the first part of the attrpath (if the attrpath has a . in it) as a package "category", and making a rule that prefixes haskell: to the name of any nix package with the category haskellPackages. For example, https://repology.org/metapackage/haskell:mtl/versions .
I think this issue should remain open because we haven't finished resolving the other potential issues regarding prefixing or not.
Just my 2 cents, if nix community decides to prefix haskell packages (I fully support this idea), please notify me beforehand so I could add corresponding rule and avoid package names bouncing back and forth in repology, polluting feeds.
@matthewbauer Why did you close this?
I've change my mine on this one. IMO the rule should be-
Haskell doesn't use recurseIntoAttrs so this seems fine.
Most helpful comment
Just my 2 cents, if nix community decides to prefix haskell packages (I fully support this idea), please notify me beforehand so I could add corresponding rule and avoid package names bouncing back and forth in repology, polluting feeds.