Skip to content

haskell.compiler: stop reliance on LLVM 6 & 7; haskell.compiler.ghc884: remove at 8.8.4; llvmPackages_7: remove at 7.1.0#268509

Merged
sternenseemann merged 8 commits intoNixOS:masterfrom
sternenseemann:kill-llvm-6-7
Dec 5, 2023
Merged

haskell.compiler: stop reliance on LLVM 6 & 7; haskell.compiler.ghc884: remove at 8.8.4; llvmPackages_7: remove at 7.1.0#268509
sternenseemann merged 8 commits intoNixOS:masterfrom
sternenseemann:kill-llvm-6-7

Conversation

@sternenseemann
Copy link
Member

@sternenseemann sternenseemann commented Nov 19, 2023

Description of changes

cc @RaitoBezarius

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/)
  • 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.

@github-actions github-actions bot added the 6.topic: haskell General-purpose, statically typed, purely functional programming language label Nov 19, 2023
@ofborg ofborg bot added the 2.status: merge conflict This PR has merge conflicts with the target branch label Nov 19, 2023
Copy link
Member

@RaitoBezarius RaitoBezarius left a comment

Choose a reason for hiding this comment

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

Looks good to me, thank you.

@sternenseemann sternenseemann changed the title WIP: Remove LLVM 6 and 7 haskell.compiler: stop reliance on LLVM 6 & 7; haskell.compiler.ghc884: remove at 8.8.4; llvmPackages_7: remove at 7.1.0 Nov 19, 2023
@sternenseemann
Copy link
Member Author

cc @amjoseph-nixpkgs for GHC 8.6.5 changes

@sternenseemann
Copy link
Member Author

Also I'd like someone to look over the alias stuff and suggest something for the release notes. Maybe it's easier to do the LLVM removals separately?

@sternenseemann sternenseemann marked this pull request as ready for review November 19, 2023 18:01
@ofborg ofborg bot removed the 2.status: merge conflict This PR has merge conflicts with the target branch label Nov 19, 2023
@maralorn
Copy link
Member

LGTM. Just curious, why are we keeping LLVM 6?

@sternenseemann
Copy link
Member Author

@ofborg build maude, root5

@ofborg ofborg bot added the 8.has: clean-up This PR removes packages or removes other cruft label Nov 20, 2023
@ofborg ofborg bot requested a review from luc65r November 20, 2023 00:05
@ofborg ofborg bot added 10.rebuild-darwin: 1-10 This PR causes between 1 and 10 packages to rebuild on Darwin. 10.rebuild-linux: 1-10 This PR causes between 1 and 10 packages to rebuild on Linux. labels Nov 20, 2023
@sternenseemann
Copy link
Member Author

Can someone test this for maude/root5 on darwin?

diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix
index 3ac47ca930d5..550200c6e8fa 100644
--- a/pkgs/top-level/all-packages.nix
+++ b/pkgs/top-level/all-packages.nix
@@ -17733,7 +17733,7 @@ with pkgs;
   ### End of CuboCore
 
   maude = callPackage ../development/interpreters/maude {
-    stdenv = if stdenv.cc.isClang then llvmPackages_7.stdenv else stdenv;
+    stdenv = if stdenv.cc.isClang then llvmPackages_6.stdenv else stdenv;
   };
 
   me_cleaner = callPackage ../tools/misc/me_cleaner { };
@@ -40003,7 +40003,7 @@ with pkgs;
 
   root5 = lowPrio (callPackage ../applications/science/misc/root/5.nix {
     inherit (darwin.apple_sdk.frameworks) Cocoa OpenGL;
-    stdenv = if stdenv.cc.isClang then llvmPackages_7.stdenv else stdenv;
+    stdenv = if stdenv.cc.isClang then llvmPackages_6.stdenv else stdenv;
   });
 
   rinetd = callPackage ../servers/rinetd { };

@sternenseemann sternenseemann force-pushed the kill-llvm-6-7 branch 2 times, most recently from 7a8a890 to e6ec784 Compare November 25, 2023 21:11
@ofborg ofborg bot requested a review from veprbl November 26, 2023 03:15
@veprbl
Copy link
Member

veprbl commented Nov 27, 2023

No objection to root5 change from me.

@ghost
Copy link

ghost commented Nov 30, 2023

cc @amjoseph-nixpkgs for GHC 8.6.5 changes

I have no objections.

The contraption I hacked together to use ancient (gentoo?) powerpc64le binaries to bootstrap ghc just isn't sustainable.

We need to invest in being able to cross-compile ghc (i.e. build a build!=(host==target) compiler). Any other strategy for non-x86_64/aarch64 platforms isn't a good use of resources in the long run.

GHC 8.6.5 binary is essentially broken on aarch64-linux, hence the
platform has been removed from meta in the past. We can also drop the
corresponding src data to lessen confusion.
GHC has a native backend for POWER and SPARC. This is relevant to 8.6.5
binary in the case of POWER where we actually have a bindist and don't
need to include LLVM.
We want to remove llvmPackages_6, but it is the only version GHC 8.6.5
supports. Luckily, we actually don't need LLVM in any case, since all
X86 architectures have native codegen for Darwin and Linux, as well as
POWER for Linux. Consequently, we can just pass `null` and add an extra
assert to make this more transparent to future tinkerers.
Previously, maude would force clang 7 to be used when compiling with a
stdenv that uses some version of clang. The only such case during native
compilation is on Darwin where maude is marked as broken currently.

Thus, I'm treating this as dead code and removing the logic, as it
hinders our ability to remove llvmPackages_7. This may regress some kind
of cross compilation use case, but this can be addressed at some other
point if anyone is relying on that at all.
Seems like any clang version > 5 doesn't work. Since root >= 6.0 is
available from nixpkgs, I think it is reasonable to mark it as broken
for now. Maybe someone can figure out if it is possible to backport a
fix from root >= 6.0.
@sternenseemann sternenseemann merged commit 1b97c87 into NixOS:master Dec 5, 2023
@sternenseemann sternenseemann deleted the kill-llvm-6-7 branch December 5, 2023 01:03
@sternenseemann
Copy link
Member Author

LLVM 6 remains to be removed, but that requires a bigger effort since a lot of stuff now uses LLVM 6 post LLVM-5-removal.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

6.topic: haskell General-purpose, statically typed, purely functional programming language 8.has: clean-up This PR removes packages or removes other cruft 10.rebuild-darwin: 1-10 This PR causes between 1 and 10 packages to rebuild on Darwin. 10.rebuild-linux: 1-10 This PR causes between 1 and 10 packages to rebuild on Linux.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants