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

haskellPackages: Add buildFromCabalSdist (faster, tested) #174176

Merged
merged 2 commits into from
Jun 28, 2022

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.

@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.

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 reputable 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 8.has: package (new) This PR adds a new package 10.rebuild-darwin: 1-10 10.rebuild-linux: 1-10 12.approvals: 1 This PR was reviewed and approved by one reputable person
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants