-
Notifications
You must be signed in to change notification settings - Fork 710
Changes to support new GHC 9.4's new Windows toolchain #8071
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 to support new GHC 9.4's new Windows toolchain #8071
Conversation
This supercedes #8062. |
-- Our solution is to use "ar r" in the simple case when one call is enough. | ||
-- When we need to call ar multiple times we use "ar q" and for the last | ||
-- call on OSX we use "ar qs" so that it'll make the index. | ||
|
||
let simpleArgs = case hostOS of | ||
OSX -> ["-r", "-s"] | ||
_ | dashLSupported -> ["-qL"] |
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.
is this (and will be) harmless on linux?
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.
Indeed. I have seen no traditional use of .a
archives which would want the non--L
behavior; you always want the merging behavior that -L
introduces. It's somewhat incredible that binutils' ar
does not support it yet.
General note: This issue looks like some kind of release candidate of Is this right, @bgamari? |
Yes, sadly this is the case. |
a41edc4
to
4b372fc
Compare
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.
LGTM. Thank you.
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.
lgtm, thanks!
should not we backport this to 3.6?
As noted in GHC #21068, the lld linker used on Windows by GHC 9.4 and later does not support object merging. Consequently, --enable-library-for-ghci can no longer be supported on this platform.
As of 9.4, GHC on Windows may produce .o files that are in fact archive files due to the lack of object merging support in the lld linker (see GHC #21068). Consequently, we must ensure that `ar` merges input archives' members, not add them as a single entry.
9eda67c
to
cabd857
Compare
i guess make 3.6 work with ghc-9.4 needs more changes and they were not already backported? |
@bgamari: please let us know if you think we need to backport this. Until then, let's leave it be, I guess? |
Given that users are advised to use the most recent |
That implies we'd need to release cabal 3.8 before GHC 9.4. We'll see... |
Any plans for cabal RC soon? Otherwise testing of GHC 9.4-alpha1 on Windows is blocked. |
validate workflow generate artifacts, to do the dogfooding but they also can be downloaded, i guess we could use them: https://github.com/haskell/cabal/actions/runs/2270699540#artifacts |
RC seems to be ready (famous last words): https://downloads.haskell.org/~cabal/cabal-install-3.8.1.0-rc1/ Please kindly test and give feedback. |
For ghcup users:
|
@andreabedini: the "3.8.0.2022052" in your commandline seems cut off; no idea if that matters... |
@Mikolaj that would be just a release tag for ghcup. Fixed it anyway! Thanks. |
@Mikolaj I checked |
Thank you for the confirmation. 3.8 is very close to master's HEAD and we probably haven't broken Windows GHC 9.4 support since then, so I hope we are fine. |
The official tags have dropped; we are now committed: https://github.com/haskell/cabal/tree/cabal-install-v3.8.1.0-rc1. |
This doesn't match ghcup's policy. I'm in the process of backporting this change to 3.6. This is the only issue I've heard about cabal-3.6 and ghc-9.4 compatibility. Are any others known? |
Cabal-3.6 does not support GHC-9.6. Period. It works because of happy accident (well, actually it doesn't on windows!) If proper support to be added, then all other changes related to GHC version have to be added. (see for bare minimum https://github.com/haskell/cabal/wiki/Making-a-release#for-release-for-new-ghc-version) In fact, GHC-3.10.2.0 support of GHC-9.8 is partial, which is unfortunate. |
That is not an issue. I'm only interested in Cabal-3.6 + GHC-9.4.
Thanks for the pointer. |
Sorry, I got versions wrong. |
Sure, I'm just trying to contain damage from too eagerly recommending GHC 9.4, which is mostly busted on windows due to the radical toolchain changes. |
What do you mean by partial exactly? The forgotten extension? |
Related: * haskell/ghcup-hs#966 We bump this, although 'cabal run' is known to be broken on windows: haskell/cabal#9334 However, backporting more patches to 3.6 is not sustainable. Initially, I tried to backport haskell/cabal#8071, but it's not clear whether that is the only thing that causes compatibility issues with GHC 9.4 and might drive us into an awkward situation as well.
Not forgotten, but left out because unwillingness to make a major version bump release Also I don't trust EDIT: also https://downloads.haskell.org/ghc/latest/docs/users_guide/using-warnings.html#ghc-flag--Wcompat group has changed previously but not in 9.8 AFAIK, but as issue above, it's a minor inconsistency. It's unluckily to be hit by that. |
Just drive by comment to notice that @hasufell is most likely interested in cabal-install (which is what GHCup distributes) and not Cabal. cabal-install can use a newer version of Cabal if needed. |
As noted in GHC #21068, the lld linker used on Windows by GHC 9.4 and later does not support object merging. Consequently,
--enable-library-for-ghci
can no longer be supported on this platform. In this MR we:--enable-library-for-ghci
into an error on platforms where it is not supported.Cabal
to usellvm-ar
'sL
modifier when available, which is now necessary when building static archives on Windows (since the archive may contain other archives, as noted in GHC #21068)Please include the following checklist in your PR:
Please also shortly describe how you tested your change. Bonus points for added tests!