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 cross #3

Merged
merged 25 commits into from
Sep 3, 2024
Merged

Conversation

bolives-hax
Copy link
Owner

Description of changes

Things done

  • Built on platform(s)
    • x86_64-linux
    • aarch64-linux
    • x86_64-darwin
    • aarch64-darwin
  • For non-Linux: Is sandboxing enabled in nix.conf? (See Nix manual)
    • sandbox = relaxed
    • sandbox = true
  • 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/)
  • 24.11 Release Notes (or backporting 23.11 and 24.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.

Add a 👍 reaction to pull requests you find important.

maralorn and others added 25 commits August 20, 2024 00:32
This commit has been generated by maintainers/scripts/haskell/update-stackage.sh
This commit has been generated by maintainers/scripts/haskell/update-hackage.sh
This commit has been generated by maintainers/scripts/haskell/regenerate-hackage-packages.sh
haskellPackages.entropy: build with js backend
This is easy in comparison since these tools won't end up in GHC's
settings nor need to be available at runtime, so we can use
the *_FOR_BUILD environment variables.

It is important to add buildCC to depsBuildBuild to engage the
stdenv/wrapper script machinery properly.

Co-authored-by: sternenseemann <[email protected]>
1. Explicitly set WITH_TERMINFO. We usually match GHC's behavior well,
   but it is better to tie the Nix option to make explicitly.
   Unfortunately, the same is very complicated to achieve with
   hadrian (iirc).
2. Disable enableTerminfo if we are cross-compiling. This matches
   the behavior of GHC's build system, so we'll have to match it now.
   It also reduces the ncurses-related headache a bit.
3. Stop passing --with-curses* flags. Unfortunately, GHC does not
   account for the fact that different platforms need different ncurses
   libraries. This is somewhat migitated by the fact that ncurses is
   only ever needed for the build platform if we are cross compiling,
   but I seem to remember it leaking into the final GHC somehow.
   A more reliable alternative is relying on the cc/ld wrapper scripts,
   as they'll always pull out the correct ncurses out of the environment
   when GHC's build system passes -lcurses.
4. Unconditionally add ncurses to depsBuildBuild. Stage0 unconditionally
   builds terminfo (maybe the stage1 compiler needs it?), so we need to
   make sure that ncurses for the build platform is available.

Co-authored-by: sternenseemann <[email protected]>
Propagating the supported platforms of the boot compiler doesn't make
much sense when unregistered cross-compilation is possible.
This is to ensure that Haskell users on platforms that lack official
bindists still have a convenient means of getting GHC running natively.

In my admittedly somewhat limited testing on RISC-V, GHC 8.10.7 is able
to bootstrap native builds for 9.2.8 and 9.4.5. GHC 9.2.8 and 9.4.5 are
unable to bootstrap themselves and 9.6.2 when cross-compiled.

If you're looking at this commit to see whether you can safely upgrade
the compiler used here to remove 8.10, please try cross-compiling 9.0 or
later and then booting a native GHC with it.
@bolives-hax bolives-hax merged commit 73bc47e into bolives-hax:haskell-s390x-fixes Sep 3, 2024
19 of 20 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants