WIP: Package selector predicates #58
No reviewers
Labels
No labels
Compat
Breaking
Kind/Bug
Kind/Documentation
Kind/Enhancement
Kind/Feature
Kind/Security
Kind/Testing
Priority
Critical
Priority
High
Priority
Low
Priority
Medium
Reviewed
Confirmed
Reviewed
Duplicate
Reviewed
Invalid
Reviewed
Won't Fix
Status
Abandoned
Status
Blocked
Status
Need More Info
No milestone
No project
No assignees
3 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference: auxolotl/labs#58
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "RossSmyth/labs:predicates"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
uhhhhhhhhhhhhhhhhhhhhhhhhh
Interesting idea! I think there may be some utility here for easily selecting a package + version, but I am not sure this current iteration is the right solution.
@ -16,1 +16,4 @@# Selects an individual dependency based upon the user's provided predicate selector## The runtime must provide a package set, then the name and selector are provided by the packageIt seems this isn't a package set, but a package alias that is required
Yeah I'm unsure of the names of each attribute. But the idea is that the module system supplies something like
packages.foundationas the default package set that the selectors then use.Ah, I see. The naming I have been using is:
config.packagesis the package setconfig.packages.<namespace>are namespaces in the package setconfig.packages.<namespace>.<name>are package aliases which contain all the different versions of that alias's package@ -17,0 +25,4 @@# Name# ↓# Pkgs -> String -> ( PackageVersions -> SelectedPkg ) -> SelectedPkgselect = pkgs: name: selector: selector pkgs.${name};How does this handle namespaces such as
packages.gnome.*?Since those do not exist yet, it does not.
We do have namespaces currently. For example
packages.foundation. We should make sure everything is compatible with this structure.@ -431,3 +431,3 @@dependencies =lettype = lib.types.withCheck lib.types.raw lib.types.package.children.final.check;type = lib.function (lib.types.withCheck lib.types.raw lib.types.package.children.final.check);I don't think we should require this to be a function. We need to be able to set values here, not just pick names from the current package set. Part of the original design is that we allow pulling packages from other sources that are outside the package set and assigning them as dependencies. We don't want to lose that. Plus the niceness around merging package config.
Ok
@ -61,3 +52,1 @@xz = packages.foundation.xz.versions."5.4.3-bootstrap";gcc = packages.foundation.gcc.versions."13.2.0-bootstrap";binutils = packages.foundation.binutils.versions."2.41-bootstrap";gnumake = p: p."4.4.1-bootstrap";I don't quite see how this is better, but perhaps I am not considering the right use case?
The idea to to basically decouple the package definition from the exact package set it depends on by default. The way tidepool is defined right now, I don't think it makes much difference besides just not having to repeat
packages.foundation.${package}.versionfor every dependency.But for example it would be good if at some point rather than essentially pinning each package to a specific version as is done now, they would like on something like
packages.tidepool.gzip.stable, or however it is pronounced, and then using these selector predicates would make it easier to swap out the exact underlying package set used since it would just be written asgzip = p: p.stable.Then ideally we could scope the package sets used for different package sets. So the foundation packages would have the underlying package set as
packages.foundation, and probably make each stage a separate set so that we don't need to manually update each package a bootstrap update occurs.Isn't this already supported via the concept of package aliases and their resolution? We have a switch for letting users pick stable vs latest and maintainers would simply use the alias itself so that it can resolve appropriately. The alternative of locking versions explicitly is a separate use case mostly meant for historic versions of packages or for allowing explicit overrides as needed.
I know this is marked WIP, but I stuffed it through hydra anyway .. it's not happy :( https://hydra.aux-cache.dev/jobset/aux-prs/labs-pr58#tabs-errors
Should
lib.functionbelib.types.function?Yeah. This is currently half-baked so I would not expect Hydra to be happy with it.
View command line instructions
Checkout
From your project repository, check out a new branch and test the changes.Merge
Merge the changes and update on Forgejo.Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.