Skip to content
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

init maintainers/scripts/update-hackage #62105

Closed
wants to merge 1 commit into from
Closed

Conversation

teto
Copy link
Member

@teto teto commented May 27, 2019

There are 3 scripts to update the haskell infra at https://github.com/NixOS/cabal2nix
This moves the command to regenerate pkgs/development/haskell-modules/hackage-packages.nix
in nixpkgs to ease the process.
The user still needs to download the hackage repo and point the script at it.

As I was dealing with haskell problems, I tried to experiment things but having the scripts in cabal2nix are too integrated for quick experiments (automatically pull repos/commit things).
I am not sure how much of these scripts should go into nixpkgs but this single script allows to tweak
pkgs/development/haskell-modules/configuration-hackage2nix.yaml and regenerate pkgs/development/haskell-modules/hackage-packages.nix which is good enough as a start
@peti

Motivation for this change
Things done
  • Tested using sandboxing (nix.useSandbox on NixOS, or option sandbox in nix.conf on non-NixOS)
  • Built on platform(s)
    • NixOS
    • macOS
    • other Linux distributions
  • Tested via one or more NixOS test(s) if existing and applicable for the change (look inside nixos/tests)
  • Tested compilation of all pkgs that depend on this change using nix-shell -p nix-review --run "nix-review wip"
  • Tested execution of all binary files (usually in ./result/bin/)
  • Determined the impact on package closure size (by running nix path-info -S before and after)
  • Assured whether relevant documentation is up to date
  • Fits CONTRIBUTING.md.

Copy link
Member

@peti peti left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oftentimes, I make changes in the cabal2nix repository that affect hackage2nix and thus land immediately in the generated updates that my cron job pushes daily into the haskell-updates branch, because that cron job runs with a checked-out copy of the master branch of cabal2nix. And oftentimes, I do not release an update to Hackage because the changes I made are important for hackage2nix but not for cabal2nix. Therefore it's somewhat important that people who want to run hackage2nix themselves use the latest version from the git repo. If they are using the latest release of cabal2nix, then the outcome might be substantially different from the one that's found in Nixpkgs master already.

From perspective, adding this script to Nixpkgs feels like a bad idea.

@teto
Copy link
Member Author

teto commented May 28, 2019

How often do you make such changes to hackage2nix ?

I don't say this script should necessarily be used to update upstream nixpkgs but I find it helpful to experiment a bit on a local repo as it deals with some technicalities (for instance setting --hackage does not automatically adapt the path to preferred-version in hackage2nix).
As I see it, I could add a disclaimer "don't submit any changes to nxios/nixpkgs, use github.com/cabal2nix scripts instead " or I could make it so that it fetches github's cabal2nix instead ?

I spend more time trying to regenerate the hackage packages than I did for vim/lua while the haskell tooling is the more advanced. Just the cabal2nix scripts assume too much (about paths) for simple tinkering (and are mostly silent, I've added some echo statements in my fork so that it gets easier to understand what's going on).

@peti
Copy link
Member

peti commented May 28, 2019

How often do you make such changes to hackage2nix?

Regularly. Oftentimes, parts of Nixpkgs undergo changes and/or re-factoring that require adaptaion of hackage2nix to cope.

@nixos-discourse
Copy link

This pull request has been mentioned on NixOS Discourse. There might be relevant details there:

https://discourse.nixos.org/t/video-tutorial-how-to-fix-broken-haskell-packages-in-nix/3968/3

@lheckemann lheckemann added this to the 20.03 milestone Sep 10, 2019
@infinisil
Copy link
Member

I'd really like for this part of the nixpkgs infrastructure to be done with a known script that can reliably generate hackage-packages.nix. The script can be changed to use the master branch of cabal2nix so updates can be made quickly.

@disassembler disassembler modified the milestones: 20.03, 20.09 Feb 5, 2020
There are 3 scripts to update the haskell infra at https://github.com/NixOS/cabal2nix
This moves the command to regenerate pkgs/development/haskell-modules/hackage-packages.nix
in nixpkgs to ease the process.
The user still needs to download the hackage repo and point the script at it.
@teto
Copy link
Member Author

teto commented Mar 21, 2020

the script runs fine for me. It still requires cloning git@github.com:commercialhaskell/all-cabal-hashes.git but it makes the process smoother.

@nixos-discourse
Copy link

This pull request has been mentioned on NixOS Discourse. There might be relevant details there:

https://discourse.nixos.org/t/how-to-regenerate-hackage-packages-nix/6409/4

@rnhmjoj
Copy link
Contributor

rnhmjoj commented Mar 27, 2020

@teto would it make sense to clone the repo if ./all-cabal-hashes is not found?

@teto
Copy link
Member Author

teto commented Mar 27, 2020

I dont mind working on this PR but I feel it's already useful.
I could add a switch to use cabal2nix master instead (but maybe in another upgrade).
Once the UI stabilizes but I can draft some documentation.

@rnhmjoj I am going for minimal changes for now. I hope we can adapt the pipeline so that both @peti and other users can customize their nixpkgs.

@rnhmjoj
Copy link
Contributor

rnhmjoj commented Mar 28, 2020

I dont mind working on this PR but I feel it's already useful.

Yes, I think so too: I was just asking since I thought that was the reason for blocking the PR.

@teto
Copy link
Member Author

teto commented Sep 6, 2020

hoping that #86699 can succeed, I've kinda lost faith xD

@teto teto closed this Sep 6, 2020
@teto teto deleted the update-hackage branch May 23, 2021 13:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

8 participants