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.compiler.ghc98: init at 9.8.1 #260138

Closed

Conversation

vaibhavsagar
Copy link
Member

@vaibhavsagar vaibhavsagar commented Oct 10, 2023

https://www.haskell.org/ghc/blog/20231009-ghc-9.8.1-released.html

Description of changes

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/)
  • 23.11 Release Notes (or backporting 23.05 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
  • Fits CONTRIBUTING.md.

@ncfavier
Copy link
Member

I think we should also update released in pkgs/top-level/release-haskell.nix

@plredmond
Copy link

I tried to build it and it failed with a lot of "_FORTIFY_SOURCE" warnings and then something about being "unable to load the interface for GHC.Types".

env TMP=/tmp TMPDIR=/tmp TEMP=/tmp nix-shell -I nixpkgs=https://github.com/NixOS/nixpkgs/archive/d8fb918c7e07ea239f14d90123306864b79057f8.tar.gz -p haskell.compiler.ghc98
$ nixos-version 
22.11pre-git (Raccoon)

$ env TMP=/tmp TMPDIR=/tmp TEMP=/tmp nix-shell -I nixpkgs=https://github.com/NixOS/nixpkgs/archive/d8fb918c7e07ea239f14d90123306864b79057f8.tar.gz -p haskell.compiler.ghc98

...

| Run Ghc CompileCWithGhc Stage1: rts/OldARMAtomic.c => _build/stage1/rts/build/c/OldARMAtomic.thr_debug_p_o                                                              
In file included from /nix/store/y8wfrgk7br5rfz4221lfb9v8w3n0cnyd-glibc-2.37-8-dev/include/inttypes.h:25,                                                                 
                 from rts/include/stg/Types.h:32,                                                                                                                         
                 from rts/include/Rts.h:23,                                                                                                                               
                                                                                                                                                                          
                 from rts/OldARMAtomic.c:17:0: error:                                                                                                                     
                                                                                                                                                                          
/nix/store/y8wfrgk7br5rfz4221lfb9v8w3n0cnyd-glibc-2.37-8-dev/include/features.h:413:4: error:                                                                             
     warning: #warning _FORTIFY_SOURCE requires compiling with optimization (-O) [-Wcpp]                                                                                  
      413 | #  warning _FORTIFY_SOURCE requires compiling with optimization (-O)                                                                                          
          |    ^~~~~~~                                                                                                                                                    
    |                                                                                                                                                                     
413 | #  warning _FORTIFY_SOURCE requires compiling with optimization (-O)                                                                                                
    |    ^                                                                                                                                                                
| Run Cc (FindCDependencies CDep) Stage1: rts/StgMiscClosures.cmm => _build/stage1/rts/build/cmm/StgMiscClosures.debug_o.d

...

/nix/store/74y3751gsixaz9797ib0hp7c658sp1y5-binutils-2.40/bin/ar: creating _build/stage1/libraries/ghc-bignum/build/libHSghc-bignum-1.3-inplace.a                [46/1848]
/---------------------------------------------------------------------------------\                                                                                       
| Successfully built library 'ghc-bignum' (Stage1, way v).                        |                                                                                       
| Library: _build/stage1/libraries/ghc-bignum/build/libHSghc-bignum-1.3-inplace.a |                                                                                       
| Library synopsis: GHC BigNum library.                                           |
\---------------------------------------------------------------------------------/
| Run Ghc CompileHs Stage1: compiler/GHC/Tc/Errors/Hole/Plugin.hs-boot => _build/stage1/compiler/build/GHC/Tc/Errors/Hole/Plugin.p_o-boot
Command line: _build/stage0/bin/ghc -Wall -Wcompat -hisuf p_hi -osuf p_o -hcsuf p_hc -static -prof -hide-all-packages -no-user-package-db '-package-env -' '-package-db _b
uild/stage1/inplace/package.conf.d' '-this-unit-id ghc-9.8.1-inplace' '-package-id array-0.5.6.0-inplace' '-package-id base-4.19.0.0-inplace' '-package-id binary-0.8.9.1-
inplace' '-package-id bytestring-0.12.0.2-inplace' '-package-id containers-0.6.8-inplace' '-package-id deepseq-1.5.0.0-inplace' '-package-id directory-1.3.8.1-inplace' '-
package-id exceptions-0.10.7-inplace' '-package-id filepath-1.4.100.4-inplace' '-package-id ghc-boot-9.8.1-inplace' '-package-id ghc-heap-9.8.1-inplace' '-package-id ghci
-9.8.1-inplace' '-package-id hpc-0.7.0.0-inplace' '-package-id process-1.6.18.0-inplace' '-package-id semaphore-compat-1.0.0-inplace' '-package-id stm-2.5.2.1-inplace' '-
package-id template-haskell-2.21.0.0-inplace' '-package-id time-1.12.2-inplace' '-package-id transformers-0.6.1.0-inplace' '-package-id unix-2.8.3.0-inplace' -i -i/build/
ghc-9.8.1/_build/stage1/compiler/build -i/build/ghc-9.8.1/_build/stage1/compiler/build/autogen -i/build/ghc-9.8.1/compiler -Irts/include -I_build/stage1/compiler/build -$
_build/stage1/compiler/build/. -Icompiler/. -I/build/ghc-9.8.1/libraries/process/include -I/build/ghc-9.8.1/_build/stage1/libraries/process/build/include -I/nix/store/fb4
kwxfyp8dqibcsgzgacfja0vmg8n65-libffi-3.4.4-dev/include -I/build/ghc-9.8.1/libraries/directory -I/build/ghc-9.8.1/_build/stage1/libraries/directory/build -I/build/ghc-9.8.
1/libraries/unix/include -I/build/ghc-9.8.1/_build/stage1/libraries/unix/build/include -I/build/ghc-9.8.1/libraries/time/lib/include -I/build/ghc-9.8.1/_build/stage1/libr
aries/time/build/lib/include -I/build/ghc-9.8.1/libraries/containers/containers/include -I/build/ghc-9.8.1/_build/stage1/libraries/containers/containers/build/include -I/
build/ghc-9.8.1/libraries/bytestring/include -I/build/ghc-9.8.1/_build/stage1/libraries/bytestring/build/include -I/build/ghc-9.8.1/libraries/base/include -I/build/ghc-9.
8.1/_build/stage1/libraries/base/build/include -I/nix/store/8n240jfdmsb3lnc2qa2vb9dwk638j1lp-gmp-with-cxx-6.3.0-dev/include -I/build/ghc-9.8.1/libraries/ghc-bignum/includ
e/ -I/build/ghc-9.8.1/_build/stage1/libraries/ghc-bignum/build/include/ -I/nix/store/wr45q5db80ll5vbv6adyj45cy3xqrc7m-elfutils-0.189-dev/include -I/nix/store/fb4kwxfyp8dq
ibcsgzgacfja0vmg8n65-libffi-3.4.4-dev/include -I/build/ghc-9.8.1/rts/include -I/build/ghc-9.8.1/_build/stage1/rts/build/include -optP-include -optP_build/stage1/compiler/
build/autogen/cabal_macros.h -optP-DHAVE_INTERNAL_INTERPRETER -optP-DCAN_LOAD_DLL -outputdir _build/stage1/compiler/build -fdiagnostics-color=always -Wall -Wno-name-shado
wing -Wnoncanonical-monad-instances -Wnoncanonical-monoid-instances -XHaskell2010 -XNoImplicitPrelude -XBangPatterns -XScopedTypeVariables -XMonoLocalBinds -XTypeOperator
s -no-global-package-db -package-db=/build/ghc-9.8.1/_build/stage1/inplace/package.conf.d -ghcversion-file=rts/include/ghcversion.h -ghcversion-file=rts/include/ghcversio
n.h -Wnoncanonical-monad-instances -optc-Wno-error=inline -c compiler/GHC/Tc/Errors/Hole/Plugin.hs-boot -o _build/stage1/compiler/build/GHC/Tc/Errors/Hole/Plugin.p_o-boot
 -fsplit-sections -O -H64m -O2 -haddock -haddock -Winvalid-haddock -Wno-deprecated-flags -Wcpp-undef
===> Command failed with error code: 1
                                          
compiler/GHC/Tc/Errors/Hole/Plugin.hs-boot:1:1: error: [GHC-88719]
    Failed to load interface for ‘GHC.Types’.                                                                                                                             
    Perhaps you haven't installed the profiling libraries for package ‘ghc-prim-0.11.0’?
    Use -v to see a list of the files searched for.
  |                             
1 | module GHC.Tc.Errors.Hole.Plugin where
  | ^
0;Finished in 27m02sCommand failed
Build failed.
error: builder for '/nix/store/7l47g15ssl59870d399svxchycr7vfxm-ghc-9.8.1.drv' failed with exit code 1

# Recache package db which needs to happen for Hadrian bindists
# where we modify the package db before installing
+ ''
package_db=("$out"/lib/ghc-*/lib/package.conf.d)
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 double /lib nesting is pretty gross, I don't know if we can avoid it somehow.

Copy link
Member

Choose a reason for hiding this comment

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

As far as I know, this is just the standard now with hadrian-built GHCs, unfortunately. (Kind of an unnecessary change that broke ghcWithPackages when it was first introduced…)

@vaibhavsagar
Copy link
Member Author

I believe I've addressed all your review comments @ncfavier.

@ofborg ofborg bot requested a review from expipiplus1 October 12, 2023 03:54
Copy link
Member

@sternenseemann sternenseemann left a comment

Choose a reason for hiding this comment

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

Thanks for this! There are some misc. things that need to be fixed/cleaned up still—I think it's easiest if I take care of that and push to this branch.

@vaibhavsagar
Copy link
Member Author

Sure!

@sternenseemann
Copy link
Member

a63c085!

Remaining tasks:

  • As hinted in the todo, look into the hyperlinked source stuff. I had a test build that was under 3GB—if that ends up being replicated on Hydra, we may never need to do this (fingers crossed!). Unfortunately, user flavours are a proper nightmare in hadrian unless you are happy copy pasting a lot of code.
  • Package an appropriate bindist. I'll probably go for 9.6.3 here, since it'll also bootstrap 9.10; some hadrian-related simplifications to the packaging can also likely be done.

@athas
Copy link
Contributor

athas commented Oct 17, 2023

FWIW, I've tried out this branch and the GHC it installs is perfectly operational for me.

@maralorn
Copy link
Member

So this PR is completed or are you keeping it open @sternenseemann to track the remaining todos?

@sternenseemann
Copy link
Member

#274245 for GHC 9.6.3 binary.

@vaibhavsagar vaibhavsagar deleted the vaibhavsagar/ghc981 branch May 3, 2024 15:10
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.

6 participants