Commit Graph

13 Commits

Author SHA1 Message Date
Emily
fdb820602b treewide: drop simple x86_64-darwin mentions
To reproduce:

    $ nix run nixpkgs/3b32825de172d0bc85664f495edb096b10862524#ast-grep \
        -- scan --update-all --inline-rules '
          id: nix-x86_64-darwin
          language: nix
          rule:
            any:
              - pattern: "\"x86_64-darwin\""
                kind: list_expression > string_expression
              - pattern:
                  context: "{ \"x86_64-darwin\" = $EXPR; }"
                  selector: binding
              - pattern:
                  context: "{ x86_64-darwin = $EXPR; }"
                  selector: binding
          fix:
            template: ""
        ' pkgs
    $ nix run nixpkgs/3b32825de172d0bc85664f495edb096b10862524#ast-grep \
        -- scan --update-all --inline-rules '
          id: json-first-x86_64-darwin
          language: json
          rule:
            kind: object > pair:nth-child(1)
            has:
              pattern: "\"x86_64-darwin\""
              field: key
          fix:
            template: ""
            expandEnd: { regex: "," }
        ' pkgs
    $ nix run nixpkgs/3b32825de172d0bc85664f495edb096b10862524#ast-grep \
        -- scan --update-all --inline-rules '
          id: json-x86_64-darwin
          language: json
          rule:
            kind: object > pair
            has:
              pattern: "\"x86_64-darwin\""
              field: key
          fix:
            template: ""
            expandStart: { regex: "," }
        ' pkgs
    $ git restore pkgs/by-name/om/omnix/package.nix
    $ git diff --name-only -z \
        | nix shell nixpkgs/3b32825de172d0bc85664f495edb096b10862524#gnused \
            -c xargs -0 sed -i '/^$/N; /^\n\? \+$/d'
    $ treefmt
2026-07-15 03:58:16 +01:00
Stefan Frijters
a43b8f3285 haskell.compiler.ghc*Binary: fix build with structuredAttrs 2025-12-14 20:17:19 +01:00
Stefan Frijters
c17b54ecd7 ghc: set sourceProvenance for binary bootstrap packages 2025-11-19 15:07:46 +01:00
Luna Nova
e7fbed853b treewide: remove usages of obsolete pie hardening flag 2025-10-09 10:13:03 -07:00
Wolfgang Walther
91a8fee3aa treewide: remove redundant parentheses
Auto-fixed by nixf-diagnose.
2025-10-05 10:52:03 +02:00
Wolfgang Walther
90e7159c55 treewide: remove unused rec
Auto-fix by nixf-diagnose.
2025-10-05 10:49:12 +02:00
Emily
fb5a523d14 haskell.compiler.ghc902Binary: bump LLVM by wrapping opt(1)
Implement a wrapper script to translate the `opt(1)` arguments passed
by the GHC 9.0.2 binary distribution to the equivalent arguments
for the new LLVM pass manager passed by GHC ≥ 9.10 and our
soon‐to‐be‐patched compilers. This ensures that the bootstrap
of GHC 9.4 continues to work on AArch64.

On an earlier version of this change, I built `haskell.compiler.ghc948`
on both `aarch64-linux` and `aarch64-darwin`, and
`haskell.compiler.ghc924` on `aarch64-linux` only (it is already
broken on Darwin). I confirmed that we get functionally identical
store outputs before and after this change, modulo self‐references:

    $ cp -a result-before/ before
    $ cp -a result-after/ after
    $ chmod -R +w before after
    $ LANG=C find before -type f -exec \
        remove-references-to \
        -t $(readlink result-before) \
        -t $(readlink result-before-doc) \
        '{}' ';'
    $ LANG=C find after -type f -exec \
        remove-references-to \
        -t $(readlink result-after) \
        -t $(readlink result-after-doc) \
        '{}' ';'
    # Darwin only: normalize build user UIDs in the archive files…
    $ LANG=C find before -name '*.a' -exec \
        sed -i 's/ 360 / 351 /g' '{}' ';'
    $ diff -r before after
    # Linux only: the `package.cache` files differ, presumably due to
    # an unrelated reproducibility issue.

Therefore, bumping this LLVM dependency did not affect the end result
of the bootstrap for the only compilers it is used for.
2025-09-07 19:07:56 +01:00
Emily
0d2321b1e4 ghc{865,8107,902,924,963,984}Binary: don’t depend on gcc on Darwin
At one point maybe these linked to libraries from GCC 6, but they
don’t seem to any more (checked 8.6.5 and 9.6.3).
2025-08-05 19:21:00 +01:00
Wolfgang Walther
5a0711127c treewide: run nixfmt 1.0.0 2025-07-24 13:55:40 +02:00
sternenseemann
fbbdcddada haskell.compiler.ghc902Binary: fix (system) libffi header discovery
The GHC 9.0.2 bindist expects the headers of libffi to be found under
/Applications/XCode.app instead of /Library (which is the case for later
GHC bindists which I copied the code from). Correctly substituting this
path will prevent GHC from using the bundled and thus outdated libffi
headers that are broken for some reason or other.

That these bundled headers were installed was actually a bug in hadrian
which created the bindists because it ignored use-system-libffi before
GHC 9.2. (This was actually the issue I noticed first because it hides
the actual problem: Because GHC installed these headers, GHC found some
version of ffi.h and ffitarget.h instead of correctly failing due to
missing headers which would indicate that package db is broken.) For the
sake of completeness, we can also solve this problem by deleting these
headers in postInstall.
2025-07-01 14:48:29 +02:00
sternenseemann
190346e1cf haskell.compiler.ghc902Binary: add missing isHadrian annotations
Interestingly, this did not break anything super obvious before, but now
paths between GHC and separate libraries match.
2025-07-01 13:47:59 +02:00
sternenseemann
d177909032 haskell.compiler.ghc902Binary: workaround com.apple.provenance xattr
See #413450.

(Ported from 759f22430c78267e863e583c79dd2269b51d1e5c.)
2025-07-01 13:47:37 +02:00
sternenseemann
221e06a56d haskell.compiler.ghc902Binary: init at 9.0.2
We can/should use 9.0.2 to bootstrap some GHC versions, having the
bindist makes things easier in some cases.

- To bootstrap GHC 9.4 using 9.2 is not possible and 8.10.7 doesn't
  always work. Since source built 9.0.2 is broken on darwin at the
  moment, the bindist helps. Reference #367686, #410085.
- To bootstrap GHC 9.2 without GHC 8.10. Reference #346214.
2025-05-30 17:12:45 +02:00