Skip to content

Commit 88f1e2d

Browse files
committed
Improve README
1 parent 514540c commit 88f1e2d

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

README.md

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,24 @@ Work on this so far was sponsored largely by my free time, [FP Complete](https:/
2525

2626
By now we have a nixpkgs issue on [Fully static Haskell executables](https://github.com/NixOS/nixpkgs/issues/43795) (progress on which is currently this repo, with plans to later merge it into nixpkgs), and [a merged nixpkgs overlay for static nixpkgs in general](https://github.com/NixOS/nixpkgs/pull/48803).
2727

28+
There's also nixpkgs's `pkgsStatic` package set, which can also build many Haskell packages statically with `musl`. Differences are:
29+
30+
* Type of compilation:
31+
* `pkgsStatic` uses cross-compilation infrastructure, which is inherently more complex, and more difficult to get into.
32+
* `static-haskell-nix` just replaces the libc, and compiles normally. This allows to build packages that cannot (yet) be cross-compiled.
33+
* `.a` + `.so` files:
34+
* `pkgsStatic` does _exclusively_ static builds, it generates only `.a` files and no `.so` files.
35+
* `static-haskell-nix` generates both `.a` and `.so` files, which allows more intermediate software to run (e.g. some build systems using Python libraries doing `dlopen()` on some `.so` files).
36+
* In the past, this made a big difference for TemplateHaskell, which worked well only when `.so` files are present. This seems to have improved. `static-haskell-nix` now has an off-by-default flag `useArchiveFilesForTemplateHaskell` that users are encouraged to test.
37+
* Hacky fixes:
38+
* `static-haskell-nix` contains a large amount of per-package fixes for static builds for which we haven't found a way to integrate them cleanly into nixpkgs yet.
39+
* Pinning:
40+
* `static-haskell-nix` does not impede nixpkgs progress, as it is maintained out of the nixkpgs.
41+
42+
In general, any contribution to `static-haskell-nix` or `pkgsStatic` benefits the respective other one.
43+
44+
A goal is to shrink `static-haskell-nix` over time, moving those parts into nixpkgs that do not slow down nixpkgs's fast pace.
45+
2846
## Funding
2947

3048
You can support this project financially [on OpenCollective](https://opencollective.com/static-haskell-nix). Goals:

0 commit comments

Comments
 (0)