Closed infinisil closed 2 years ago
Two problems:
building '/nix/store/98ndy3affdhafiq9k9gj3xp44rfmzpyx-ghc-shell-for-packages-ghc-8.10.7-env.drv'...
/nix/store/dhhbwn09yhr7jqvwkvi0v4m62xzsvdi9-stdenv-darwin/setup: line 23: shopt: inherit_errexit: invalid shell option name
likely is related to https://github.com/NixOS/nixpkgs/pull/139508
Compilation speed slowed down considerably. It now takes about 6 minutes for a cabal build lib:webauthn
, whereas previously it only took about 1 minute. Notably there's also some weird lines like this during compilation:
exprType TYPE: Text
[...]
exprType TYPE: DOMString
[...]
exprType TYPE: a_ah4f6
[...]
exprType TYPE: a_ah4iL
Full output is here:
Looking at compilation times of individual modules, all modules compile within seconds, except these:
And the common thing among these modules is that they use deriving-aeson to derive JSON instances for a lot of data types. Safe to say, that package is causing the slowdown with this PR.
I'll continue investigating.
Here's the full log of a compilation with -v
and timestamps: log.txt
The performance problem doesn't appear to be related to haskell.nix, because it's the same even when I tried to switch to the nixpkgs Haskell infrastructure, see https://github.com/tweag/webauthn/tree/nixpkgs-haskell
Turns out that the problem only appears with aeson >= 2.0
. I'll try to create a small reproducible example to report to probably https://hackage.haskell.org/package/deriving-aeson
I reported the performance problem in https://github.com/fumieval/deriving-aeson/issues/16, having created a reproducible minimal example in https://github.com/tweag/webauthn/tree/deriving-aeson-slow-repro
I fixed the bash problem on macOS by just not using nix-shell
anymore. But now we're running into a segfault on darwin:
/Users/runner/work/_temp/2190ff6f-868b-4043-9299-11dfd6567307.sh: line 1: 18790 Segmentation fault: 11 nix-build -A webauthn.checks
This seems to be the same as issue https://github.com/NixOS/nix/issues/5125
Since this seems to be related to import-from-derivation, and I already did the work of getting the nixpkgs haskell infra to work in https://github.com/tweag/webauthn/tree/nixpkgs-haskell, I'm just gonna switch to that. This will also speed up CI and nix-shells
See commit messages for changes