Skip to content

Conversation

@jaschutte
Copy link
Contributor

Cherry picked the commits from the main branch regarding the flakes.nix to the 1.8 branch.

Pins down the GHC version down to the minor version. As discussed in a
PR in clash-cores
(clash-lang/clash-cores#44 (comment)).

Each supported GHC version is now postfixed with a minor version number.
However the overlays are not. The last digit of the version number gets
stripped when Nix imports an overlay. This way we can have one set of
GHC version numbers pin down the right GHC version *and* import the
right overlay.

I `nix build .#clash-ghc` with all three versions succesfully.
The overlay files themselves have changed a lot in master, from being
renamed to having bugs in them be solved.
@jaschutte
Copy link
Contributor Author

@DigitalBrains1 would it be possible to re-run the failing task? I think it's a fluke. Aside from that I think this provides a solid base for the mergify PRs to not fail.

@martijnbastiaan
Copy link
Member

I've pressed the button, but I think for GHA you should have been able to do it yourself too. If that's not the case we'll have to look into how those permissions work..

@kleinreact
Copy link
Member

 clash-ghc             > C:\Users\RUNNER~1\AppData\Local\Temp\ghc5C38.c: DeleteFile "\\\\?\\C:\\Users\\RUNNER~1\\AppData\\Local\\Temp\\ghc5C38.c": permission denied (Access is denied.)

Seems to be a reproducible one 🤔.

@DigitalBrains1
Copy link
Member

DigitalBrains1 commented Oct 31, 2025

Very weird. Maybe there's a problem with left over files on a runner and we managed to hit the same runner. I don't know. The whole point of Stack is that it's the same config every time, and with the previous PR it passed, and this PR doesn't change one iota of the Stack setup. Let's try again. Third time's the charm?

[edit]
There we go. Third time's the charm.
[/edit]

Copy link
Member

@DigitalBrains1 DigitalBrains1 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah, thanks! I have just a few points, I think we're almost there!

# is basically abandonware it catches fire with brick 1.0+.
brick = doJailbreak prev.brick_0_70_1;

vty = prev.callHackage "vty" "5.39" { };
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why is this

  vty = prev.callHackage "vty" "5.39" { };

in ghc96 but

  vty = doJailbreak (prev.callHackage "vty" "5.39" { });

in ghc98?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ghc98 has a different set of packages (since the compiler is newer) and in this set of packages for ghc98 certain packages (deepseq) has the wrong version, however it still compiles fine. That is why the jailbreak is required in ghc98 and not in ghc62 (where deepseq has the right version).

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Okay!


vty = prev.callHackage "vty" "5.39" { };

# Marked as broken in nixpkgs, since it needs on a newer hashable than the
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
# Marked as broken in nixpkgs, since it needs on a newer hashable than the
# Marked as broken in nixpkgs, since it needs a newer hashable than the

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What does it mean when you say

Needs a newer x than the .cabal file currently uploaded to hackage.

That the package needs a newer version of x than is currently uploaded to Hackage? So it needs an unreleased version? (Usually, we view the latest that is on Hackage as the latest release of a Haskell package.)

While the .cabal file specifies the version number for a specific version of a package, it's the uploaded package itself that is at that version. So you can just shorten it to

Needs a newer x than the latest version on Hackage.

But it feels like you mean something else entirely, as it's rather surprising that a released version of a package strictly requires an unreleased version of another package, so I'm probably misinterpreting.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I didn't write these comments haha, I cherry picked them from the main branch. However I think the comments refer to the version of Hackage pinned by the flake. It could be that actual Hackage has a newer version however the pinned set of packages is older, so we jailbreak it.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh, sorry, I should have checked where it came from before raising it here.

Well, you know what, if they just come from master let's use them as they are.

@jaschutte
Copy link
Contributor Author

jaschutte commented Nov 3, 2025

I am noticing that the build for ghc964 and ghc982 are failing due to clash-cores. This is the same error which mandated the use of the -package ... flags in clash-cores, but they seemingly stopped working..?

The exact error:

 Running phase: installPhase
> Installing library in /nix/store/nk5x59gj85dkpfc4pafz7k9n2287pl5x-clash-cores-1.8.3/lib/ghc-9.6.4/lib/x86_64-linux-ghc-9.6.4/clash-cores-1.8.3-51cL0hdQstoGyd2JlzQBpU
> Error: Setup: '/nix/store/s461n4kgh0khrfpb6jqc8mf1hlqg20gn-ghc-9.6.4/bin/ghc'
> exited with an error:
> <command line>: cannot satisfy -package ghc-typelits-extra

This is weird since listing the buildInputs, ghc-typelits-extra-0.4.7 is listed (and so are the other ghc typelist extensions).

EDIT: I will apply the same patches I did at clash-cores
clash-lang/clash-cores@d9d1679#diff-206b9ce276ab5971a2489d75eb1b12999d4bf3843b7988cbe8d687cfde61dea0

And that seemed to have worked!

Copy link
Member

@DigitalBrains1 DigitalBrains1 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

And that seemed to have worked!

Nice!

Shall we squash-commit this? There's two problems with keeping the individual commits. First off, they don't individually pass CI, and I prefer every commit to pass CI. Secondly, the first commit message is cherry-picked from 762f7f0 and it says "I nix build .#clash-ghc with all three versions succesfully." which is confusing since this is not actually possible here :-).

@jaschutte
Copy link
Contributor Author

I'm in favor of squash merging!

@DigitalBrains1
Copy link
Member

Okay, go ahead!

@DigitalBrains1
Copy link
Member

We decided that we want a Changelog entry, James, let's decide on a phrasing. I don't particularly care whether the Changelog entry is actually a part of a merged PR or not; writing the Changelog for a release is still a manual process anyway, so I can just add it.

First thought:

Changed:

  • Nix flake updated to make it more suitable for use in downstream projects

@jaschutte jaschutte merged commit 52a5472 into 1.8 Nov 5, 2025
16 checks passed
@jaschutte jaschutte deleted the flake-changes-1.8 branch November 5, 2025 11:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants