Haskell after install the conduit package

301 Views Asked by At

I`m new in the Haskell and do the task for my class. I install it in VSCode, downloaded the extension for it and everything works fine. But after installing the Conduit library I get this error:

ghc-9.4.7.exe: C:\cabal\store\ghc-9.4.7\hashable-1.4.3.0-1961fe79003fd705645c177b7f4aca0399a4d276\lib\libHShashable-1.4.3.0-1961fe79003fd705645c177b7f4aca0399a4d276.a(#7:LowLevel.o): Not a x86_64 PE+ file.
    ghc-9.4.7.exe: Unknown COFF 4 type in getHeaderInfo.
    panic! (the 'impossible' happened)
      GHC version 9.4.7:
            loadArchive "C:\\cabal\\store\\ghc-9.4.7\\hashable-1.4.3.0-1961fe79003fd705645c177b7f4aca0399a4d276\\lib\\libHShashable-1.4.3.0-1961fe79003fd705645c177b7f4aca0399a4d276.a": failed

Please report this as a GHC bug:  https://www.haskell.org/ghc/reportabug

Can you help me with it? Thank you in advance)

2

There are 2 best solutions below

4
On

(Not an Answer) I have the same problem on Windows 10. I just did a fresh (and first time) install of GHCup following all the default instructions from the page https://www.haskell.org/ghcup/

Then I started following the First steps instruction from https://www.haskell.org/ghcup/steps/ (Yes I'm new too...)

But everything starts to slip when I reached the section: Using external packages in ghci

Trying the cabal-install command: cabal repl --build-depends asyn I ended up with the following:

I:\DevData\Haskell\test-cabal>cabal repl --build-depends async
Resolving dependencies...
Build profile: -w ghc-9.4.7 -O1
In order, the following will be built (use -v for more details):
 - hashable-1.4.3.0 (lib) (requires build)
 - async-2.2.4 (lib) (requires build)
 - test-cabal-0.1.0.0 (lib) (first run)
Starting     hashable-1.4.3.0 (lib)
Building     hashable-1.4.3.0 (lib)
Installing   hashable-1.4.3.0 (lib)
Completed    hashable-1.4.3.0 (lib)
Starting     async-2.2.4 (lib)
Building     async-2.2.4 (lib)
Installing   async-2.2.4 (lib)
Completed    async-2.2.4 (lib)
Configuring library for test-cabal-0.1.0.0..
Preprocessing library for test-cabal-0.1.0.0..
GHCi, version 9.4.7: https://www.haskell.org/ghc/  :? for help
ghc-9.4.7.exe: C:\cabal\store\ghc-9.4.7\hashable-1.4.3.0-81e2a757c5dbeba1fc866065cf8206ee339e1961\lib\libHShashable-1.4.3.0-81e2a757c5dbeba1fc866065cf8206ee339e1961.a(#7:LowLevel.o): Not a x86_64 PE+ file.
ghc-9.4.7.exe: Unknown COFF 4 type in getHeaderInfo.
panic! (the 'impossible' happened)
  GHC version 9.4.7:
        loadArchive "C:\\cabal\\store\\ghc-9.4.7\\hashable-1.4.3.0-81e2a757c5dbeba1fc866065cf8206ee339e1961\\lib\\libHShashable-1.4.3.0-81e2a757c5dbeba1fc866065cf8206ee339e1961.a": failed

Please report this as a GHC bug:  https://www.haskell.org/ghc/reportabug

cabal-3.6.2.0.exe: repl failed for test-cabal-0.1.0.0.

I:\DevData\Haskell\test-cabal>cabal --version
cabal-install version 3.6.2.0
compiled using version 3.6.2.0 of the Cabal library

Issue obviously seems to come from the hashable-1.4.3.0 module (not a x86_64 PE+ file) in both case.

0
On

I had the same issue and fix it with flowing:

1) Install hshashable and conduit

cabal install hashable  
cabal install conduit

Then for using conduit in GHCi run:

cabal install --lib hashable
cabal install --lib conduit

2) In case version issue Check GHCi and Cabal versions: enter image description here enter image description here

https://www.haskell.org/cabal/download.html enter image description here For update cabal use command:

ghcup install cabal 3.8.1.0