Skip to content

haskell.compiler.ghc{948,967,984,9101,9121,9122}: fix build with gcc15#447396

Merged
sternenseemann merged 1 commit into
NixOS:stagingfrom
ghpzin:pr-ghc-gcc15
Sep 30, 2025
Merged

haskell.compiler.ghc{948,967,984,9101,9121,9122}: fix build with gcc15#447396
sternenseemann merged 1 commit into
NixOS:stagingfrom
ghpzin:pr-ghc-gcc15

Conversation

@ghpzin

@ghpzin ghpzin commented Sep 30, 2025

Copy link
Copy Markdown
Contributor

ghc versions excluded from patch:
9.10.2 - has previous fix with extern void* malloc(size_t);
9.10.3 - has latest fix with #include <stdlib.h>
9.12.3 - has latest fix with #include <stdlib.h>

Fixes build failure with gcc15, building utils/hp2ps/Utilities.c:

utils/hp2ps/Utilities.c:6:14: error:
warning: conflicting types for built-in function ‘malloc’;
expected ‘void *(long unsigned int)’ [-Wbuiltin-declaration-mismatch]
        6 | extern void* malloc();
          |              ^~~~~~
...
utils/hp2ps/Utilities.c:92:18: error:
warning: conflicting types for built-in function ‘realloc’;
expected ‘void *(void *, long unsigned int)’ [-Wbuiltin-declaration-mismatch]
       92 |     extern void *realloc();
          |                  ^~~~~~~

Tested with:

nix-build --expr 'with import ./. {}; let hc = haskell.compiler; in lib.mapAttrs (name: value: value.override { stdenv = gcc15Stdenv; }) (lib.filterAttrs (n: v: (builtins.tryEval v).success && lib.isDerivation v) hc)'
nix-build --expr 'with import ./. {}; let hc = haskell.compiler.native-bignum; in lib.mapAttrs (name: value: value.override { stdenv = gcc15Stdenv; }) (lib.filterAttrs (n: v: (builtins.tryEval v).success && lib.isDerivation v) hc)'

Part of fixes for gcc15 update:
#440456


Patch from fedora (rebase) is needed, because of previous fix attempts on same lines:
https://gitlab.haskell.org/ghc/ghc/-/merge_requests/13838
https://gitlab.haskell.org/ghc/ghc/-/merge_requests/13853
https://gitlab.haskell.org/ghc/ghc/-/merge_requests/13863
Could not find patch from "no fix" to "third fix" anywhere upstream.

Things done

  • Built on platform:
    • x86_64-linux
    • aarch64-linux
    • x86_64-darwin
    • aarch64-darwin
  • Tested, as applicable:
  • Ran nixpkgs-review on this PR. See nixpkgs-review usage.
  • Tested basic functionality of all binary files, usually in ./result/bin/.
  • Nixpkgs Release Notes
    • Package update: when the change is major or breaking.
  • NixOS Release Notes
    • Module addition: when adding a new NixOS module.
    • Module update: when the change is significant.
  • Fits CONTRIBUTING.md, pkgs/README.md, maintainers/README.md and other READMEs.

Add a 👍 reaction to pull requests you find important.

@nixpkgs-ci nixpkgs-ci Bot added 10.rebuild-linux: 11-100 This PR causes between 11 and 100 packages to rebuild on Linux. 10.rebuild-darwin: 501+ This PR causes many rebuilds on Darwin and should normally target the staging branches. 10.rebuild-darwin: 5001+ This PR causes many rebuilds on Darwin and must target the staging branches. 6.topic: haskell General-purpose, statically typed, purely functional programming language labels Sep 30, 2025
@ghpzin

ghpzin commented Sep 30, 2025

Copy link
Copy Markdown
Contributor Author

nixpkgs-review result

Generated using nixpkgs-review.

Command: nixpkgs-review pr 447396
Commit: cd23427e78baf12f20c854c4258dec98a55fd85d


x86_64-linux

❌ 4 packages failed to build:
  • haskell.packages.ghc96.haskell-language-server
  • haskell.packages.ghc98.haskell-language-server
  • hedgewars
  • tamarin-prover
✅ 33 packages built:
  • elm-land (elmPackages.elm-land)
  • elmPackages.create-elm-app
  • elmPackages.elm
  • elmPackages.elm-format
  • elmPackages.elm-pages
  • elmPackages.elm.doc
  • haskell.compiler.ghc9101
  • haskell.compiler.ghc9101.doc
  • haskell.compiler.ghc912 (haskell.compiler.ghc9122)
  • haskell.compiler.ghc912.doc (haskell.compiler.ghc9122.doc)
  • haskell.compiler.ghc9121
  • haskell.compiler.ghc9121.doc
  • haskell.compiler.ghc94 (haskell.compiler.ghc948)
  • haskell.compiler.ghc94.doc (haskell.compiler.ghc948.doc)
  • haskell.compiler.ghc96 (haskell.compiler.ghc967)
  • haskell.compiler.ghc96.doc (haskell.compiler.ghc967.doc)
  • haskell.compiler.ghc98 (haskell.compiler.ghc984)
  • haskell.compiler.ghc98.doc (haskell.compiler.ghc984.doc)
  • haskell.compiler.native-bignum.ghc9101
  • haskell.compiler.native-bignum.ghc9101.doc
  • haskell.compiler.native-bignum.ghc912 (haskell.compiler.native-bignum.ghc9122)
  • haskell.compiler.native-bignum.ghc912.doc (haskell.compiler.native-bignum.ghc9122.doc)
  • haskell.compiler.native-bignum.ghc9121
  • haskell.compiler.native-bignum.ghc9121.doc
  • haskell.compiler.native-bignum.ghc94 (haskell.compiler.native-bignum.ghc948)
  • haskell.compiler.native-bignum.ghc94.doc (haskell.compiler.native-bignum.ghc948.doc)
  • haskell.compiler.native-bignum.ghc96 (haskell.compiler.native-bignum.ghc967)
  • haskell.compiler.native-bignum.ghc96.doc (haskell.compiler.native-bignum.ghc967.doc)
  • haskell.compiler.native-bignum.ghc98 (haskell.compiler.native-bignum.ghc984)
  • haskell.compiler.native-bignum.ghc98.doc (haskell.compiler.native-bignum.ghc984.doc)
  • haskell.packages.ghc912.haskell-language-server
  • haskell.packages.ghc94.haskell-language-server
  • oama

Error logs: `x86_64-linux`
haskell.packages.ghc96.haskell-language-server
                                      IO [Rewrite Universe]
                  with actual type: TransformT IO [Rewrite Universe]
      NB: ‘ghc-exactprint-1.7.1.0:Language.Haskell.GHC.ExactPrint.Transform.TransformT’
            is defined in ‘Language.Haskell.GHC.ExactPrint.Transform’
                in package ‘ghc-exactprint-1.7.1.0’
          ‘TransformT’
            is defined in ‘Language.Haskell.GHC.ExactPrint.Transform’
                in package ‘ghc-exactprint-1.7.1.0’
    • In the expression:
        constructfromFunMatches imports fun_id fun_matches
      In the expression:
        let imports = mempty
        in constructfromFunMatches imports fun_id fun_matches
      In a case alternative:
          First (Just (fun_id, fun_matches))
            -> let imports = mempty
               in constructfromFunMatches imports fun_id fun_matches
    |
661 |                 constructfromFunMatches imports fun_id fun_matches
    |                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
haskell.packages.ghc98.haskell-language-server
                                      IO [Rewrite Universe]
                  with actual type: TransformT IO [Rewrite Universe]
      NB: ‘ghc-exactprint-1.8.0.0:Language.Haskell.GHC.ExactPrint.Transform.TransformT’
            is defined in ‘Language.Haskell.GHC.ExactPrint.Transform’
                in package ‘ghc-exactprint-1.8.0.0’
          ‘TransformT’
            is defined in ‘Language.Haskell.GHC.ExactPrint.Transform’
                in package ‘ghc-exactprint-1.8.0.0’
    • In the expression:
        constructfromFunMatches imports fun_id fun_matches
      In the expression:
        let imports = mempty
        in constructfromFunMatches imports fun_id fun_matches
      In a case alternative:
          First (Just (fun_id, fun_matches))
            -> let imports = mempty
               in constructfromFunMatches imports fun_id fun_matches
    |
661 |                 constructfromFunMatches imports fun_id fun_matches
    |                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

hedgewars and tamarin-prover have deps that fail with cmake errors.
haskell-language-server probably fails with something that #444937 fixed on staging-next

@ghpzin ghpzin marked this pull request as ready for review September 30, 2025 12:32

@sternenseemann sternenseemann left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

No need to be so strict for 9.4.

Comment thread pkgs/development/compilers/ghc/common-make-native-bignum.nix Outdated
- add patch from fedora (rebase of latest fix from upstream):
https://gitlab.haskell.org/ghc/ghc/-/issues/25662
https://gitlab.haskell.org/ghc/ghc/-/merge_requests/13863

ghc versions excluded from patch:
9.10.2 - has previous fix with `extern void* malloc(size_t);`
9.10.3 - has latest fix with `#include <stdlib.h>`
9.12.3 - has latest fix with `#include <stdlib.h>`

Fixes build failure with gcc15, building utils/hp2ps/Utilities.c:
```
utils/hp2ps/Utilities.c:6:14: error:
warning: conflicting types for built-in function ‘malloc’;
expected ‘void *(long unsigned int)’ [-Wbuiltin-declaration-mismatch]
        6 | extern void* malloc();
          |              ^~~~~~
...
utils/hp2ps/Utilities.c:92:18: error:
warning: conflicting types for built-in function ‘realloc’;
expected ‘void *(void *, long unsigned int)’ [-Wbuiltin-declaration-mismatch]
       92 |     extern void *realloc();
          |                  ^~~~~~~
```
@sternenseemann sternenseemann merged commit 02746ea into NixOS:staging Sep 30, 2025
29 of 31 checks passed
@ghpzin ghpzin deleted the pr-ghc-gcc15 branch September 30, 2025 17:23
@fabianhjr fabianhjr mentioned this pull request Dec 1, 2025
13 tasks
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 10.rebuild-darwin: 501+ This PR causes many rebuilds on Darwin and should normally target the staging branches. 10.rebuild-darwin: 5001+ This PR causes many rebuilds on Darwin and must target the staging branches. 10.rebuild-linux: 11-100 This PR causes between 11 and 100 packages to rebuild on Linux.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants