!RbXGJhHMsnQcNIDFWN:nixos.org

Haskell in Nixpkgs/NixOS

730 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
30 Nov 2024
@prsteele:matrix.orgPatrick SteeleI mean, this is working for me, somehow. (And was failing without it.) Annoyingly I can't replicate what Github Actions are doing locally, so I can't even reproduce this locally20:25:28
@prsteele:matrix.orgPatrick Steele
            test =
              let
                shell = self.devShells.${system}.default;
              in
              pkgs.writeShellApplication {
                name = "test";
                runtimeInputs = [ pkgs.cabal-install ] ++ shell.nativeBuildInputs;
                text = ''
                  cabal --config-file /dev/null --active-repositories=:none test --test-show-details=always "$@"
                '';
              };

is how I'm coercing tests to run in CI

20:26:04
@alexfmpe:matrix.orgalexfmpeHuh why do you want to build with nix but not run with nix?20:28:16
@prsteele:matrix.orgPatrick SteeleI do want to run with Nix, I'm not claiming this is idiomatic. My initial question is me trying to figure out how to get Nix to just run the tests directly20:28:46
@alexfmpe:matrix.orgalexfmpewhy not "nix-shell --run 'cabal test all'20:28:46
@alexfmpe:matrix.orgalexfmpe* why not "nix-shell --run 'cabal test all'"20:28:56
@alexfmpe:matrix.orgalexfmpe* why not "nix-shell --run 'cabal test all'"20:29:05
@prsteele:matrix.orgPatrick SteeleWould that have different behavior? In my mind those are awfully close20:29:21
@alexfmpe:matrix.orgalexfmpeThis is what I do if I want to CI the dev shell itself20:29:44
@prsteele:matrix.orgPatrick SteeleI'll give it a try20:30:05
@alexfmpe:matrix.orgalexfmpeOtherwise I just let the nix derivation do everything20:30:15
@alexfmpe:matrix.orgalexfmpeYou seem to be using flakes though. I think that's 'nix develop' or something rather than nix-shell20:31:09
@alexfmpe:matrix.orgalexfmpe
In reply to @prsteele:matrix.org
Would that have different behavior? In my mind those are awfully close
This would build your project (not the deps) outside of nix
20:32:23
@prsteele:matrix.orgPatrick SteeleI see20:42:38
@prsteele:matrix.orgPatrick Steelethank you20:42:46
@prsteele:matrix.orgPatrick Steele

nix develop --command cabal test has the same issue as a naked cabal test; it tries to go to Hackage.

I'm still not sure why nix-shell --run 'cabal test' would not "build the project outside Nix"

21:33:37
@prsteele:matrix.orgPatrick Steele I suppose I could literally just nix build .#thePackage and rely on Nix running the tests... 21:34:55
@alexfmpe:matrix.orgalexfmpeWell it builds the deps as nix derivations, and enters a nix-prepared shell environment22:12:30
@alexfmpe:matrix.orgalexfmpeBut then does a normal cabal build22:12:35
@alexfmpe:matrix.orgalexfmpe
In reply to @prsteele:matrix.org

nix develop --command cabal test has the same issue as a naked cabal test; it tries to go to Hackage.

I'm still not sure why nix-shell --run 'cabal test' would not "build the project outside Nix"

Disable hackage on cabal.project?
22:13:00
1 Dec 2024
@prsteele:matrix.orgPatrick Steelethat seems like a better solution than what I had cobbled together, thanks01:56:25
@aspendowntime:matrix.org@aspendowntime:matrix.org changed their display name from Oktawia (it/they/she) to Nerissa (it/they/she).10:12:34
@aspendowntime:matrix.org@aspendowntime:matrix.org changed their display name from Nerissa (it/they/she) to Nerissa (it/she).18:51:11
3 Dec 2024
@augyg:matrix.orglazyLambda
In reply to @alexfmpe:matrix.org
if one could have a TH pass or whatever typecheck the string literals, that'd be interesting
https://github.com/augyg/ClasshSS this is it currently. Ergonomic-ness in progress and I need to make better documentation to begin with
00:57:32
@augyg:matrix.orglazyLambda
In reply to @alexfmpe:matrix.org
if one could have a TH pass or whatever typecheck the string literals, that'd be interesting
* https://github.com/augyg/ClasshSS/tree/gs/modules this is it currently. Ergonomic-ness in progress and I need to make better documentation to begin with
00:58:59
@sternenseemann:systemli.orgsterni (he/him)gosh I really don't wanna do the GHA change for the merge workflow. doesn't seem like an enjoyable experiencing testing something by force pushing to a test repo20:18:20
@sternenseemann:systemli.orgsterni (he/him)You would think they'd somehow add a way to sort of test actions offline at some point…20:19:03
@maralorn:maralorn.demaralornIf we sync the timing of the jobs do we really knew to do the merge base thing?20:51:50
@sternenseemann:systemli.orgsterni (he/him)yes. the merge from master to staging-next or from staging-next to staging might fail while the merge from master to haskell-updates succeeds21:32:18
@maralorn:maralorn.demaralorn
In reply to @sternenseemann:systemli.org
yes. the merge from master to staging-next or from staging-next to staging might fail while the merge from master to haskell-updates succeeds
Yeah, that's what I thought.
22:35:42

Show newer messages


Back to Room ListRoom Version: 6