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 persistent-2.14 #66

Merged
merged 9 commits into from
Aug 15, 2022
Merged

Conversation

parsonsmatt
Copy link
Contributor

@parsonsmatt parsonsmatt commented Apr 14, 2022

This PR provides support for persistent-2.14 by CPPing in a GraphulaSafeToInsert type that is either an alias for SafeToInsert or const () :: Constraint.

Fixes #65

stack.yaml Outdated
Comment on lines 6 to 7
extra-deps:
- persistent-2.14.0.0
Copy link
Contributor Author

Choose a reason for hiding this comment

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

this is how i tested, can definitely back out

Copy link
Member

Choose a reason for hiding this comment

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

IIUC, persistent-2.14 has landed in nightly (we got a notification about it breaking us), so the stack-nightly.yaml file should be a good test (and is run on CI).

@eborden eborden requested a review from z0isch April 14, 2022 20:05
@@ -134,6 +135,7 @@ nodeKeyed
, PersistEntityBackend a ~ SqlBackend
, PersistEntity a
, Typeable a
, GraphulaSafeToInsert a
Copy link
Contributor Author

Choose a reason for hiding this comment

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

so, technically, this is a change to the signature of the function, which is a breaking change

but also technically, it's only a breaking change if persistent itself is updated to 2.14. Otherwise this evaluates out to a () and should discharge

I can also do another approach where I CPP this in at each use-site, which will prevent the API from changing for users unless they are on persistent-2.14 anyway.

Copy link
Member

Choose a reason for hiding this comment

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

I'm personally OK with us only doing a minor bump ourselves given this nuance. Curious what other Frecklers thing.

I don't think peppering the CPP around is worthwhile. I think we can either bend the rules or just do a major bump.

Copy link

@mjgpy3 mjgpy3 left a comment

Choose a reason for hiding this comment

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

Looks good to me! I'm gonna bring in @pbrisbin for the stack.yaml question.

src/Graphula/Class.hs Outdated Show resolved Hide resolved
@mjgpy3 mjgpy3 requested a review from pbrisbin April 14, 2022 20:08
Co-authored-by: Michael Gilliland <mjg.py3@gmail.com>
Copy link
Member

@pbrisbin pbrisbin left a comment

Choose a reason for hiding this comment

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

If I'm correct about this being exercised via stack-nightly.yaml, then I would indeed back out the stack.yaml change.

In other projects (e.g. yesod-auth-oauth) I've actually made a special stack-{dependency}-{version}.yaml and added it to the matrix, if I'm looking to "test ahead". So I might consider that if I'm not correct about how this is playing out in nightly.

Either way, not a big deal.

@@ -134,6 +135,7 @@ nodeKeyed
, PersistEntityBackend a ~ SqlBackend
, PersistEntity a
, Typeable a
, GraphulaSafeToInsert a
Copy link
Member

Choose a reason for hiding this comment

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

I'm personally OK with us only doing a minor bump ourselves given this nuance. Curious what other Frecklers thing.

I don't think peppering the CPP around is worthwhile. I think we can either bend the rules or just do a major bump.

src/Graphula/Class.hs Outdated Show resolved Hide resolved
@parsonsmatt
Copy link
Contributor Author

Hmm, GHC 8.6.5 and below don't support type A a = Eq a :: Constraint syntax.

@pbrisbin
Copy link
Member

Ugh, I'm actually not a fan of this "Approve and run" stuff. Sorry for the delay, I'm back from PTO now, so will be more responsive.

@pbrisbin
Copy link
Member

pbrisbin commented Apr 20, 2022

Well that's an interesting failure to only get in one resolver 🤔 is that a new (or improved) warning?

I don't mind disabling it as workaround -- I find the README.lhs specs can sometimes need that because the tricks needed to make the nice README can be not-great Haskell.

@parsonsmatt
Copy link
Contributor Author

It may also be a problem with how persistent-2.14 is generating code, too.

@parsonsmatt
Copy link
Contributor Author

Anything I can do to help move this forward?

@pbrisbin
Copy link
Member

Sorry I lost track of this. I think we were waiting on you fixing the stack-nightly build-error; perhaps by disabling a warning by pragma in the README.lhs? The log has expired so I'm just going by my previous comment.

@parsonsmatt
Copy link
Contributor Author

I think it will be very inefficient for me to fix a CI problem since I need manual approval for each CI run. Is there an easy way for me to test that locally?

@pbrisbin
Copy link
Member

I think it will be very inefficient for me to fix a CI problem since I need manual approval for each CI run

I thought I only had to approve a PR/contributor once. It's every time? Sigh.

Is there an easy way for me to test that locally?

As far as I can tell, CI just runs stack --resolver nightly --stack-yaml stack-nightly.yaml build --fast --pedantic --test. Does that reproduce the error for you?

@parsonsmatt
Copy link
Contributor Author

Hmm. brittany fails in the presence of CPP so restyled isn't going to work 🤔

@pbrisbin
Copy link
Member

Restyled is not a Required Status, so all good there.

@pbrisbin pbrisbin merged commit edd0baa into freckle:main Aug 15, 2022
@pbrisbin
Copy link
Member

Thanks!

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.

persistent-2.14 support
3 participants