!RbXGJhHMsnQcNIDFWN:nixos.org

Haskell in Nixpkgs/NixOS

726 Members
For discussions and questions about Haskell with Nix, cabal2nix and haskellPackages in nixpkgs | Current Docs: https://haskell4nix.readthedocs.io/ | More Nix: #community:nixos.org | More Haskell: #haskell-space:matrix.org146 Servers

Load older messages


SenderMessageTime
15 Nov 2024
@mangoiv.:matrix.orgMangoIV I was lying 14:44:30
@mangoiv.:matrix.orgMangoIV It’s on unstable. All good 14:44:36
@maralorn:maralorn.demaralorn
In reply to @mangoiv.:matrix.org
I was lying
eh, everyone does it these days, apparently …
15:28:42
@mangoiv.:matrix.orgMangoIV
In reply to @maralorn:maralorn.de
eh, everyone does it these days, apparently …
I agree wholeheartedly. πŸ˜–
15:35:36
@hungryjoe:matrix.orgHungry Joe Would anyone be willing to run maintainers/scripts/haskell/update-cabal2nix-unstable.sh against the haskell-updates branch on nixpkgs, and PR the result?
I'm trying to release the change in this PR, but it's fail to run on my machine
Thanks in advance
15:45:04
@maralorn:maralorn.demaralorn"fails to run on my machine" is very suspicious in Nix land. πŸ˜„15:59:30
@maralorn:maralorn.demaralornIt could be that haskell-updates is just in a bad state because it is based on staging currently.15:59:53
@hungryjoe:matrix.orgHungry JoeIt's failing in the tests for redis16:07:10
@hungryjoe:matrix.orgHungry Joepotentially that indicates staging is broken, I can see there's a staged PR for redis16:07:59
@maralorn:maralorn.demaralornDoesn't seem like a you problem.16:08:00
@hungryjoe:matrix.orgHungry JoeYou'll have to forgive me taking a while to figure this stuff out; trying to get this package to build is my first time using Nix16:09:02
@maralorn:maralorn.demaralornYeah, probably need to wait a few days until we have haskell-updates figured out.16:09:25
@hungryjoe:matrix.orgHungry JoeNo worries, and thanks16:09:45
@hungryjoe:matrix.orgHungry JoeI'll keep an eye on the branch, anything particular I could be checking?16:10:04
@maralorn:maralorn.demaralornWe have a PR open which you can find in the room topic here.17:15:34
17 Nov 2024
@matto153:matrix.orgMatthias Meschede joined the room.15:44:30
@matto153:matrix.orgMatthias MeschedeHi all, is this channel in the NixOS matrix space? I couldn't find it there but I'm glad I found it now :)15:45:41
@emilazy:matrix.orgemily you might be in the old space – #space:nixos.org is the correct one 15:46:10
@matto153:matrix.orgMatthias MeschedeSeems to be the one I'm in. Does this channel appear under that space for you? Or can you find it when you type "Haskell" in the space search bar? Both don't work for me.15:47:39
@emilazy:matrix.orgemilyyes and it spins forever when I search respectively :)15:49:36
@emilazy:matrix.orgemilyprobably just Matrix being Matrix15:49:40
@matto153:matrix.orgMatthias Meschede

Anyway, thanks for pointing me here. Here is my question in case anyone has encountered this before or has debugging pointers:

I am encountering a strange (at least for me) situation when trying to get into a Haskell dev environment with developPackages. I'm basically using this in a larger flake.nix:

...
      haskellEnv = pkgs.haskellPackages.developPackage {
        root = pkgs.lib.sourceFilesBySuffices ./. [ ".cabal" ".hs" ];
        modifier = drv:
          pkgs.haskell.lib.addBuildTools drv (with pkgs.haskellPackages;
            [ cabal-install haskell-language-server ]);
      };
    in
    {
      devShells.${system} = {
        default = haskellEnv;
      };
    };
} 

The environment builds all fine when I do nix develop I drop in the shell and get cabal which I don't have installed otherwise. But cabal build redownloads all Haskell packages before building and I think it doesn't use anything from the nix provided package set. I previously had a Haskell setup where cabal was automatically configured to use the nix package set but I am now trying to switch to developPackage this doesn't seem to work out of the box.

Did anyone encounter this issue or has ideas how to approach this? I can't even find out which configuration cabal uses and thus can't check whether it's configured to point to some nix package set ... πŸ€”

15:52:30
@matto153:matrix.orgMatthias Meschede *

Anyway, thanks for pointing me here. Here is my question in case anyone has seen this before or has debugging pointers:

I am encountering a strange (at least for me) situation when trying to get into a Haskell dev environment with developPackages. I'm basically using this in a larger flake.nix:

...
      haskellEnv = pkgs.haskellPackages.developPackage {
        root = pkgs.lib.sourceFilesBySuffices ./. [ ".cabal" ".hs" ];
        modifier = drv:
          pkgs.haskell.lib.addBuildTools drv (with pkgs.haskellPackages;
            [ cabal-install haskell-language-server ]);
      };
    in
    {
      devShells.${system} = {
        default = haskellEnv;
      };
    };
} 

The environment builds all fine when I do nix develop I drop in the shell and get cabal which I don't have installed otherwise. But cabal build redownloads all Haskell packages before building and I think it doesn't use anything from the nix provided package set. I previously had a Haskell setup where cabal was automatically configured to use the nix package set but I am now trying to switch to developPackage this doesn't seem to work out of the box.

Did anyone encounter this issue or has ideas how to approach this? I can't even find out which configuration cabal uses and thus can't check whether it's configured to point to some nix package set ... πŸ€”

15:52:48
@mangoiv.:matrix.orgMangoIV Do you have package bounds in your cabal file or a cabal.project.freeze? If yes, try to remove it 16:35:40
@mangoiv.:matrix.orgMangoIV Nixpkgs provides just one package set. If your version bounds don’t allow to use this set, then cabal will download what it needs. You can stop if from doing that by removing the mirrors from your cabal.config file. 16:37:26
@sternenseemann:systemli.orgsterni (he/him) or you set active-repositories to :none https://cabal.readthedocs.io/en/stable/cabal-project-description-file.html#cfg-field-active-repositories 17:48:51
@matto153:matrix.orgMatthias MeschedeI don't have version bounds. But I'll try to actively stop it from downloading things.18:12:07
@maralorn:maralorn.demaralorn
In reply to @matto153:matrix.org

Anyway, thanks for pointing me here. Here is my question in case anyone has seen this before or has debugging pointers:

I am encountering a strange (at least for me) situation when trying to get into a Haskell dev environment with developPackages. I'm basically using this in a larger flake.nix:

...
      haskellEnv = pkgs.haskellPackages.developPackage {
        root = pkgs.lib.sourceFilesBySuffices ./. [ ".cabal" ".hs" ];
        modifier = drv:
          pkgs.haskell.lib.addBuildTools drv (with pkgs.haskellPackages;
            [ cabal-install haskell-language-server ]);
      };
    in
    {
      devShells.${system} = {
        default = haskellEnv;
      };
    };
} 

The environment builds all fine when I do nix develop I drop in the shell and get cabal which I don't have installed otherwise. But cabal build redownloads all Haskell packages before building and I think it doesn't use anything from the nix provided package set. I previously had a Haskell setup where cabal was automatically configured to use the nix package set but I am now trying to switch to developPackage this doesn't seem to work out of the box.

Did anyone encounter this issue or has ideas how to approach this? I can't even find out which configuration cabal uses and thus can't check whether it's configured to point to some nix package set ... πŸ€”

A good debugging approach is ghc-pkg list inside the nix shell and see whether you see all the dependencies which you want cabal not to build.
18:38:32
18 Nov 2024
@bitestring:matrix.orgbitestring

Does anyone know how to get PIE (Position Independent) enabled GHC runtime in Nix? I am trying to build a shared library in Haskell which would have all Haskell dependencies embedded in it, but when using that library in Rust I am getting

relocation R_X86_64_32S against symbol `stg_bh_upd_frame_info' can not be used when making a PIE object; recompile with -fPIE
12:55:44
@lxsameer:matrix.orglxsameer
In reply to @bitestring:matrix.org

Does anyone know how to get PIE (Position Independent) enabled GHC runtime in Nix? I am trying to build a shared library in Haskell which would have all Haskell dependencies embedded in it, but when using that library in Rust I am getting

relocation R_X86_64_32S against symbol `stg_bh_upd_frame_info' can not be used when making a PIE object; recompile with -fPIE
shouldn't you enable that in your build system?
13:11:26

Show newer messages


Back to Room ListRoom Version: 6