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

Update to nixos-23.05 #116

Merged
merged 29 commits into from
Jul 13, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
27ae28d
Bump nixpkgs.nix to pin to nixos-21.11 commit 573095944e7.
cdepillabout Dec 15, 2021
49fce8d
Bump nixpkgs submodule to be on 21.11.
cdepillabout Dec 15, 2021
b92d824
Make sure the nixpkgs submodule is looking at NixOS/nixpkgs.
cdepillabout Dec 15, 2021
dbe55ac
Get the basic example working with 21.11.
cdepillabout Dec 15, 2021
9c4227e
Add more ghc to cabal version mappings.
cdepillabout Dec 15, 2021
2b08698
Bump to ghc-8.10.7. Nixpkgs is on LTS-18.16.
cdepillabout Dec 15, 2021
b3f4744
postgresl's tests fail when building with musl, so disable postgrest …
cdepillabout Dec 15, 2021
f30e2f5
Apparently there is a curlMinimal top-level derivation now, which als…
cdepillabout Dec 15, 2021
6e3e1df
brotli support was added to curl and it needs to be explicitly disabl…
cdepillabout Dec 15, 2021
4b1f174
Make sure static archives symlinks are created for openblas.
cdepillabout Dec 17, 2021
4fa209c
Make sure blas-ffi uses openblasCompat.
cdepillabout Dec 17, 2021
83b1822
Disable stackage executable magico because of gfortran linking error.
cdepillabout Dec 17, 2021
d41b96a
Disable stackage packages that depend on postgres.
cdepillabout Dec 17, 2021
1b57af7
Make sure libdevil has libdeflate as buildInput.
cdepillabout Dec 17, 2021
3d0be9a
Drop to postgresql-11 and re-enable all Haskell packages that use pos…
cdepillabout Dec 18, 2021
14d4ace
new ncurses
robx Jul 27, 2022
6bdf17b
Update to nixos-23.05
nh2 Jun 10, 2023
b11ecc6
Fix `approachPkgs` being the wrong value.
nh2 Jun 10, 2023
9dfc7f2
Add comment on curl brotli disabling
nh2 Jun 10, 2023
d90f0ec
Disable GHC dwarf support
nh2 Jun 10, 2023
c91a9b4
Add `useArchiveFilesForTemplateHaskell` option.
nh2 Jun 11, 2023
0236a82
Fix `workingStackageExecutables`'s YAML loading.
nh2 Jun 12, 2023
2c20f14
Add nixpkgs patch to add .a files to bzip2 and zstd
nh2 Jun 13, 2023
70aa4a1
Make `.working` pass
nh2 Jun 13, 2023
9dd4c43
Remove old compilers:
nh2 Jun 13, 2023
da073d5
Remove workarounds no longer necessary with nixos-23.05
nh2 Jun 13, 2023
5793932
Fix arbtt needing libxcb
nh2 Jun 13, 2023
63232fc
Fix more packages. `workingStackageExecutables` builds on top of nixo…
nh2 Jul 13, 2023
ce1f737
Implement suggestion for bazel / rules_haskell
nh2 Jul 13, 2023
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
2 changes: 1 addition & 1 deletion .gitmodules
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
[submodule "nixpkgs"]
path = nixpkgs
url = https://github.com/nh2/nixpkgs.git
url = https://github.com/NixOS/nixpkgs.git
13 changes: 13 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,12 @@ Until Stack 2.3, the official static build of `stack` itself was built using thi
The [`static-stack`](./static-stack) directory shows how Stack itself can be built statically with static-haskell-nix.
`stack` is a big package with many dependencies, demonstrating that it works also for large projects.

## Related important open issues

You can contribute to these to help static Haskell executables:

* https://github.com/haskell/cabal/issues/8455

## FAQ

* I get `cannot find section .dynamic`. Is this an error?
Expand All @@ -116,6 +122,13 @@ The [`static-stack`](./static-stack) directory shows how Stack itself can be bui
then `/nix/store/dax3wjbjfrcwj6r3mafxj5fx6wcg5zbp-stack-2.3.0.1` is your final output _store path_ whose `/bin` directory contains your static executable.
* I get `stack2nix: user error (No such package mypackage-1.2.3 in the cabal database. Did you run cabal update?)`.
* You most likely have to bump the date like `hackageSnapshot = "2019-05-08T00:00:00Z";` to a newer date (past the time that package-version was added to Hackage).
* I get a linker error.
What's a good way to investigate what the linker invocation is?
* Pass `-v` to Cabal, and to GHC itself:
```sh
nix-build --expr '(import ./survey/default.nix {}).haskellPackages.YOURPACKAGE.overrideAttrs (old: { configureFlags = (old.configureFlags or []) ++ ["-v" "--ghc-options=-v"]; })'
```
Look for `*** Linker:` in the GHC output.
* Can I build Stack projects with resolvers that are too old to be supported by Stack >= 2?
* 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?
Expand Down
7 changes: 3 additions & 4 deletions default.nix
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Note: This is just a minimal example. For proper usage, see the README.

{ nixpkgs ? (import ./nixpkgs.nix).pkgsMusl, compiler ? "ghc864", strip ? true }:
{ nixpkgs ? (import ./nixpkgs.nix).pkgsMusl, compiler ? "ghc8107", strip ? true }:


let
Expand All @@ -12,7 +12,7 @@ let
pname = "example-scotty-app";
version = "0.1.0.0";
src = pkgs.lib.sourceByRegex ./. [
".*\.cabal$"
".*\\.cabal$"
"^Setup.hs$"
"^Main.hs$"
];
Expand All @@ -21,7 +21,7 @@ let
enableSharedExecutables = false;
enableSharedLibraries = false;
executableHaskellDepends = [ base scotty ];
license = stdenv.lib.licenses.bsd3;
license = pkgs.lib.licenses.bsd3;
configureFlags = [
"--ghc-option=-optl=-static"
"--extra-lib-dirs=${pkgs.gmp6.override { withStatic = true; }}/lib"
Expand All @@ -37,7 +37,6 @@ let
haskellPackages = with pkgs.haskell.lib; normalHaskellPackages.override {
overrides = self: super: {
# Dependencies we need to patch
hpc-coveralls = appendPatch super.hpc-coveralls (builtins.fetchurl https://github.com/guillaume-nargeot/hpc-coveralls/pull/73/commits/344217f513b7adfb9037f73026f5d928be98d07f.patch);
};
};

Expand Down
2 changes: 1 addition & 1 deletion nixpkgs
Submodule nixpkgs updated 33271 files
3 changes: 2 additions & 1 deletion nixpkgs.nix
Original file line number Diff line number Diff line change
Expand Up @@ -25,4 +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.
else import (fetchTarball https://github.com/NixOS/nixpkgs/archive/d00b5a5fa6fe8bdf7005abb06c46ae0245aec8b5.tar.gz) {}
# 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) {}
Loading