Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support GHC 9.8.1 #1310

Open
wants to merge 12 commits into
base: master
Choose a base branch
from
Open

Support GHC 9.8.1 #1310

wants to merge 12 commits into from

Conversation

larskuhtz
Copy link
Contributor

@larskuhtz larskuhtz commented Oct 16, 2023

  • Support building with 9.8.1
  • update pact-json pin (to match code version used in chainweb-node)
  • update sbv pin to support GHC 9.8.1 (turn ignore -Wx-partial warnings)

@larskuhtz larskuhtz changed the title Lars/ghc 9.8.1 GHC 9.8.1 and webauth-0.8 Oct 16, 2023
@emilypi
Copy link
Member

emilypi commented Oct 18, 2023

CI seems to be broken with that last one @larskuhtz

@larskuhtz
Copy link
Contributor Author

Yeah, not sure why the nix builds fail. The failure message is a bit cryptic. Some nix expert has to take a look.

@larskuhtz larskuhtz changed the title GHC 9.8.1 and webauth-0.8 GHC 9.8.1 Oct 19, 2023
@larskuhtz
Copy link
Contributor Author

The nix m1 build now complains about x-partial (which comes as a surprise, because AFAIK this PR did not upgrade the nix build to use 9.8.). Also not sure about the other nix builds. The failure message are not meaningful (to me).

@larskuhtz
Copy link
Contributor Author

I also reverted webauthn 0.8 support from the PR, since webauthn it is now vendored.

@larskuhtz larskuhtz changed the title GHC 9.8.1 Support GHC 9.8.1 Oct 19, 2023
@larskuhtz
Copy link
Contributor Author

@imalsogreg can you take another look at the nix builds? I don't know how to fix them.

Comment on lines +760 to +761
_:xs -> xs
[] -> error "Expected nonempty list"
Copy link
Contributor

Choose a reason for hiding this comment

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

I'm curious if this can be changed to avoid the preceding null protoSteps check, and returning an empty list in this branch instead of erroring out? That is, smth like

(case reverse protoSteps of
  [] -> []
  _:xs -> xs)

let i = if null vs then info else _tInfo $ view _1 $ head vs
CyclicSCC [] -> error "Expected nonempty list"
CyclicSCC vs@(v:_) -> do
let i = if null vs then info else _tInfo $ view _1 $ v
Copy link
Contributor

Choose a reason for hiding this comment

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

null vs shall always be False here, right? Also, I think you can drop this last $ before v.

Copy link
Member

Choose a reason for hiding this comment

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

Yeah, need to drop the if null if the above change is to make it in.

@@ -659,8 +659,9 @@ enforceAcyclic
-> Eval e [(Term (Either l r), key, [key])]
enforceAcyclic info cs = forM cs $ \c -> case c of
AcyclicSCC v -> return v
CyclicSCC vs -> do
let i = if null vs then info else _tInfo $ view _1 $ head vs
CyclicSCC [] -> error "Expected nonempty list"
Copy link
Contributor

Choose a reason for hiding this comment

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

The previous impl proceeded as usual binding i to info in this case if my brain is symbolic-executing the code right. Although I'm not sure if that makes sense given the semantics of this branch.

Copy link
Member

Choose a reason for hiding this comment

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

evalError or something else here, even if unreachable, just in case.

[TxLog "USER_user1" "key1" row,
TxLog "USER_user1" "key1" row'] $
_getTxLog pactdb usert (head tids) v
case tids of
Copy link
Contributor

Choose a reason for hiding this comment

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

Shall we still check assertEquals "user txids" [1] tids?

@@ -1204,7 +1205,10 @@ showFails = do

-- | unsafe lens for using `typecheckBody` with const
singLens :: Iso' a [a]
singLens = iso pure head
singLens = iso pure (\case
Copy link
Contributor

Choose a reason for hiding this comment

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

I'd add HasCallStack constraint to this function to get better traces where it happened for debuggability (unless it's a hot spot, though I doubt it is).

allow-newer: *:deepseq
allow-newer: *:pretty
allow-newer: *:text
allow-newer: *:bytestring

-- Patch merged into master (upcoming verison 10.0). We are currently using 9.2
Copy link
Contributor

Choose a reason for hiding this comment

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

s/verison/version

@@ -25,16 +25,16 @@
pact =
final.haskell-nix.project' {
src = ./.;
compiler-nix-name = "ghc962";
compiler-nix-name = "ghc981";
Copy link
Contributor

Choose a reason for hiding this comment

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

This seems to be why this PR is making nix use 9.8.

Copy link
Contributor

Choose a reason for hiding this comment

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

@larskuhtz Were we aiming to use ghc 9.8.1 in this PR? I thought so, but let me check my assumption.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

On the cabal build side, with PR there are builds for both, ghc-9.6 and ghc-9.8.

Not sure what we want on the nix side. Personally, I'd say that in case of doubt we should prefer the latest.

@@ -659,8 +659,9 @@ enforceAcyclic
-> Eval e [(Term (Either l r), key, [key])]
enforceAcyclic info cs = forM cs $ \c -> case c of
AcyclicSCC v -> return v
CyclicSCC vs -> do
let i = if null vs then info else _tInfo $ view _1 $ head vs
CyclicSCC [] -> error "Expected nonempty list"
Copy link
Member

Choose a reason for hiding this comment

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

evalError or something else here, even if unreachable, just in case.

let i = if null vs then info else _tInfo $ view _1 $ head vs
CyclicSCC [] -> error "Expected nonempty list"
CyclicSCC vs@(v:_) -> do
let i = if null vs then info else _tInfo $ view _1 $ v
Copy link
Member

Choose a reason for hiding this comment

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

Yeah, need to drop the if null if the above change is to make it in.

[TxLog "USER_user1" "key1" row,
TxLog "USER_user1" "key1" row'] $
_getTxLog pactdb usert tid v
_ -> error "Expected nonempty list of tids"
Copy link
Member

Choose a reason for hiding this comment

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

Isn't there an assertFailure or something like this instead of error here?

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.

6 participants