-
Notifications
You must be signed in to change notification settings - Fork 843
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
Cabal/Stack does not distinguish powerpc64 and powerpc64le architectures #6379
Comments
Actually I don't have a workaround currently (unless there's some way to force it to proceed). |
I am testing a patch in Fedora Rawhide first: if that looks good I will open a PR later. |
Are you asking (via your snapshot) for a different version of GHC than your system provides? If so, you also need to specify |
What binary distributions of GHC would |
Unison requires lts-20.26 which is ghc-9.2.8 which is what I am pulling in through my rpm spec file. So AFAICT stack is (over)checking despite the system ghc satisfying the requirement. (Yes there are no upstream binaries for ppc64le or s390x, but I need to prevent stack choking - fixing/improving the logic would be better of course.) |
For completeness I tried with --no-install-ghc and additionally /usr/bin/ghc but then it fails with:
It looks to me like it is looking for Big-endian ppc64 rather than Little-endian ppc64le, and hence failing. This may be why stack appears to work on s390x, since it is probably detected correctly. |
So okay thanks to this - I found a workaround:
Perhaps this issue should renamed "detect ppc64le correctly". |
I understand that the machine architecture is not 'detected', it is hard-coded into the |
how exactly does stack's detection work? |
@gbaz, Stack depends on |
You can detect endianness via #include <ghcautoconf.h>
isBigEndian :: Bool
#ifdef WORDS_BIGENDIAN
isBigEndian = True
#else
isBigEndian = False
#endif |
My instinct is that the 'cost' Stack having a different machine architecture schema to that of Cabal (the library) would outweigh the benefits, partly informed by Cabal's own Haddock documentation, namely:
The same documentation also states:
Presumably Cabal 'just does not care' about the difference between powerpc64 and powerpc64le because making sure the correct GHC is available is outwith Cabal's concerns - but it seems it would be helpful if Cabal did care in this instance. I am hoping my pull request haskell/cabal#9535 will be adopted (once I've ironed out the CI). |
The discussion at haskell/cabal#9535 has developed beyond Cabal and the endianness of PowerPC architectures and now encompasses GHC issue #24283. |
Perhaps I should open a separate issue, but I do feel stack is misbehaving anyway, if I tell it explicitly |
If you are passing EDIT: However, S-6362 is not an 'Stack tried to install' error; it is a 'you've asked for a version of GHC that is not available' error. EDIT2: So, if I experiment on my Windows system with:
I get the message:
The first warning is because The |
Okay but AFAICT the |
https://hackage.haskell.org/package/base-4.19.0.0/docs/System-Info.html#v:arch seems close to what is wanted, though a String |
That is correct. However, | soptsInstallIfMissing sopts -> do which has its origins in |
That is what Cabal is parsing. The 'problem' is that Cabal parses both -- | PowerPC 64-bit ABI
data PPC_64ABI
= ELF_V1 -- ^ PowerPC64
| ELF_V2 -- ^ PowerPC64 LE
deriving (Read, Show, Eq, Ord) ). A couple of things arose from a call with the Cabal developers: (1) they see fixing Cabal as a 'breaking change', so it will not happen before the next major version of Cabal; and (2) there is a sort-of-plan to see if (a version of) GHC's |
@mpilgrem did you consider the solution I posted #6379 (comment) You wouldn't create your own arch type, but complement it e.g. in a record type with an endianness field. |
@juhp, I suggest the following workaround. Configure Stack to use arch: ppc64le
system-ghc: false # Don't use GHC on the PATH
install-ghc: false # Don't try to install GHC Stack will then look for the desired version of GHC in a Assuming GHC 9.6.3, and that If one is not found there, Stack will currently complain and advise:
(I think that message and/or the message for S-1852 could be more informative.) The downside of the workaround is that Stack will warn that |
@hasufell, thanks for the advice. Given: (a) the existence of the (b) Stack will only automatically install GHC on Linux platforms for my preference is to stick with the current approach. |
Re #6379 Better information about manual installation
Re #6379 Introduce `notify-if-arch-unknown` configuration option
I am building Unison for Fedora (here) using stack.
Today seems the first time I used stack on ppc64le without setup of ghc.
So it fails for me with
Full build.log from https://copr.fedorainfracloud.org/coprs/petersen/unison/build/6759906/
Naively it feels like Stack.Setup is trying too hard here...
Well I have a workaround using my
stack-symlink-distro-ghc
script.However I would like to add PPC64 and S390X Linux in the Setup module,
I am guessing they should map to
linux-ppc64
andlinux-s390x
.Though in this case I already told stack to use the system ghc..
The text was updated successfully, but these errors were encountered: