Post A8b89af9cqRHhVCYAS by brad@toot.cafe
(DIR) More posts by brad@toot.cafe
(DIR) Post #A8b4Ig3mWpVtEHnYUi by hyperrealgopher@fosstodon.org
2021-06-24T02:32:04Z
0 likes, 0 repeats
This seems like *a lot* of code to make a static build. I don't understand how to add arbitrary hackage binaries or how to use a more recent version of GHC.#haskell #nixhttps://github.com/lunaris/minirepo
(DIR) Post #A8b663LwoXsHcCP3xo by brad@toot.cafe
2021-06-24T02:52:11Z
0 likes, 1 repeats
@hyperrealgopher That does look a bit tricky. I've never tried to build using Bazel _and_ Nix or to produce a static Haskell binary. But I know a little Nix. To me it looks like this is where the GHC version is selected: https://github.com/lunaris/minirepo/blob/58c3a67a09e97d22995380bb97f9e8cef6215fa9/nix/haskell/default.nix#L77, it's using the default version of the compiler from the static Haskell reference here: https://github.com/lunaris/minirepo/blob/58c3a67a09e97d22995380bb97f9e8cef6215fa9/nix/haskell/default.nix#L34. It looks like in the pinned version as well as master that GHC is at 8.6.4 (https://github.com/nh2/static-haskell-nix/blob/dbce18f4808d27f6a51ce31585078b49c86bd2b5/default.nix#L3, https://github.com/nh2/static-haskell-nix/blob/382150290ba43b6eb41981c1ab3b32aa31798140/default.nix#L3).
(DIR) Post #A8b74WMc58zsxuY1zc by brad@toot.cafe
2021-06-24T02:55:37Z
0 likes, 0 repeats
@hyperrealgopher Oops my bad, they import a sub-path of that static Haskell repo: https://github.com/lunaris/minirepo/blob/58c3a67a09e97d22995380bb97f9e8cef6215fa9/nix/haskell/default.nix#L42. Looks like that function accepts arguments to change the GHC version: https://github.com/nh2/static-haskell-nix/blob/382150290ba43b6eb41981c1ab3b32aa31798140/survey/default.nix#L37-L48 ... looks like they except that to be called with 8.8.1 as the newest possible version ("ghc881").
(DIR) Post #A8b74WoyNhgMNrogCG by brad@toot.cafe
2021-06-24T02:58:59Z
0 likes, 0 repeats
@hyperrealgopher Hrm, and as for arbitrary binaries ... there isn't a `default.nix` or `release.nix` I guess because you only need the Nix environment to build a fully static binary ... so that makes sense I suppose. If you want extra stuff in that build environment that can be included in the result I guess you might add it here: https://github.com/lunaris/minirepo/blob/58c3a67a09e97d22995380bb97f9e8cef6215fa9/nix/shell.nix#L47-L59
(DIR) Post #A8b74XC10277XKb572 by hyperrealgopher@fosstodon.org
2021-06-24T03:03:07Z
0 likes, 0 repeats
@brad Thank you for all this effort! I would've been lost otherwise. I was wondering about regular cabal library dependencies that may not be on stackage like ConfigFile.
(DIR) Post #A8b89af9cqRHhVCYAS by brad@toot.cafe
2021-06-24T03:15:13Z
0 likes, 0 repeats
@hyperrealgopher Sorry, that looks like it's handled with Bazel (https://github.com/lunaris/minirepo/blob/58c3a67a09e97d22995380bb97f9e8cef6215fa9/example-service/BUILD.bazel#L34-L38)? I'm not sure I'll be of any help there, hope you have better luck with it all soon!
(DIR) Post #A8bILWI8hc6F9zlOqG by hyperrealgopher@fosstodon.org
2021-06-24T05:09:27Z
0 likes, 0 repeats
@brad Thanks again!