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 bootstrap binary: 8.2.1 -> 8.2.2 #50808

Merged
merged 1 commit into from Nov 20, 2018

Conversation

bhipple
Copy link
Contributor

@bhipple bhipple commented Nov 20, 2018

If the nix store lives on NFS, ghc 8.2.1 is unable to build a package
database. This bug was fixed by @bgamari in ghc 8.2.2 here:
https://ghc.haskell.org/trac/ghc/ticket/13945

This commit upgrades the unpacked bootstrap GHC version, so that we can build
newer versions of GHC even if the store is on NFS.

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 nox --run "nox-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)
  • Fits CONTRIBUTING.md.

@bhipple
Copy link
Contributor Author

bhipple commented Nov 20, 2018

Note that this impacts users of GHC 8.2, 8.4, and 8.6 equally: all of them need the GHC 8.2-binary bootstrap compiler when building from src.

Without this, any build of any GHC fails (almost) immediately with this error, since the bootstrap compiler is unable to create package databases on NFS:

'/nix/store/7j7kci9f1h73pjcmy1vf2f7b60251npk-ghc-8.2.1-binary/lib/ghc-8.2.1/bin/ghc-pkg'
exited with an error:
ghc-pkg: Couldn't open database
/nix/store/7j7kci9f1h73pjcmy1vf2f7b60251npk-ghc-8.2.1-binary/lib/ghc-8.2.1/package.conf.d
for modification: {handle:
/nix/store/7j7kci9f1h73pjcmy1vf2f7b60251npk-ghc-8.2.1-binary/lib/ghc-8.2.1/package.conf.d/package.cache.lock}:
hLock: invalid argument (Bad file descriptor)
make[1]: *** [ghc.mk:993: install_packages] Error 1
make: *** [Makefile:51: install] Error 2

I verified that the ghc 8.2.2 binary does not have this problem.

@@ -24,30 +24,30 @@ let
in
Copy link
Contributor Author

Choose a reason for hiding this comment

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

If you like I could change line 20 at the same time, since this is going to cause a rebuild already.

@bhipple
Copy link
Contributor Author

bhipple commented Nov 20, 2018

@GrahamcOfBorg build haskell.compiler.ghc822Binary

@GrahamcOfBorg
Copy link

Success on x86_64-linux (full log)

Attempted: haskell.compiler.ghc822Binary

Partial log (click to expand)

gzipping man pages under /nix/store/dpw7c7pwfsvdhjsscr7dfgnd340b5fbc-ghc-8.2.2-binary/share/man/
patching script interpreter paths in /nix/store/dpw7c7pwfsvdhjsscr7dfgnd340b5fbc-ghc-8.2.2-binary
/nix/store/dpw7c7pwfsvdhjsscr7dfgnd340b5fbc-ghc-8.2.2-binary/lib/ghc-8.2.2/bin/ghc-split: interpreter directive changed from "/usr/bin/perl" to "/nix/store/3slr7z6s497z36x3dlkh6g8l7d8jkn6x-perl-5.28.0/bin/perl"
/nix/store/dpw7c7pwfsvdhjsscr7dfgnd340b5fbc-ghc-8.2.2-binary/share/doc/ghc-8.2.2/html/libraries/gen_contents_index: interpreter directive changed from "/bin/sh" to "/nix/store/qnp0bgn3icxrwcnnhz4pcjynxbcnxfv9-bash-4.4-p23/bin/sh"
checking for references to /build/ in /nix/store/dpw7c7pwfsvdhjsscr7dfgnd340b5fbc-ghc-8.2.2-binary...
running install tests
[1 of 1] Compiling Main             ( main.hs, main.o )
Linking main ...
compilation ok
/nix/store/dpw7c7pwfsvdhjsscr7dfgnd340b5fbc-ghc-8.2.2-binary

@GrahamcOfBorg
Copy link

Success on aarch64-linux (full log)

Attempted: haskell.compiler.ghc822Binary

Partial log (click to expand)

/nix/store/vi4352yli8q9rri24xfx07z0ppghbrhv-ghc-8.2.2-binary/lib/ghc-8.2.2/bin/ghc-split: interpreter directive changed from "/usr/bin/perl" to "/nix/store/6qcipin39m3j9gbxqfz2fkpmp3w7mqmi-perl-5.28.0/bin/perl"
checking for references to /build/ in /nix/store/vi4352yli8q9rri24xfx07z0ppghbrhv-ghc-8.2.2-binary...
running install tests
/nix/store/vi4352yli8q9rri24xfx07z0ppghbrhv-ghc-8.2.2-binary/lib/ghc-8.2.2/bin/ghc: /nix/store/9slnwsf9lmd1n68fzqi64i48pi0kfcj3-ncurses-6.1-20181027-abi5-compat/lib/libtinfo.so.5: no version information available (required by /nix/store/vi4352yli8q9rri24xfx07z0ppghbrhv-ghc-8.2.2-binary/lib/ghc-8.2.2/bin/../haskeline-0.7.4.0/libHShaskeline-0.7.4.0-ghc8.2.2.so)
/nix/store/vi4352yli8q9rri24xfx07z0ppghbrhv-ghc-8.2.2-binary/lib/ghc-8.2.2/bin/ghc: /nix/store/9slnwsf9lmd1n68fzqi64i48pi0kfcj3-ncurses-6.1-20181027-abi5-compat/lib/libtinfo.so.5: no version information available (required by /nix/store/vi4352yli8q9rri24xfx07z0ppghbrhv-ghc-8.2.2-binary/lib/ghc-8.2.2/bin/../ghc-8.2.2/libHSghc-8.2.2-ghc8.2.2.so)
/nix/store/vi4352yli8q9rri24xfx07z0ppghbrhv-ghc-8.2.2-binary/lib/ghc-8.2.2/bin/ghc: /nix/store/9slnwsf9lmd1n68fzqi64i48pi0kfcj3-ncurses-6.1-20181027-abi5-compat/lib/libtinfo.so.5: no version information available (required by /nix/store/vi4352yli8q9rri24xfx07z0ppghbrhv-ghc-8.2.2-binary/lib/ghc-8.2.2/bin/../terminfo-0.4.1.0/libHSterminfo-0.4.1.0-ghc8.2.2.so)
[1 of 1] Compiling Main             ( main.hs, main.o )
Linking main ...
compilation ok
/nix/store/vi4352yli8q9rri24xfx07z0ppghbrhv-ghc-8.2.2-binary

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.

Please target haskell-updates rather than staging.

If the nix store lives on NFS, `ghc 8.2.1` is unable to build a package
database. This bug was fixed by @bgamari in `ghc 8.2.2` here:
https://ghc.haskell.org/trac/ghc/ticket/13945

This commit upgrades the unpacked bootstrap GHC version, so that we can build
newer versions of GHC even if the store is on NFS.
@bhipple bhipple changed the base branch from staging to haskell-updates November 20, 2018 13:32
@bhipple
Copy link
Contributor Author

bhipple commented Nov 20, 2018

Rebased onto haskell-updates, thanks for the tip.

@peti
Copy link
Member

peti commented Nov 20, 2018

Test builds are running at https://hydra.nixos.org/jobset/nixpkgs/haskell-updates.

@peti peti merged commit 5d3a83d into NixOS:haskell-updates Nov 20, 2018
@bhipple
Copy link
Contributor Author

bhipple commented Nov 20, 2018

Thanks @peti!

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