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

haskell: Speed up cross callHackage by using native source #70192

Merged
merged 1 commit into from Oct 2, 2019

Conversation

Ericson2314
Copy link
Member

@Ericson2314 Ericson2314 commented Oct 1, 2019

Motivation for this change

The extract of code from hackage is the same on all platforms.

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)
  • Ensured that relevant documentation is up to date
  • Fits CONTRIBUTING.md.
Notify maintainers

cc @

The extract of code from hackage is the same on all platforms.
@Ericson2314 Ericson2314 changed the title haskell: Fix more cross voilations haskell: Speed up cross callHackage by using native source Oct 1, 2019
@cdepillabout
Copy link
Member

@Ericson2314 Thanks for upstreaming this type of stuff!

I tried testing this locally and it appears to work:

$ nix-build -E 'with (import ./. {}); haskellPackages.hackage2nix "lens" "4.17.1"'
...
/nix/store/0kvij1wikr9lklz7ac3rh6wqh6sb6s5b-cabal2nix-lens-4.17.1
$ cat /nix/store/0kvij1wikr9lklz7ac3rh6wqh6sb6s5b-cabal2nix-lens-4.17.1/default.nix
...

The generated default.nix file looks good to me.


However, I'm not very familiar with the cross compilation support in nixpkgs (which I think is the difference between buildPackages and pkgs in this file??). I didn't actually try this with any sort of cross compilation target, so I guess I haven't really tested it. Although it makes sense that it should work, since the cabal2nix we get from buildPackages should work the same as the cabal2nix we get from pkgs?

cc @peti

@cdepillabout
Copy link
Member

@Ericson2314 Oh, also, is this the type of thing that should go into the haskell-updates branch (instead of the master branch)?

@peti
Copy link
Member

peti commented Oct 2, 2019

I think it's fine to merge directly to master. This code is not used inside of Nixpkgs itself, so the test builds that happen on haskell-updates are not going to generate any useful insights anyway.

@peti peti merged commit 31714a4 into NixOS:master Oct 2, 2019
@Ericson2314
Copy link
Member Author

For those wondering, source does doesn't really have a host platform per-se, it is agnostic so it doesn't much matter which runCommand we use. Ideally the hashes would also be the same, since there's no C compiler or anything, but that's unsolved tech debt.

@Ericson2314 Ericson2314 deleted the call-hackage-cross branch October 2, 2019 21:01
@roberth roberth mentioned this pull request Feb 26, 2022
13 tasks
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

4 participants