Skip to content

GHC bootstrap binary in Nixpkgs is corrupt with recent patchelf. #593

@alyssais

Description

@alyssais

Describe the bug

Since #469, the latest version of patchelf produces corrupt binaries when used in the GHC bootstrap binary in Nixpkgs, resulting in the bootstrap binary derivation failing to build in installCheckPhase:

ghc-binary> Patchelfing /nix/store/j5rc4lw27h55kl3na2kb9vp2207dplzn-ghc-binary-9.6.3/lib/ghc-9.6.3/lib/x86_64-linux-ghc-9.6.3/libHSfilepath-1.4.100.4-ghc9.6.3.so
ghc-binary> Patchelfing /nix/store/j5rc4lw27h55kl3na2kb9vp2207dplzn-ghc-binary-9.6.3/lib/ghc-9.6.3/lib/bin/ghc-iserv-prof
ghc-binary> Patchelfing /nix/store/j5rc4lw27h55kl3na2kb9vp2207dplzn-ghc-binary-9.6.3/lib/ghc-9.6.3/lib/bin/ghc-iserv-dyn
ghc-binary> Patchelfing /nix/store/j5rc4lw27h55kl3na2kb9vp2207dplzn-ghc-binary-9.6.3/lib/ghc-9.6.3/lib/bin/ghc-iserv
ghc-binary> Patchelfing /nix/store/j5rc4lw27h55kl3na2kb9vp2207dplzn-ghc-binary-9.6.3/lib/ghc-9.6.3/lib/bin/unlit
ghc-binary> /nix/store/9r1nl9ksiyszy4qzzg6y2gcdkca0xmhy-stdenv-linux/setup: line 276: 50496 Segmentation fault      (core dumped) "$out/bin/ghc-pkg" --package-db="$package_db" recache

Steps To Reproduce

  1. Add patchelfUnstable to nativeBuildInputs in pkgs/development/compilers/ghc/9.6.3-binary.nix in Nixpkgs. I used NixOS/nixpkgs@3bdd07d0eea6.
  2. Try building ghc

Expected behavior

Bulid succeeds.

patchelf --version output

patchelf 0.18.0

Additional context

cc @brenoguim @Mic92

This does not appear to be the same issue as #568, because the test case given there works for me on the commit I bisected to.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions