Stream: haskell-flake

Topic: cabal-install ignoring user's package set


view this post on Zulip Matt Peddie (Jan 31 2024 at 05:11):

@Srid I am trying to build https://hackage.haskell.org/package/rings on GHC 9.8.1, I have a flake set up with haskell-flake. I am trying to get singleton-bool (used in the test suite of lukko, a dependency of hackage-security) to be version 0.1.7 (Hackage latest). but no matter what I do, including using jailbreak = true for lukko, overriding the source of singleton-bool to be either github master or hackage 0.1.7, or check = false for lukko to avoid building the test suite altogether, my build fails building singleton-bool-0.1.6

view this post on Zulip Matt Peddie (Jan 31 2024 at 05:17):

flake.nix
here is the flake I'm using

view this post on Zulip Matt Peddie (Jan 31 2024 at 05:18):

I can't figure out why version 0.1.6 is getting built at all, but nix-output-monitor shows it as a dependency of lukko

view this post on Zulip Matt Peddie (Jan 31 2024 at 05:19):

I know just enough nix to get myself into trouble, so I'm having trouble digging deeper into what's going on

view this post on Zulip Srid (Jan 31 2024 at 05:24):

Can you paste the build log?

view this post on Zulip Matt Peddie (Jan 31 2024 at 05:24):

sure, is there a way to make a collapsible text snippet in zulip?

view this post on Zulip Srid (Jan 31 2024 at 05:25):

Yes, via spoilers: https://zulip.com/help/format-your-message-using-markdown#spoilers

But you can use regular Markdown code blocks as well

view this post on Zulip Matt Peddie (Jan 31 2024 at 05:26):

build.log
I'll just do it as a file

view this post on Zulip Srid (Jan 31 2024 at 05:27):

Is that full build log? Can you paste the entire output of nix develop -L or nix build -L?

view this post on Zulip Matt Peddie (Jan 31 2024 at 05:28):

it's pretty close. let's try a spoiler block

nix build -L

view this post on Zulip Matt Peddie (Jan 31 2024 at 05:29):

I can do nom build if you want to see the graph I was looking at

view this post on Zulip Srid (Jan 31 2024 at 05:30):

This one's better as it gives you a package stacktrace. Look at the last few lines:

In your flake, if you set lukka.check = false; it should disable building singleton-bool (assuming that's its test dependency)

view this post on Zulip Srid (Jan 31 2024 at 05:30):

The flake you attached above only sets lukko.jailbreak

view this post on Zulip Srid (Jan 31 2024 at 05:30):

(All jailbreak does is make cabal disrespect the version constraints in dependencies)

view this post on Zulip Matt Peddie (Jan 31 2024 at 05:31):

yes -- same error when setting lukko.check = false as I mentioned in the first message

view this post on Zulip Srid (Jan 31 2024 at 05:31):

Are you sure it is the exact same log lines as well (not just same error message)?

view this post on Zulip Srid (Jan 31 2024 at 05:32):

My guess is something else depends on singleton-bool, and you'll see this in the nix build log

view this post on Zulip Matt Peddie (Jan 31 2024 at 05:32):

no, I'm not sure, here is the output with lukko.check set to false

nix build -L

view this post on Zulip Matt Peddie (Jan 31 2024 at 05:32):

to me it still looked as if it's due to lukko

view this post on Zulip Srid (Jan 31 2024 at 05:34):

Why are you jailbreaking cabal-install btw?

view this post on Zulip Matt Peddie (Jan 31 2024 at 05:34):

just another random thing I tried at some point

view this post on Zulip Srid (Jan 31 2024 at 05:35):

All of this happening as a result of overriding cabal-install as that. If you don't know why you did it, just remove it and try again.

view this post on Zulip Matt Peddie (Jan 31 2024 at 05:35):

I did remove it, it looks like the same problem

view this post on Zulip Srid (Jan 31 2024 at 05:35):

Logs?

view this post on Zulip Matt Peddie (Jan 31 2024 at 05:35):

nix build -L (without cabal overridden)

view this post on Zulip Srid (Jan 31 2024 at 05:36):

Is this something I can reproduce locally on my machine?

view this post on Zulip Matt Peddie (Jan 31 2024 at 05:37):

I would hope so, that is the idea of nix, right? :) I can send you my flake.lock, I just have the flake files inside my local checkout of rings with no other changes
flake.nix
flake.lock

view this post on Zulip Srid (Jan 31 2024 at 05:37):

A minimal repro as git repo would be nice

view this post on Zulip Matt Peddie (Jan 31 2024 at 05:38):

OK I can make my own copy of rings and add those files if that is that much easier

view this post on Zulip Matt Peddie (Jan 31 2024 at 05:41):

https://github.com/peddie/rings branch flake

view this post on Zulip Srid (Jan 31 2024 at 05:41):

On macOS or Linux?

view this post on Zulip Matt Peddie (Jan 31 2024 at 05:41):

linux

view this post on Zulip Srid (Jan 31 2024 at 05:47):

It is building the world ...

view this post on Zulip Matt Peddie (Jan 31 2024 at 05:48):

that seems like the normal process for using nix, so I'll interpret that as a good thing

view this post on Zulip Srid (Jan 31 2024 at 05:48):

nixos cache caches only pkgs.haskellPackages I think

view this post on Zulip Matt Peddie (Jan 31 2024 at 05:48):

thanks for taking a look. I hope it's not something dumb caused by my lack of nix knowledge

view this post on Zulip Srid (Jan 31 2024 at 05:49):

By the way, @locallycompact is working on Horizon Haskell which provides package sets with caching, but there's one minor issue to resolve first: https://nixos.zulipchat.com/#narrow/stream/413949-haskell-flake/topic/Using.20horizon.20package.20set.20with.20haskell-flake

view this post on Zulip Srid (Jan 31 2024 at 05:49):

Matt Peddie said:

thanks for taking a look. I hope it's not something dumb caused by my lack of nix knowledge

We are actually writing a tutorial series to introduce Haskellers to Nix:

https://nixos.asia/en/nixify-haskell

view this post on Zulip Matt Peddie (Jan 31 2024 at 05:50):

Srid said:

nixos cache caches only pkgs.haskellPackages I think

ah, damn, OK. I have a big remote builder under my desk and occasionally try to use CUDA with nix, so I long ago gave up paying attention to whether and how the caches were working

view this post on Zulip Srid (Jan 31 2024 at 05:50):

(on top of the Nix series)

view this post on Zulip Srid (Jan 31 2024 at 05:50):

Alright, your repo failed on Linux for me with a different error:

image.png

view this post on Zulip Matt Peddie (Jan 31 2024 at 05:50):

very cool about the tutorial! I'll give it a read. I already appreciated your good haskell-flake docs many times

view this post on Zulip Matt Peddie (Jan 31 2024 at 05:51):

I haven't seen that error. what happened to reproducibility?

view this post on Zulip Srid (Jan 31 2024 at 05:51):

That ^ was the result of running nix develop -L.

Let me try nix build -L now.

view this post on Zulip Srid (Jan 31 2024 at 05:51):

the shell builds more packages than the package, necessarily. like HLS

view this post on Zulip Srid (Jan 31 2024 at 05:52):

Okay, I see it now:
image.png

view this post on Zulip Matt Peddie (Jan 31 2024 at 05:52):

I am guessing HLS doesn't work with 9.8.1 yet, or at least requires significant tweaking (in my experience it's a miracle when HLS runs OK)

view this post on Zulip Matt Peddie (Jan 31 2024 at 05:53):

right so singleton-bool-0.1.7 has those upper version bounds relaxed and I think should work, but I can't figure out why the package set contains singleton-bool-0.1.6 at all . . .

view this post on Zulip Srid (Jan 31 2024 at 05:54):

Regarding jailbreaking finite-typelits, you probably need latest anyway: https://github.com/mniip/finite-typelits/commit/03600fbac084e6bc6b95957665d6ceedb3722358

view this post on Zulip Srid (Jan 31 2024 at 05:55):

But it is just test change, so we can check=false it

view this post on Zulip Matt Peddie (Jan 31 2024 at 05:55):

thanks for the tip, I'll just get that from git then

view this post on Zulip Srid (Jan 31 2024 at 05:58):

I see what's happening. @Matt Peddie Try the no-fromSdist branch of haskell-flake for now.

view this post on Zulip Srid (Jan 31 2024 at 05:58):

And looks like we need to do this after all:

Srid said:

One thing we should do is allow the user to disable the use of cabalSdist (toggle on/off module option).

view this post on Zulip Matt Peddie (Jan 31 2024 at 05:59):

trying now. what exactly is going on, if you don't mind? how did, for example, disabling lukko tests not solve the problem?

view this post on Zulip Srid (Jan 31 2024 at 05:59):

cc @Robert Hensing - looks like our use of fromSdist is building its own cabal-install ignoring what's in the user's package set. Which was causing this problem.

view this post on Zulip Srid (Jan 31 2024 at 06:00):

This ^ was going on I think. I'll file an issue on github.

view this post on Zulip Matt Peddie (Jan 31 2024 at 06:01):

cool, I appreciate you taking the time for this. keep up the good work on haskell-flake. I look forward to learning to wield it more effectively from your tutorials

view this post on Zulip Srid (Jan 31 2024 at 10:07):

@Matt Peddie Can you let me know if https://github.com/srid/haskell-flake/pull/220 fixes it?

view this post on Zulip Matt Peddie (Jan 31 2024 at 22:23):

trying it now, but I'm not quite sure from looking at the patch and the discussion for which component I should be setting this new flag. cabal-install? at a meta-level, this confusion may be supporting evidence for

Because these kinds of issues are not straightforward to debug without knowledge of the nixpkgs Haskell infrastructure.

view this post on Zulip Matt Peddie (Jan 31 2024 at 22:44):

https://github.com/srid/haskell-flake/pull/221 seems to work OK, though

view this post on Zulip Srid (Feb 01 2024 at 03:25):

Matt Peddie said:

https://github.com/srid/haskell-flake/pull/221 seems to work OK, though

Awesome, we are planning to merge 221 only (not 220).


Last updated: Sep 16 2024 at 20:16 UTC