Sender | Message | Time |
---|---|---|
23 Jun 2022 | ||
@better_sleeping:converser.eu left the room. | 23:44:56 | |
19 Jul 2022 | ||
imdoor joined the room. | 20:01:26 | |
31 Jul 2022 | ||
imdoor | Hi, i haven't followed along static Haskell Nix stuff for a while now. Generally, how far along is this project currently? I saw that the Github repo hasn't seen any changes in a while now, should it still be used? I'm asking because i wanted to distribute a some CLI tool I've created as a static binary and was wondering what's the best place to start currently. I was thinking of maybe targeting Windows, is it possible using static Haskell Nix? Also, are there any examples for building Cabal projects available (like there is for Stack)? | 20:24:44 |
nh2 | Hi imdoor, I am currently quite busy so I haven't yet had the chance to review the current open PRs to update static-haskell-nix's nixpkgs pin to a later version. It is not possible to target Windows (not possible with nixpkgs in general). All Haskell packages are "cabal projects". The special thing for the stack support is that
builds all cabal packages in the | 20:37:58 |
nh2 | Hope that helps! | 20:38:01 |
imdoor | yup, thanks! :) | 20:47:56 |
1 Aug 2022 | ||
cdepillabout | imdoor: A few months ago static linking for Haskell executables was fixed in Nixpkgs, so now things like pkgsStatic.haskellPackages.foobar are much more likely to just work. | 03:00:48 |
cdepillabout | Although the approach is slightly different than taken in static-haskell-nix, and I'm under the impression that there are Haskell packages where static-haskell-nix will work, but the stuff in Nixpkgs won't. | 03:01:42 |
2 Aug 2022 | ||
imdoor | cdepillabout: oh, cool. then i guess i'll just start with using pkgsStatic and maybe that's all i need | 15:30:06 |
imdoor | * cdepillabout: oh, cool. then i guess i'll just start with trying pkgsStatic and maybe that's all i need | 15:30:20 |
imdoor | i got my project to build using pkgsStatic . i had to switch it from GHC 8.10.7 to 9.2.3, because of some (it seems) Template Haskell issue which was giving me a "attempting to use module [..] which is not loaded" error similar to this issue https://github.com/NixOS/nixpkgs/issues/124284, but there were no other problems (other than ones caused by the GHC upgrade) | 20:44:03 |
imdoor | btw, thanks for all the work put into static build support for Haskell. it's great being able to do this so easily | 20:53:58 |
4 Aug 2022 | ||
ajf___ joined the room. | 17:10:22 | |
26 Aug 2022 | ||
kadokusei10 joined the room. | 01:33:39 | |
31 Aug 2022 | ||
kadokusei10 | Anyone knows of a nix binary cache that has musl-ghc from pkgs-static or static-haskell-nix ? Hopefully for a nixpkgs revision from the last 6 months? The static-haskell-nix repo's nixpkgs (which I assume influences what gets cached) is a revision from July 2021 | 02:23:44 |
cdepillabout | In reply to @kadokusei10:matrix.orgI'm not sure what musl-ghc or pkgs-static are, but the haskell-updates jobset on the NixOS Hydra builds a few statically-linked libraries, so you should be able to get a GHC that is setup for static linking from there:https://github.com/NixOS/nixpkgs/blob/30942c90cbdf884dc6df63fbec859ac812e7d9d1/pkgs/top-level/release-haskell.nix#L468-L481 | 05:26:11 |
cdepillabout | Although that might be different from the GHCs you'd be building if you used static-haskell-nix. | 05:26:34 |
kadokusei10 | In reply to @cdepillabout:matrix.org Ah, my bad. Thanks for the hydra link that sounds like a promising point, I will take a look at it! | 09:48:29 |
kadokusei10 | In reply to @cdepillabout:matrix.org* Ah, my bad. Thanks for the point about the jobset and hydra that sounds like a promising point, I will take a look at it! | 09:49:16 |
cdepillabout | In reply to @kadokusei10:matrix.orgMost of the commits where the haskell-updates branch in Nixpkgs is merged into master should likely work for you, so that might be a good place to start looking. | 11:10:15 |
kadokusei10 | In reply to @cdepillabout:matrix.orgThanks, it seems to have worked! I do have a choice between a branch that was merged into master and one that was merged into nixpkgs-unstable right? Either of these has ghcMusl cached but nixpkgs-unstable might be a tad bit older with overall more packages (in general) cached. | 12:17:43 |
cdepillabout | In reply to @kadokusei10:matrix.orgI'm not super knowledgeable with the intricacies of the Nixpkgs Hydra, but I am definitely sure that there are a few Haskell packages built in pkgsStatic for the haskell-updates jobset. So that means as long as you use one of the fully-working commits from the haskell-updates break, you are very likely to be able to pull the statically-linking ghcs from the cache. | 12:41:31 |
cdepillabout | But if you use master or nixpkgs-unstable , you may get unlucky and not be able to get a statically-linking ghc from the cache. I think it just depends on what has happened on master since haskell-updates was merged in. I don't think the jobset for nixpkgs-unstable builds the statically-linking ghcs. | 12:43:00 |
kadokusei10 | Indeed it is as you say. I meant getting the haskell-updates merge commit from nixpkgs-unstable rather than master but then the jobset for nixpkgs-unstable does not run on every master commit so I might get unlucky on that case as well | 12:45:14 |
kadokusei10 | * Indeed it is as you say. I meant getting the haskell-updates merge commit from nixpkgs-unstable rather than master but then the jobset for nixpkgs-unstable does not run on every master commit so I might get unlucky on that case as well (if I understand correctly, which I probably do not :) ) | 12:45:46 |
kadokusei10 | Is there any reason to prefer pkgsStatic or pkgsMusl for Haskell builds? Looking at haskell-release.nix it looks like pkgsStatic gets more packages run for caching | 12:47:29 |
kadokusei10 | * Is there any reason to prefer pkgsStatic or pkgsMusl for Haskell builds? Looking at haskell-release.nix it looks like pkgsStatic gets more packages run for cachingEDIT: Got an answer to this one. with pkgsStatic I do not get a cache-hit for ghc-musl so I will only use pkgsMusl | 12:52:02 |
cdepillabout | In reply to @kadokusei10:matrix.orgWith the Nixpkgs stuff, packages built with pkgsStatic really are statically linked against musl. So for instance pkgsStatic.stack gives you a fully statically-linked stack binary. | 14:48:30 |
cdepillabout | With the Nixpkgs stuff, pkgsMusl is for executables that are dynamically linked against musl. So, for instance, pkgsMusl.stack is a stack binary that is dynamically-linked against musl. | 14:49:43 |
cdepillabout | Although if you're talking about static-haskell-nix , it is a little bit different. I think internally static-haskell-nix normally uses pkgsMusl , but has a bunch of overrides so that all libraries produce both .a files for static linking, and .so files for dynamic-linking. So if you were using static-haskell-nix , then you'd be using pkgsMusl , but you could likely either statically-link or dynamically-link depending on what flags you pass to ld when compiling. | 14:51:52 |