-
-
Notifications
You must be signed in to change notification settings - Fork 18.1k
haskellPackages: support template-haskell and test suites when cross compiling #445672
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
base: haskell-updates
Are you sure you want to change the base?
Changes from all commits
92492a7
ec6331e
95de67a
87ba7fb
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -342,7 +342,7 @@ let | |
| "*.*.ghc.c.opts += -optc-std=gnu99" | ||
| ] | ||
| # Inform GHC that we can't load dynamic libraries which forces iserv-proxy to load static libraries. | ||
| ++ lib.optionals targetPlatform.isStatic [ | ||
| ++ lib.optionals (targetPlatform.isAndroid || targetPlatform.isStatic) [ | ||
| "*.ghc.cabal.configure.opts += --flags=-dynamic-system-linker" | ||
| ]; | ||
|
|
||
|
|
@@ -636,7 +636,7 @@ stdenv.mkDerivation ( | |
| "--with-ffi-includes=${targetLibs.libffi.dev}/include" | ||
| "--with-ffi-libraries=${targetLibs.libffi.out}/lib" | ||
| ] | ||
| ++ lib.optionals (targetPlatform == hostPlatform && !enableNativeBignum) [ | ||
| ++ lib.optionals (!enableNativeBignum) [ | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I tested this, and I believe this makes I believe we should never enable gmp when linking statically, due to licensing issues. I'd say we should even default Thus, I'm not keen on merging this change right now.
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
||
| "--with-gmp-includes=${targetLibs.gmp.dev}/include" | ||
| "--with-gmp-libraries=${targetLibs.gmp.out}/lib" | ||
| ] | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -38,7 +38,6 @@ in | |
| haskeline = null; | ||
| hpc = null; | ||
| integer-gmp = null; | ||
| libiserv = null; | ||
| mtl = null; | ||
| parsec = null; | ||
| pretty = null; | ||
|
|
@@ -60,6 +59,11 @@ in | |
| xhtml = null; | ||
| Win32 = null; | ||
|
|
||
| # Was only ever released for a few exact versions of ghc | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. But it's also only required for 9.6? Comment is a little bit confusing to me.
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The whole situation is also confusing to me really: #445672 (comment)
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Maybe @angerman can comment? |
||
| libiserv = unmarkBroken (doJailbreak super.libiserv); | ||
|
|
||
| iserv-proxy = addBuildDepends [ self.libiserv ] super.iserv-proxy; | ||
|
|
||
| # Becomes a core package in GHC >= 9.8 | ||
| semaphore-compat = doDistribute self.semaphore-compat_1_0_0; | ||
|
|
||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -1279,9 +1279,6 @@ builtins.intersectAttrs super { | |
| ''; | ||
| }) (addBuildTool pkgs.buildPackages.makeWrapper super.cut-the-crap); | ||
|
|
||
| # Compiling the readme throws errors and has no purpose in nixpkgs | ||
| aeson-gadt-th = disableCabalFlag "build-readme" super.aeson-gadt-th; | ||
|
|
||
|
Comment on lines
-1282
to
-1284
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This change doesn't make sense to me. Building the readme is still not required and we have plenty of other packages to build to verify that TH works, right?
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is one package I know of where the executable uses TH, so I was using it as a sanity check. |
||
| # Fix compilation of Setup.hs by removing the module declaration. | ||
| # See: https://github.com/tippenein/guid/issues/1 | ||
| guid = overrideCabal (drv: { | ||
|
|
@@ -2151,9 +2148,10 @@ builtins.intersectAttrs super { | |
| enableExternalInterpreter = false; | ||
| }; | ||
| in | ||
| lib.mapAttrs (_: noExternalInterpreter) { inherit (super) iserv-proxy network; } | ||
| lib.mapAttrs (_: noExternalInterpreter) { inherit (super) iserv-proxy libiserv network; } | ||
| ) | ||
| iserv-proxy | ||
| libiserv | ||
| network | ||
| ; | ||
| } | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -22,10 +22,15 @@ let | |
| crossSupport = rec { | ||
| emulator = stdenv.hostPlatform.emulator buildPackages; | ||
|
|
||
| hasBuiltinTH = stdenv.hostPlatform.isGhcjs; | ||
|
|
||
| canProxyTH = | ||
| # iserv-proxy currently does not build on GHC 9.6 | ||
| lib.versionAtLeast ghc.version "9.8" && stdenv.hostPlatform.emulatorAvailable buildPackages; | ||
|
|
||
| # Many suites use Template Haskell for test discovery, including QuickCheck | ||
| canCheck = hasBuiltinTH || canProxyTH; | ||
|
|
||
| iservWrapper = | ||
| let | ||
| wrapperScript = | ||
|
|
@@ -602,7 +607,7 @@ let | |
| export GHC_PACKAGE_PATH="''${NIX_GHC_PACKAGE_PATH_FOR_TEST}" | ||
| fi | ||
|
|
||
| exec "$@" | ||
| exec ${if (isCross && crossSupport.canCheck) then "node" else crossSupport.emulator} "$@" | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This condition seems very wrong - it will use
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Huh yeah stuff got lost in the last rebase
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
||
| ''; | ||
|
|
||
| testTargetsString = | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You had the android condition here, but I didn't merge it, yet and instead put it into a separate commit.
I can't make android work with it, I still always get:
I tried:
And the same for GHC 9.12 - it fails with the same error.
GHC 9.8 fails because it can't apply an android related patch, I doubt you had been testing with that before.
What did you do that made the
isAndroidcondition here an improvement?Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That happens with any android build that requires the dynamic linker, unless you run it on an android system
IIRC it made TH work for
pkgsCross.aarch64-android-prebuilt.pkgsStaticbut that config is a strange creature, as stated in the PR description.Yeah, I only got android to work on 9.10+. I think something on GHC configure would need backporting for 9.8
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah these things (pkgsCross + pkgsStatic) don't compose, so that is not a relevant result. See #380342 and related PRs.
Right, so this means that iserv-proxy TH will only ever work this way, if we're building with
isStatic = true. Which in turn means, that we don't need theisAndroidcondition here anymore, because we already condition onisStatic.