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

GHC: Normalize derivations is a few simple-hash preserving ways #33399

Merged
merged 2 commits into from Jan 3, 2018

Conversation

Ericson2314
Copy link
Member

@Ericson2314 Ericson2314 commented Jan 3, 2018

Motivation for this change

It makes future cross work a lot easier to replicate from GHC to GHC.

Things done

No hashes should be changed. I tested the normalized URLs without caches to ensure they still worked.

  • Tested using sandboxing (nix.useSandbox on NixOS, or option build-use-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 nox --run "nox-review wip"
  • Tested execution of all binary files (usually in ./result/bin/)
  • Fits CONTRIBUTING.md.

@Ericson2314 Ericson2314 requested a review from peti as a code owner January 3, 2018 22:13
@@ -9,7 +9,7 @@ stdenv.mkDerivation rec {
name = "ghc-${version}";

src = fetchurl {
url = "${meta.homepage}/dist/${version}/${name}-src.tar.bz2";
url = "https://downloads.haskell.org/~ghc/${version}/ghc-${version}-src.tar.bz2";
Copy link
Member Author

Choose a reason for hiding this comment

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

${name} is a bad shorthand because the name is prefixed for cross compilers.

Copy link
Contributor

Choose a reason for hiding this comment

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

Longterm: don't suffix (I believe it's suffix, not prefix) the target triplet onto ${name}?

Or should I drop this idea that generally any store path can be created equally by either cross or native compilation?

Copy link
Member Author

Choose a reason for hiding this comment

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

@bjornfor so we prefix for target != host and suffix for host != build :D. The former actually creates a meaningfully different derivation, while the latter ought to just be the implementation detail you want to hide. So don't worry, nothing here gets you farther from that.

@Ericson2314 Ericson2314 changed the title Ghc normalize GHC: Normalize derivations is a few simple-hash preserving ways Jan 3, 2018
@Ericson2314 Ericson2314 merged commit 25aff92 into NixOS:master Jan 3, 2018
@Ericson2314 Ericson2314 deleted the ghc-normalize branch January 3, 2018 22:36
@Ericson2314 Ericson2314 restored the ghc-normalize branch January 4, 2018 16:43
@Ericson2314 Ericson2314 deleted the ghc-normalize branch January 4, 2018 16:43
@Ericson2314 Ericson2314 restored the ghc-normalize branch January 4, 2018 16:43
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

3 participants