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, haskell-infra: #40929 take 2 #40996

Merged
merged 12 commits into from May 25, 2018
Merged

Conversation

Ericson2314
Copy link
Member

Motivation for this change

@peti Pretty sure I fixed the paxmark issues, but there could be other issues.

Things done
  • 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 and others added 12 commits May 23, 2018 10:26
Just like with the other `--extra-*` flags, cc/ld-wrapper already handles
this, but we need to make Cabal aware so that the haskell builds have
the correct metadata.
…Inputs

This is because they are just for Setup.hs, so they are just used at build time
and completely isolated from the normal components' dependencies.

This was previous implemented in 8a8f040, but
reverted in e69c7f5 because it broken
setup-depends non-cross in haskell shell environments (custom Setup.hs in cross
shell environments has never worked). This version adds a special native
exception to avoid that breakage.
…taticlib

The reason why this does not work is not that we can't built static
objects, we can, but we can't use `-staticlib` on GHC on windows.
`-staticlib` rolls all dependencies into a combined archive. While this
would work on windows if we used gnu ar and MRI script, GHC can't rely
on GNU ar, and as such has a quick archive concatenation module for GNU
and BSD archives only.
Shell glob works even as the exact set of executable (filenames) varries
beween configuations. Need to skip non ELFs (e.g. shell scripts),
however.
nixpkgs#37012 and  nixpkgs#37707 introduces the setup-hooks for libiconv, which inject `-liconv` into the `NIX_LDFLAGS`. This breaks horribly on windows where the linker end up having no idea how to linke `-liconv`. The configure.ac file specifically ignores libiconv on windows.
postInstall = ''
paxmark m $out/lib/${name}/bin/${if targetPlatform != hostPlatform then "ghc" else "{ghc,haddock}"}
for bin in "$out"/lib/${name}/bin/*; do
isELF "$bin" || continue
Copy link
Member Author

Choose a reason for hiding this comment

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

This should fix the build failure.

@GrahamcOfBorg
Copy link

No attempt on aarch64-linux (full log)

The following builds were skipped because they don't evaluate on aarch64-linux: ghc

Partial log (click to expand)


a) For `nixos-rebuild` you can set
  { nixpkgs.config.allowUnsupportedSystem = true; }
in configuration.nix to override this.

b) For `nix-env`, `nix-build`, `nix-shell` or any other Nix command you can add
  { allowUnsupportedSystem = true; }
to ~/.config/nixpkgs/config.nix.


@GrahamcOfBorg
Copy link

Success on x86_64-linux (full log)

Attempted: ghc

Partial log (click to expand)

stripping (with command strip and flags -S --keep-file-symbols) in /nix/store/8y4ijq0micdv3i71fag097x89zvc1fff-ghc-8.2.2/lib  /nix/store/8y4ijq0micdv3i71fag097x89zvc1fff-ghc-8.2.2/bin
patching script interpreter paths in /nix/store/8y4ijq0micdv3i71fag097x89zvc1fff-ghc-8.2.2
checking for references to /build in /nix/store/8y4ijq0micdv3i71fag097x89zvc1fff-ghc-8.2.2...
shrinking RPATHs of ELF executables and libraries in /nix/store/jdmc4qbaqaip067sfc03f9dm8ms0bhaq-ghc-8.2.2-doc
/nix/store/j75dgadrff2d1fyc4fczmcgqkid2imdx-binutils-2.30/bin/strip is /nix/store/j75dgadrff2d1fyc4fczmcgqkid2imdx-binutils-2.30/bin/strip
strip is /nix/store/j75dgadrff2d1fyc4fczmcgqkid2imdx-binutils-2.30/bin/strip
patching script interpreter paths in /nix/store/jdmc4qbaqaip067sfc03f9dm8ms0bhaq-ghc-8.2.2-doc
/nix/store/jdmc4qbaqaip067sfc03f9dm8ms0bhaq-ghc-8.2.2-doc/share/doc/ghc/html/libraries/gen_contents_index: interpreter directive changed from "/bin/sh" to "/nix/store/xn5gv3lpfy91yvfy9b0i7klfcxh9xskz-bash-4.4-p19/bin/sh"
checking for references to /build in /nix/store/jdmc4qbaqaip067sfc03f9dm8ms0bhaq-ghc-8.2.2-doc...
/nix/store/8y4ijq0micdv3i71fag097x89zvc1fff-ghc-8.2.2

@GrahamcOfBorg
Copy link

Failure on x86_64-darwin (full log)

Attempted: ghc

Partial log (click to expand)

"inplace/bin/ghc-stage1" -hisuf p_hi -osuf  p_o -hcsuf p_hc -static -prof -eventlog  -H32m -O -Wall      -this-unit-id base-4.10.1.0 -hide-all-packages -i -ilibraries/base/. -ilibraries/base/dist-install/build -Ilibraries/base/dist-install/build -ilibraries/base/dist-install/build/./autogen -Ilibraries/base/dist-install/build/./autogen -Ilibraries/base/include -I/nix/store/6xismd1mcjqnsj873wmx1fr0p62v13f2-libiconv-osx-10.11.6/include  -optP-DOPTIMISE_INTEGER_GCD_LCM -optP-include -optPlibraries/base/dist-install/build/./autogen/cabal_macros.h -package-id rts -package-id ghc-prim-0.5.1.1 -package-id integer-gmp-1.0.1.0 -this-unit-id base -XHaskell2010 -O2  -no-user-package-db -rtsopts -Wno-trustworthy-safe -Wno-deprecated-flags     -Wnoncanonical-monad-instances  -odir libraries/base/dist-install/build -hidir libraries/base/dist-install/build -stubdir libraries/base/dist-install/build    -c libraries/base/./GHC/Event/IntTable.hs -o libraries/base/dist-install/build/GHC/Event/IntTable.p_o -dyno libraries/base/dist-install/build/GHC/Event/IntTable.dyn_o
clang-5.0: warning: argument unused during compilation: '-nopie' [-Wunused-command-line-argument]
clang-5.0: warning: argument unused during compilation: '-nopie' [-Wunused-command-line-argument]
"inplace/bin/ghc-stage1" -hisuf hi -osuf  o -hcsuf hc -static  -H32m -O -Wall      -this-unit-id base-4.10.1.0 -hide-all-packages -i -ilibraries/base/. -ilibraries/base/dist-install/build -Ilibraries/base/dist-install/build -ilibraries/base/dist-install/build/./autogen -Ilibraries/base/dist-install/build/./autogen -Ilibraries/base/include -I/nix/store/6xismd1mcjqnsj873wmx1fr0p62v13f2-libiconv-osx-10.11.6/include  -optP-DOPTIMISE_INTEGER_GCD_LCM -optP-include -optPlibraries/base/dist-install/build/./autogen/cabal_macros.h -package-id rts -package-id ghc-prim-0.5.1.1 -package-id integer-gmp-1.0.1.0 -this-unit-id base -XHaskell2010 -O2  -no-user-package-db -rtsopts -Wno-trustworthy-safe -Wno-deprecated-flags     -Wnoncanonical-monad-instances  -odir libraries/base/dist-install/build -hidir libraries/base/dist-install/build -stubdir libraries/base/dist-install/build   -dynamic-too -c libraries/base/./GHC/IO/Encoding.hs -o libraries/base/dist-install/build/GHC/IO/Encoding.o -dyno libraries/base/dist-install/build/GHC/IO/Encoding.dyn_o
"inplace/bin/ghc-stage1" -hisuf hi -osuf  o -hcsuf hc -static  -H32m -O -Wall      -this-unit-id base-4.10.1.0 -hide-all-packages -i -ilibraries/base/. -ilibraries/base/dist-install/build -Ilibraries/base/dist-install/build -ilibraries/base/dist-install/build/./autogen -Ilibraries/base/dist-install/build/./autogen -Ilibraries/base/include -I/nix/store/6xismd1mcjqnsj873wmx1fr0p62v13f2-libiconv-osx-10.11.6/include  -optP-DOPTIMISE_INTEGER_GCD_LCM -optP-include -optPlibraries/base/dist-install/build/./autogen/cabal_macros.h -package-id rts -package-id ghc-prim-0.5.1.1 -package-id integer-gmp-1.0.1.0 -this-unit-id base -XHaskell2010 -O2  -no-user-package-db -rtsopts -Wno-trustworthy-safe -Wno-deprecated-flags     -Wnoncanonical-monad-instances  -odir libraries/base/dist-install/build -hidir libraries/base/dist-install/build -stubdir libraries/base/dist-install/build   -dynamic-too -c libraries/base/./GHC/Event/TimerManager.hs -o libraries/base/dist-install/build/GHC/Event/TimerManager.o -dyno libraries/base/dist-install/build/GHC/Event/TimerManager.dyn_o
clang-5.0: warning: argument unused during compilation: '-nopie' [-Wunused-command-line-argument]
clang-5.0: warning: argument unused during compilation: '-nopie' [-Wunused-command-line-argument]
clang-5.0: warning: argument unused during compilation: '-nopie' [-Wunused-command-line-argument]
building of '/nix/store/n5bkiaw25c1d7ggy1x3x15ajf0vd9b9v-ghc-8.2.2.drv' timed out after 1800 seconds
�[31;1merror:�[0m build of '/nix/store/n5bkiaw25c1d7ggy1x3x15ajf0vd9b9v-ghc-8.2.2.drv' failed

@peti
Copy link
Member

peti commented May 24, 2018

I merged the code to haskell-updates. Hydra is building it starting with evaluation https://hydra.nixos.org/eval/1459088.

@Ericson2314
Copy link
Member Author

@peti Thank you!

@Ericson2314
Copy link
Member Author

Hydra looks pretty good. I'm merging!

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

5 participants