nh2 / static-haskell-nix

easily build most Haskell programs into fully static Linux executables
388 stars 36 forks source link

Remove need to manually set `dontDisableStatic` for _some_ packages #126

Closed FPtje closed 1 month ago

FPtje commented 1 month ago

@nh2 noted during Zurihac 2024 that it is quite annoying to have to set dontDisableStatic = true for many packages. That's a high maintenance burden, because you have to find out for which packages to enable it every time you update nixpkgs.

My proposal is simple: make an overlay that sets dontDisableStatic = true on every top level package. It doesn't solve every instance of dontDisableStatic (namely it doesn't solve those named <pkg>_static), but it does solve quite a few other ones.

Some nix diff of hello (only the first part)

~ 1s ❱ nix-diff /nix/store/szxfdgd6246fx4kxzlm48chi7s4jzsfc-hello-1.0.0.2.drv /nix/store/6882cjwird1m01b3sn0mbvfdwfdp1j0z-hello-1.0.0.2.drv
- /nix/store/szxfdgd6246fx4kxzlm48chi7s4jzsfc-hello-1.0.0.2.drv:{out}
+ /nix/store/6882cjwird1m01b3sn0mbvfdwfdp1j0z-hello-1.0.0.2.drv:{out}
• The builders do not match
    - /nix/store/m1k3k9nb0v6v4irqw1i0l3072w8l0xpr-bash-5.2p26/bin/bash
    + /nix/store/254zr6f8qninarlp900np49jnkn89arl-bash-5.2p26/bin/bash
• The input derivation named `bash-5.2p26` differs
  - /nix/store/w5f6j5s1q6ixidbyms5n1agdpm9h9zyz-bash-5.2p26.drv:{out}
  + /nix/store/bvmv0dn7ww1kryayha8cc7i1d8jp4s4n-bash-5.2p26.drv:{out}
  • The input derivation named `bison-3.8.2` differs
    - /nix/store/b69yawabv4wv6bsqm8bl4ard9rs9n0h7-bison-3.8.2.drv:{out}
    + /nix/store/3d3qf8dzw4326k0ls44l1dghbv8ribr3-bison-3.8.2.drv:{out}
    • The input derivation named `bootstrap-stage1-stdenv-linux` differs
      - /nix/store/mf8pfwszwb849n9zy9lb1dv2kykfn4j5-bootstrap-stage1-stdenv-linux.drv:{out}
      + /nix/store/j98vmn4zcvfplmwcy5cs4qqpbmfyqx61-bootstrap-stage1-stdenv-linux.drv:{out}
      • The input derivation named `bootstrap-stage1-gcc-wrapper-` differs
        - /nix/store/4pcys8vvfh3sk7zsjczkfb4j8fdqxij5-bootstrap-stage1-gcc-wrapper-.drv:{out}
        + /nix/store/m368ni3fhwngkkfpz08pwhlcz67lsasz-bootstrap-stage1-gcc-wrapper-.drv:{out}
        • The input derivation named `fortify-headers-1.1alpine3` differs
          - /nix/store/d4wmxp2n4k6imi0ixx7wi6xqph0n8as8-fortify-headers-1.1alpine3.drv:{out}
          + /nix/store/9wx482sb782ln974lq6vfqqmjhxviiyn-fortify-headers-1.1alpine3.drv:{out}
          • The environments do not match:
              + dontDisableStatic=1
        • Skipping environment comparison
      • The input derivation named `update-autotools-gnu-config-scripts-hook` differs
        - /nix/store/h9sv30dwr6kc2py56hc1blj5d6mz4i8i-update-autotools-gnu-config-scripts-hook.drv:{out}
        + /nix/store/78vqkl3vbffr5v5vvmb25v5mbvccbygq-update-autotools-gnu-config-scripts-hook.drv:{out}
        • The input derivation named `gnu-config-2024-01-01` differs
          - /nix/store/ip6f8pcvnwdkl0z29vmbqd42drr0dk8d-gnu-config-2024-01-01.drv:{out}
          + /nix/store/m6rynlkmyvkv2az4q54ilngy4v7rhr4r-gnu-config-2024-01-01.drv:{out}
          • The environments do not match:
              + dontDisableStatic=1