Skip to content

Commit

Permalink
Fix GHC 9.10 literate haskell support for musl64 (#2259)
Browse files Browse the repository at this point in the history
* Add test for literate-haskell

* Fix literate haskell for musl64 and ghc 9.10
  • Loading branch information
hamishmack authored Oct 15, 2024
1 parent 56814a1 commit 54c84fc
Show file tree
Hide file tree
Showing 5 changed files with 44 additions and 0 deletions.
1 change: 1 addition & 0 deletions builder/ghc-for-component-wrapper.nix
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,7 @@ let
''
+ lib.optionalString (stdenv.targetPlatform.isMusl && !haskellLib.isNativeMusl && builtins.compareVersions ghc.version "9.9" >0) ''
ln -s $wrappedGhc/bin/${targetPrefix}unlit $wrappedGhc/bin/unlit
ln -s $wrappedGhc/bin/${ghcCommand}-iserv $wrappedGhc/bin/ghc-iserv
ln -s $wrappedGhc/bin/${ghcCommand}-iserv-prof $wrappedGhc/bin/ghc-iserv-prof
''
Expand Down
1 change: 1 addition & 0 deletions test/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -234,6 +234,7 @@ let
supported-languages = callTest ./supported-langauges {};
js-template-haskell = callTest ./js-template-haskell {};
gi-gtk = callTest ./gi-gtk { inherit util; };
literate-haskell = callTest ./literate-haskell {};
unit = unitTests;
};

Expand Down
19 changes: 19 additions & 0 deletions test/literate-haskell/default.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
{ stdenv, lib, project', haskellLib, recurseIntoAttrs, testSrc, compiler-nix-name, evalPackages }:

with lib;

let
project = project' {
inherit compiler-nix-name evalPackages;
src = testSrc "literate-haskell";
};

packages = project.hsPkgs;

in recurseIntoAttrs {
ifdInputs = {
inherit (project) plan-nix;
};

build = packages.literate-haskell.components.library;
}
16 changes: 16 additions & 0 deletions test/literate-haskell/literate-haskell.cabal
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
cabal-version: 3.0
name: literate-haskell
version: 0.1.0.0
category: Repro
build-type: Simple

common warnings
ghc-options: -Wall

library
import: warnings
exposed-modules: MyLib
build-depends: base
hs-source-dirs: src
default-language: Haskell2010

7 changes: 7 additions & 0 deletions test/literate-haskell/src/MyLib.lhs
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
\begin{code}
module MyLib (x) where
x=1
\end{code}

0 comments on commit 54c84fc

Please sign in to comment.