-
-
Notifications
You must be signed in to change notification settings - Fork 15.5k
Change idiom for overriding Dhall package version #102392
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
Merged
ehmry
merged 1 commit into
NixOS:master
from
Gabriella439:gabriel/dhall_makePackageOverridable
Nov 11, 2020
Merged
Change idiom for overriding Dhall package version #102392
ehmry
merged 1 commit into
NixOS:master
from
Gabriella439:gabriel/dhall_makePackageOverridable
Nov 11, 2020
+96
−144
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Before this change, a Dhall package like the Prelude would be encoded as a record with one field per supported version. Then downstream packages would specify which package to override by selecting a different record field. The problem with that approach is that it did not provide an easy way to override a package to a version other than the default ones supplied by Nixpkgs. Normally you would use the `.override` method for this purpose, but the `override` method added by `buildDhall{Directory,GitHub}Package` is clobbered by the `override` method added by `callPackage` in `./pkgs/top-level/dhall-packages.nix`. The solution is to add a separate `.overridePackage` method which is essentially the exact same as `.override`, except that it is no longer clobbered by `callPackage`. This `.overridePackage` method allows one to override the arguments supplied to `buildDhall{Directory,GitHub}Package`, making it easier to specify package versions outside of the ones supported by Nixpkgs.. This also includes a change to only build one (preferred) version of each package (instead of multiple supported versions per package), in order to minimize the maintenance burden for the Dhall package set.
ehmry
approved these changes
Nov 1, 2020
Gabriella439
added a commit
to dhall-lang/dhall-haskell
that referenced
this pull request
Nov 1, 2020
The following pull request explains why this change is necessary: NixOS/nixpkgs#102392
What's the next step for merging this? I don't have permission to merge |
@Profpatsch: Do you have the ability to merge this in? |
This change is a transparent refactor so I'm merging. |
Gabriella439
added a commit
to dhall-lang/dhall-haskell
that referenced
this pull request
Nov 12, 2020
The following pull request explains why this change is necessary: NixOS/nixpkgs#102392
Gabriella439
added a commit
to dhall-lang/dhall-lang
that referenced
this pull request
Nov 23, 2020
The motivation of this change is to pick up [newer Nixpkgs code](NixOS/nixpkgs#102392) necessary to support `store.dhall-lang.org`. See: https://discourse.dhall-lang.org/t/rfc-proxy-dhall-lang-org/144 This also consolidates all of our Nixpkgs references into a single reference to simplify future upgrades.
Gabriella439
added a commit
to dhall-lang/dhall-lang
that referenced
this pull request
Nov 24, 2020
The motivation of this change is to pick up [newer Nixpkgs code](NixOS/nixpkgs#102392) necessary to support `store.dhall-lang.org`. See: https://discourse.dhall-lang.org/t/rfc-proxy-dhall-lang-org/144 This also consolidates all of our Nixpkgs references into a single reference to simplify future upgrades.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
10.rebuild-darwin: 0
This PR does not cause any packages to rebuild on Darwin
10.rebuild-linux: 0
This PR does not cause any packages to rebuild on Linux
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Before this change, a Dhall package like the Prelude would be
encoded as a record with one field per supported version. Then
downstream packages would specify which package to override
by selecting a different record field.
The problem with that approach is that it did not provide an
easy way to override a package to a version other than the default
ones supplied by Nixpkgs. Normally you would use the
.override
method for this purpose, but the
override
method added bybuildDhall{Directory,GitHub}Package
is clobbered by theoverride
method added bycallPackage
in./pkgs/top-level/dhall-packages.nix
.The solution is to add a separate
.overridePackage
method which isessentially the exact same as
.override
, except that it is nolonger clobbered by
callPackage
. This.overridePackage
methodallows one to override the arguments supplied to
buildDhall{Directory,GitHub}Package
, making it easier to specifypackage versions outside of the ones supported by Nixpkgs..
This also includes a change to only build one (preferred) version of each
package (instead of multiple supported versions per package), in order to
minimize the maintenance burden for the Dhall package set.
I verified that all of the supported Dhall packages still build after this change.
sandbox
innix.conf
on non-NixOS linux)nix-shell -p nixpkgs-review --run "nixpkgs-review wip"
./result/bin/
)nix path-info -S
before and after)