-
Notifications
You must be signed in to change notification settings - Fork 140
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
Changes for GHC 9.0 #333
Changes for GHC 9.0 #333
Conversation
@bgamari please resolve merge conflicts. |
I'm happy to rebase but do note that this will ultimately also need to be backported to the 0.10 branch. |
As described in the 9.0.1 release notes, withForeignPtr now incurs an extra runtime cost. In select cases (specifically, when the continuation is known not to diverge) we can instead use unsafeWithForeignPtr.
I have pushed the old branch (fixing 0.10) to https://github.com/bgamari/bytestring/tree/wip/no-fptr-0.10. |
@bgamari I'm very reluctant to resurrect |
It's simply too late in the release cycle for a change like this; we already released the 9.0 alpha (which is supposed to be at least mostly interface-stable) with 0.10 two months ago. If we were discussing a minor bump then this would be an option, but doing a major bump at this point is far too much work (since we would need to update a non-trivial portion of Hackage up-to-update to test via |
The difference between interfaces of |
The changes in GHC is a large project with a large number of dependencies and a very large impact on the ecosystem; a task like bumping I'm happy to bump |
Our estimate was that only around 1% of dependencies (6 out of top 500) are affected.
All core libraries do support According to this list, there are only two boot libraries, which do not support That said, I do not agree that "retarget the entire ecosystem onto it overnight" is a correct description. There was a lot of work done during three month since (I'm sorry, this comment by itself probably looks more combative than I would like it to be. I have to go, will get back to your other points later) |
Unfortunately even trivial patches can take weeks to merge. Furthermore, it's not true that these are the only libraries in need of patching: at least Perhaps let me elaborate on how I'm approaching this process in hopes that it will explain my reluctance to bump
None of this backported work had any user-breaking changes; they were either non-interface-relevant, rarely, changed only internal modules. The reason we have been so conservative is simple: the release is already terribly late and my goal is to move quickly to a final. In order to do this we need to tread carefully, making minimal changes to fix the issues that remain outstanding. Unfortunately, this precludes including 2kLoC of deltas in a unnecessary submodule bump, especially one that does not fix any immediate bug. Believe me, I do understand the desire to see the new
Quite alright; I similarly apologize if the above reads as harsh. Electronic communications is always hard. |
According to Hackage, both are fine. Ben, I am in no position to dictate downstream dependencies which version of If you insist on following your plan and schedule, please feel free to assume all responsibility and prepare Ben, I have nothing but utter respect to you and your work. Nevertheless we need to improve the way we communicate about changes in GHC and releases. Current pattern is detrimental for both parties. |
Ahh, I had missed that a revision had been pushed; unfortunately, a Hackage revision alone is not sufficient. GHC requires that the change be committed upstream, not merely committed as a Hackage revision since we need a Git commit to reference.
My apologies for missing your follow-up email; believe me that I did not ignore it intentionally. However, as I mentioned in my first reply, this discussion was already too late in the release cycle to have been actionable. The alpha had already been released and we were hoping to have a release candidate out in a few weeks. Unfortunately, the approach to #17760 that I was pursuing ended up not be viable; this is why the release has been delayed as long as it has.
I would hesitate to call this branch "substantial". The only patch in this branch needed for 9.0 is the second (b82da95), which is only changes a few
Likewise, I am very happy that
Agreed; the signalling surrounding this release has admittedly been terrible, in part due to the uncertainty of fixing #17760, and in part due to my own shortcomings: There should have been more active status updates from me. That being said, when you do want to get in touch with me email is not the preferred way; I receive far too much mail and it's very likely for things to go unseen. If a change is necessary in GHC's |
It is substantial, because I cannot verify the changes without building GHC from sources: GHC 9.0 alpha1 does not have I mean, I do not particularly mind merging this patch into Just to be clear: my suggestion above for you to release these changes in 0.10 series yourself was done in good faith. In a wider context:
|
Hi @Bodigrim,
Yes; this is precisely why I have held off until now in submitting the patch: I did not want to push work to submodules until it was clear what the final design looked like. The fact that this MR is open is your assurance that the interface is final.
Alright, thanks! I will go ahead and push out a new 0.10 release.
I'm a bit unclear on what you mean here. Is there a case you are thinking of? To be clear, we typically do avoid merging patches to
Indeed, nightly binaries distributions are available from CI. Moreover, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It does not compile with GHC 9.0.1 RC1, because unsafeWithForeignPtr
is not imported.
Data/ByteString/Internal.hs:439:36: error:
• Variable not in scope:
unsafeWithForeignPtr
:: ForeignPtr Word8 -> (Ptr a3 -> IO [Word8]) -> IO [Word8]
• Perhaps you want to add ‘unsafeWithForeignPtr’ to the import list
in the import of ‘GHC.ForeignPtr’
(Data/ByteString/Internal.hs:(162,1)-(166,61)).
|
439 | accursedUnutterablePerformIO $ unsafeWithForeignPtr fp $ \base ->
|
I suppose there should be a branch point at The @bgamari, @angerman is [CmmSized] adjust commit also required, and if it is, why it's missing from ghc-9.0.1-rc1 |
Yes, there is https://github.com/bgamari/bytestring/tree/wip/no-fptr-0.10 @bgamari I can take care of 0.10.X.X release next week, if you wish. Should both commits be included? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I pushed fixes, similar to merged in #340.
* [CmmSized] adjust * Replace withForeignPtr with unsafeWithF...Ptr where appropriate As described in the 9.0.1 release notes, withForeignPtr now incurs an extra runtime cost. In select cases (specifically, when the continuation is known not to diverge) we can instead use unsafeWithForeignPtr. * Fix build against GHC 9.0.1 RC1 Co-authored-by: Moritz Angermann <moritz.angermann@gmail.com> Co-authored-by: Bodigrim <andrew.lelechenko@gmail.com> # Conflicts: # Data/ByteString/Char8.hs # Data/ByteString/Internal.hs
* [CmmSized] adjust * Replace withForeignPtr with unsafeWithF...Ptr where appropriate As described in the 9.0.1 release notes, withForeignPtr now incurs an extra runtime cost. In select cases (specifically, when the continuation is known not to diverge) we can instead use unsafeWithForeignPtr. * Fix build against GHC 9.0.1 RC1 Co-authored-by: Moritz Angermann <moritz.angermann@gmail.com> Co-authored-by: Bodigrim <andrew.lelechenko@gmail.com>
This includes changes rewriting uses of
withForeignPtr
tounsafeWithForeignPtr
where appropriate for GHC 9.0.