Skip to content

haskellPackages: Add buildFromCabalSdist (faster, tested)#174176

Merged
roberth merged 2 commits intoNixOS:masterfrom
hercules-ci:buildFromCabalSdist
Jun 28, 2022
Merged

haskellPackages: Add buildFromCabalSdist (faster, tested)#174176
roberth merged 2 commits intoNixOS:masterfrom
hercules-ci:buildFromCabalSdist

Conversation

@roberth
Copy link
Member

@roberth roberth commented May 23, 2022

Description of changes

A faster buildFromSdist, with tests. For use in out-of-tree projects. Triggered by #173800 (comment)

Things done
  • Built on platform(s)
    • x86_64-linux
    • aarch64-linux
    • x86_64-darwin
    • aarch64-darwin
  • For non-Linux: Is sandbox = true set in nix.conf? (See Nix manual)
  • Tested, as applicable:
  • Tested compilation of all packages that depend on this change using nix-shell -p nixpkgs-review --run "nixpkgs-review rev HEAD". Note: all changes have to be committed, also see nixpkgs-review usage
  • Tested basic functionality of all binary files (usually in ./result/bin/)
  • 22.05 Release Notes (or backporting 21.11 Release notes)
    • (Package updates) Added a release notes entry if the change is major or breaking
    • (Module updates) Added a release notes entry if the change is significant
    • (Module addition) Added a release notes entry if adding a new NixOS module
    • (Release notes changes) Ran nixos/doc/manual/md-to-db.sh to update generated release notes
  • Fits CONTRIBUTING.md.

@github-actions github-actions bot added the 6.topic: haskell General-purpose, statically typed, purely functional programming language label May 23, 2022
@roberth
Copy link
Member Author

roberth commented May 23, 2022

@ofborg build tests.haskell.cabalSdist

@maralorn
Copy link
Member

How common do we think would people encounter breakage if we just changed the existing buildFromSdist?
I am a bit careful with adding more functions with subtle differences to our lib.

Do you have a reason for adding those functions in another file then the original one?

@roberth
Copy link
Member Author

roberth commented May 24, 2022

Do you have a reason for adding those functions in another file then the original one?

It needs to access the package set for buildHaskellPackages.cabal-install, which is not something we can access in haskell.lib, unless there's some trickery I'm not aware of.

How common do we think would people encounter breakage if we just changed the existing buildFromSdist?

It seems that cabal sdist does not support custom ./Setup sdist behavior, so hypothetically, a package could have its own custom / customized sdist logic that the new function won't invoke. This seems unlikely though, as cabal-install command users would already be unable to use such custom logic.

@ofborg ofborg bot added 8.has: package (new) This PR adds a new package 10.rebuild-darwin: 1-10 This PR causes between 1 and 10 packages to rebuild on Darwin. 10.rebuild-linux: 1-10 This PR causes between 1 and 10 packages to rebuild on Linux. labels May 24, 2022
Copy link
Member

@maralorn maralorn left a comment

Choose a reason for hiding this comment

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

  1. I think the implementation is very good, thanks for the test!
  2. I realized that my fear of making our library more confusing is 100% a documentation problem and giving the users different options for (even mildly) different usecases is exactly right.

I am okay with merging this. Any objections @NixOS/haskell ?

@bobby285271 bobby285271 added the 12.approvals: 1 This PR was reviewed and approved by one person. label Jun 5, 2022
@roberth roberth merged commit d64780e into NixOS:master Jun 28, 2022
@github-actions
Copy link
Contributor

Successfully created backport PR #179427 for release-22.05.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

6.topic: haskell General-purpose, statically typed, purely functional programming language 8.has: package (new) This PR adds a new package 10.rebuild-darwin: 1-10 This PR causes between 1 and 10 packages to rebuild on Darwin. 10.rebuild-linux: 1-10 This PR causes between 1 and 10 packages to rebuild on Linux. 12.approvals: 1 This PR was reviewed and approved by one person.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants