Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Nixos 24.05 #127

Merged
merged 25 commits into from
Jun 15, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
5392d22
Upgrade to postgresql 14.
jonathanlking Dec 30, 2023
2ef6d76
Update default version of GHC/Cabal versions
jonathanlking Dec 30, 2023
b49f61c
Remove postgrest from working set
jonathanlking Dec 31, 2023
9a20880
Update nixpkgs submodule for 24.05
jonathanlking Jan 1, 2024
075d119
Set ghc version to the one from NixOS 24.05
nh2 Jun 9, 2024
42d492a
Fix new curl dependencies not having static libs
nh2 Jun 9, 2024
79945d6
Create pkgsWithGhc package set
jonathanlking Jul 31, 2023
743c156
Reorder pkgsWithArchiveFiles and pkgsWithGhc
jonathanlking Nov 10, 2023
6601d2c
No longer depend on two GHC versions #122
jonathanlking Dec 30, 2023
0f21cbc
Set dontDisableStatic by default in an overlay
FPtje Jun 9, 2024
7b0ba2f
NixOS upgrade fix: get X packages from xorg
FPtje Jun 9, 2024
2018b46
Apply dontDisableStatic to xorg
FPtje Jun 9, 2024
9b925d2
Fix some nil warnings
FPtje Jun 9, 2024
6e3740e
nixpkgs: Fix nix file not using commit from submodule.
nh2 Jun 9, 2024
2cc53bb
Work around unordered-containers failing test suite with -O0
nh2 Jun 9, 2024
dd8b314
Work around aeson failing test suite with -O0
nh2 Jun 9, 2024
67c7d87
Don't use python2
nh2 Jun 9, 2024
dd0c245
Fix deprecated `enableSystemd` -> `systemdSupport`
nh2 Jun 9, 2024
8f5a35f
Fixes `useArchiveFilesForTemplateHaskell = true` on GHC 9.6.
nh2 Jun 9, 2024
2247dbd
Fix postgresql-simple on -O0
nh2 Jun 9, 2024
526e161
nixpkgs: Update submodule to include `libtiff` fix
nh2 Jun 15, 2024
444e6a5
Add "Open questions" section, overlay for fixing `pkg-config`
nh2 Jun 15, 2024
bbd56c1
nixpkgs: Update submodule to include `mariadb_config` wrong linker fl…
nh2 Jun 15, 2024
c38da36
`workingStackageExecutable` now working.
nh2 Jun 15, 2024
1416fd4
Update `workingStackageExecutables`.
nh2 Jun 15, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
53 changes: 53 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -157,3 +157,56 @@ You can contribute to these to help static Haskell executables:
* No. For that you need need to use an old `static-haskell-nix` version: The one before [this PR](https://github.com/nh2/static-haskell-nix/pull/98) was merged.
* I get some other error. Can I just file an issue and have you help me with it?
* Yes. If possible (especially if your project is open source), please push some code so that your issue can be easily reproduced.


## Open questions

* Nixpkgs issue [Provide middle-ground overlay between pkgsMusl and pkgsStatic](https://github.com/NixOS/nixpkgs/issues/61575):

Should nixpkgs provide a `makeStaticAndSharedLibraries` adapter to provide a package set?
That might be better (but more difficult) than what we do now, with `dontDisableStaticOverlay`, because:
* `dontDisableStatic` is to prevent `--disable-static` to autoconf, which is really specific to C + autoconf.
A package set should do more than that, also for Meson, CMake, etc.
`nh2` started implementing this idea in nixpkgs branch `static-haskell-nix-nixos-24.05-makeStaticAndSharedLibraries`.

* Can we avoid building bootstrap tools?
* Our current overlays also build `xgcc`, `gcc`, `binutils`, and so on.
* This is because we override all packages to have e.g. `.a` files, and some of those are also dependencies of e.g. `gcc`.
* `pkgsStatic` avoids that by being a `cross` toolchain.
* But might this cause additional issues?
Because `cross` may have additional complexities when building the actual packages we're interested in, vs just switching the libc ("native" compilation)?
Unclear.
* For now, we accept those additional builds.

* How should we handle `pkg-config` regarding static dependencies?

E.g. `libtiff` depends on `lerc` and `libtiff-4.pc` correctly declares

```
Libs.private: -llzma -lLerc -ljpeg -ldeflate -lz -lm
Requires.private: liblzma libjpeg libdeflate zlib
```

But the `.pc` file does not include the path on which `libLerc.a` can be found, nor does anything in nixpkgs set `PKG_CONFIG_PATH` such that `Lerc.pc` is on it.
Thus, linking a static binary that uses `libtiff-4.pc` fails with

```
cannot find -lLerc: No such file or directory
```

* Should we use `propagatedBuildInputs` for this?
* Yes! We can use `stdenvAdapters.propagateBuildInputs`.
* Current problem: Using that in a native compilation (instead of cross as `pkgsMusl` does) causes:
```
error: build of '/nix/store/...-stdenv-linux.drv' failed: output '/nix/store/...-stdenv-linux' is not allowed to refer to the following paths:
/nix/store/...-binutils-patchelfed-ld-wrapper-2.41
/nix/store/...-pcre2-10.43-dev
/nix/store/...-gmp-with-cxx-6.3.0-dev
/nix/store/...-musl-iconv-1.2.3
/nix/store/...-binutils-2.41
/nix/store/...-bootstrap-tools
```
* John Ericson explained that the bootstrap rebuild avoidance (mentioned in a point above) also solves this issue for `pkgsStatic`.
So we probably need to do something similar.
* After fixing that, we still need to fix `libtiff` to include `lerc` in `Requires.private`.
* Done in https://github.com/NixOS/nixpkgs/pull/320105
2 changes: 1 addition & 1 deletion nixpkgs
Submodule nixpkgs updated 35761 files
4 changes: 2 additions & 2 deletions nixpkgs.nix
Original file line number Diff line number Diff line change
Expand Up @@ -25,5 +25,5 @@ if builtins.getEnv "STATIC_HASKELL_NIX_CI_NIXPKGS_UNSTABLE_BUILD" == "1"
if builtins.pathExists ./nixpkgs/pkgs
then import ./nixpkgs {}
# Pinned nixpkgs version; should be kept up-to-date with our submodule.
# This is nixos-23.05 as of 2023-06-08, with minimal patches currently having open nixpkgs PR (see commits for PR links).
else import (fetchTarball https://github.com/nh2/nixpkgs/archive/9e49f8f1f37bc906cda1adb33064c325d760819a.tar.gz) {}
# This is nixos-23.11 as of 2024-01-01, with minimal patches currently having open nixpkgs PR (see commits for PR links).
else import (fetchTarball https://github.com/nh2/nixpkgs/archive/ede5282c487a1fd2de64303ba59adad6726f1225.tar.gz) {}
Loading