Skip to content
This repository has been archived by the owner on Feb 3, 2022. It is now read-only.

Quickcheck does not work out of the box. #285

Closed
alcides opened this issue Sep 22, 2017 · 8 comments
Closed

Quickcheck does not work out of the box. #285

alcides opened this issue Sep 22, 2017 · 8 comments

Comments

@alcides
Copy link

alcides commented Sep 22, 2017

Installed through: brew cask install haskell-platform.

import Test.QuickCheck

does not work out of the box. GHC shows the following error:

exercicios-201617.lhs:6:3: error:
Could not find module ‘Test.QuickCheck’
Use -v to see a list of the files searched for.
|
6 | > import Test.QuickCheck
| ^^^^^^^^^^^^^^^^^^^^^^

exercicios-201617.lhs:7:3: error:
Could not find module ‘Test.QuickCheck.Gen’
Use -v to see a list of the files searched for.
|
7 | > import Test.QuickCheck.Gen -- ungen
| ^^^^^^^^^^^^^^^^^^^^^^^^^^

When executed with -v5, it shows:

exercicios-201617.lhs:6:3: error:
Could not find module ‘Test.QuickCheck’
Locations searched:
Test/QuickCheck.hs
Test/QuickCheck.lhs
Test/QuickCheck.hsig
Test/QuickCheck.lhsig
|
6 | > import Test.QuickCheck
| ^^^^^^^^^^^^^^^^^^^^^^

exercicios-201617.lhs:7:3: error:
Could not find module ‘Test.QuickCheck.Gen’
Locations searched:
Test/QuickCheck/Gen.hs
Test/QuickCheck/Gen.lhs
Test/QuickCheck/Gen.hsig
Test/QuickCheck/Gen.lhsig
|
7 | > import Test.QuickCheck.Gen -- ungen
| ^^^^^^^^^^^^^^^^^^^^^^^^^^

and

haddock-interfaces: /Library/Haskell/ghc-8.2.1-x86_64/lib/zlib-0.6.1.2/doc/html/zlib.haddock
haddock-html: /Library/Haskell/ghc-8.2.1-x86_64/lib/zlib-0.6.1.2/doc/html
package flags []
loading package database /Library/Frameworks/GHC.framework/Versions/8.2.1-x86_64/usr/lib/ghc-8.2.1/package.conf.d
package GLURaw-2.0.0.3-8JLLoTDEv9VB0E4RGuuu22 is unusable due to shadowed dependencies:
OpenGLRaw-3.2.5.0-AGBjdECXAdpBqRpkvHo1D1
package GLUT-2.7.0.12-6EAG9rnuF10HeWK97rVsdr is unusable due to shadowed dependencies:
StateVar-1.1.0.4-LujcYvYAkps2n0ooX2fxnO OpenGL-3.0.2.0-HD761o8mqKO1GjV1UDm6ix
package HTTP-4000.3.7-FyFkOPpSucw73jWgAX6vWY is unusable due to shadowed dependencies:
parsec-3.1.11-DPgnR92AWEaFOaixmwipet mtl-2.2.1-19EL8AGBsN3DnnOhrC9xY3 network-uri-2.6.1.0-8fmDUfTamRDELKGV9jMzo3 network-2.6.3.2-8o5F7G3DMrLGgmHkPzZYJx
package HUnit-1.6.0.0-4l1U6BLkB471ERiSTXOjLi is unusable due to shadowed dependencies:
call-stack-0.1.0-9jal1kz08FU8PWnIBPoZ86
package OpenGL-3.0.2.0-HD761o8mqKO1GjV1UDm6ix is unusable due to shadowed dependencies:
text-1.2.2.2-EGUst8sqNAZCw1xLPcmcMH ObjectName-1.1.0.1-9TjFIQDc3nwAGCLQ6K0uBK StateVar-1.1.0.4-LujcYvYAkps2n0ooX2fxnO OpenGLRaw-3.2.5.0-AGBjdECXAdpBqRpkvHo1D1 GLURaw-2.0.0.3-8JLLoTDEv9VB0E4RGuuu22
package OpenGLRaw-3.2.5.0-AGBjdECXAdpBqRpkvHo1D1 is unusable due to shadowed dependencies:
fixed-0.2.1.1-8TAIwVfklKaFZqU07AJe1c half-0.2.2.3-5sZk4UblOHkKgVoM6yhxhd text-1.2.2.2-EGUst8sqNAZCw1xLPcmcMH
package QuickCheck-2.10.0.1-DTIBC3CyU6p3h4xSnOjkg1 is unusable due to shadowed dependencies:
random-1.1-DtLcP2Z2iOOC0RwcSmXjBK tf-random-0.5-ABDhxe3mXYlHUEE5hzgewx
package StateVar-1.1.0.4-LujcYvYAkps2n0ooX2fxnO is unusable due to shadowed dependencies:
stm-2.4.4.1-2iQ3ZIiQ6vc4AnCVcs8oMd
package async-2.1.1.1-B1zjaWD98Sd3roiQTopWAE is unusable due to shadowed dependencies:
stm-2.4.4.1-2iQ3ZIiQ6vc4AnCVcs8oMd
package attoparsec-0.13.2.0-5dp4kBDsiGY4dQpLKbD5rk is unusable due to shadowed dependencies:
scientific-0.3.5.1-L0qYzdp0wpz8rO8gircNSR text-1.2.2.2-EGUst8sqNAZCw1xLPcmcMH
package case-insensitive-1.2.0.10-7uZ9WdL3zeIK7zYotLnvd1 is unusable due to shadowed dependencies:
text-1.2.2.2-EGUst8sqNAZCw1xLPcmcMH hashable-1.2.6.1-14fEJP30YhAG9w115PODz0
package hashable-1.2.6.1-14fEJP30YhAG9w115PODz0 is unusable due to shadowed dependencies:
text-1.2.2.2-EGUst8sqNAZCw1xLPcmcMH
package haskell-src-1.0.2.0-8c0DGwjdWsJJvtDKsTwa50 is unusable due to shadowed dependencies:
syb-0.7-2rRPTNxBP6YFePrCXw4i2o
package network-uri-2.6.1.0-8fmDUfTamRDELKGV9jMzo3 is unusable due to shadowed dependencies:
parsec-3.1.11-DPgnR92AWEaFOaixmwipet
package parsec-3.1.11-DPgnR92AWEaFOaixmwipet is unusable due to shadowed dependencies:
mtl-2.2.1-19EL8AGBsN3DnnOhrC9xY3 text-1.2.2.2-EGUst8sqNAZCw1xLPcmcMH
package regex-base-0.93.2-6R4SyH615Fd96n1BuXT5nY is unusable due to shadowed dependencies:
mtl-2.2.1-19EL8AGBsN3DnnOhrC9xY3
package regex-compat-0.95.1-8fXRfZk39z47p2j5rS3E9Q is unusable due to shadowed dependencies:
regex-base-0.93.2-6R4SyH615Fd96n1BuXT5nY regex-posix-0.95.2-CqFmfrcIyQF7PY3RsTZcGI
package regex-posix-0.95.2-CqFmfrcIyQF7PY3RsTZcGI is unusable due to shadowed dependencies:
regex-base-0.93.2-6R4SyH615Fd96n1BuXT5nY
package scientific-0.3.5.1-L0qYzdp0wpz8rO8gircNSR is unusable due to shadowed dependencies:
integer-logarithms-1.0.2-VAUswqHa2j8Wo9H471XH1 text-1.2.2.2-EGUst8sqNAZCw1xLPcmcMH hashable-1.2.6.1-14fEJP30YhAG9w115PODz0 primitive-0.6.2.0-V0ibjLQDdN6fcQS5bjLVg
package tf-random-0.5-ABDhxe3mXYlHUEE5hzgewx is unusable due to shadowed dependencies:
primitive-0.6.2.0-V0ibjLQDdN6fcQS5bjLVg random-1.1-DtLcP2Z2iOOC0RwcSmXjBK
package unordered-containers-0.2.8.0-HVcKYx0GQoVIIbKuoCcJbx is unusable due to shadowed dependencies:
hashable-1.2.6.1-14fEJP30YhAG9w115PODz0
package vector-0.12.0.1-6mmeV84KOvJADXavl6mOiY is unusable due to shadowed dependencies:
primitive-0.6.2.0-V0ibjLQDdN6fcQS5bjLVg

Is there any reason why so many packages are shadowed? Including QuichCheck, which I am unable to use despite being installed.

The list of installed packages:

$ ghc-pkg list
/Library/Frameworks/GHC.framework/Versions/8.2.1-x86_64/usr/lib/ghc-8.2.1/package.conf.d
Cabal-2.0.0.2
GLURaw-2.0.0.3
GLUT-2.7.0.12
HTTP-4000.3.7
HUnit-1.6.0.0
ObjectName-1.1.0.1
OpenGL-3.0.2.0
OpenGLRaw-3.2.5.0
QuickCheck-2.10.0.1
StateVar-1.1.0.4
array-0.5.2.0
async-2.1.1.1
attoparsec-0.13.2.0
base-4.10.0.0
binary-0.8.5.1
bytestring-0.10.8.2
call-stack-0.1.0
case-insensitive-1.2.0.10
containers-0.5.10.2
deepseq-1.4.3.0
directory-1.3.0.2
fgl-5.6.0.0
filepath-1.4.1.2
fixed-0.2.1.1
ghc-8.2.1
ghc-boot-8.2.1
ghc-boot-th-8.2.1
ghc-compact-0.1.0.0
ghc-prim-0.5.1.0
ghci-8.2.1
half-0.2.2.3
hashable-1.2.6.1
haskeline-0.7.4.0
haskell-src-1.0.2.0
hoopl-3.10.2.2
hpc-0.6.0.3
hscolour-1.24.1
html-1.0.1.2
integer-gmp-1.0.1.0
integer-logarithms-1.0.2
mtl-2.2.1
network-2.6.3.2
network-uri-2.6.1.0
parallel-3.2.1.1
parsec-3.1.11
pretty-1.1.3.3
primitive-0.6.2.0
process-1.6.1.0
random-1.1
regex-base-0.93.2
regex-compat-0.95.1
regex-posix-0.95.2
rts-1.0
scientific-0.3.5.1
split-0.2.3.2
stm-2.4.4.1
syb-0.7
template-haskell-2.12.0.0
terminfo-0.4.1.0
text-1.2.2.2
tf-random-0.5
time-1.8.0.2
transformers-0.5.2.0
unix-2.7.2.2
unordered-containers-0.2.8.0
vector-0.12.0.1
xhtml-3000.2.2
zlib-0.6.1.2

Only the default packages of the Haskell Platform should be there.

@gbaz
Copy link
Contributor

gbaz commented Sep 22, 2017

The shadowed dependencies issue is intermittent and hard to track down. We think this is upstream and not platform specific, likely tracked by: haskell/cabal#4728

@gbaz gbaz closed this as completed Sep 22, 2017
@treblacy
Copy link

treblacy commented Oct 6, 2017

No this is totally specific to some builds of Haskell Platform.

I don't have Mac, but I have Linux, and you should try the following with the Mac version: Use the full (not core) version, perhaps best with a fresh install for minimum doubt:

  1. ghc -v to see you already have mucho shadowing error messages.

  2. ghc-pkg field vector abi-depends

    The oddity is "primitive-...=inplace" compared to normal examples like "base-...=hexstring".

The hexstring is an ABI hash; "base-...=hexstring" means the hexstring is the ABI hash of base that Cabal found when building vector. If vector's abi-depends has this entry, then during use-time, GHC will actually check it against the current actual hash (ghc-pkg field base abi). "inplace" is not going to match the current actual hash of primitive. This is why GHC says it can't find the right primitive for vector. Similarly for other packages.

"inplace" is supposed to refer to an intermediate Cabal state. Normal default Cabal operations don't leak it out into final products. I know a manual way of going out of your way to achieve it, but it sounds crazy that you guys would do it at all; however I can't think of a better explanation.

The Windows full version doesn't have this problem, but only because it doesn't even have the abi-depends field for GHC to check. This is probably because the Windows version was built by Cabal 1.x which didn't make this field.

@gbaz
Copy link
Contributor

gbaz commented Oct 6, 2017

I do see you've verified this on the linux tarball. @dagit can you comment?

@gbaz
Copy link
Contributor

gbaz commented Oct 6, 2017

(I suspect that the linux tarball may have been built with the cabal with the bug in the linked ticket, which could account for this...)

@gbaz
Copy link
Contributor

gbaz commented Oct 6, 2017

Whoops. deleted an above misinformed comment. I cracked open the pkg directly and see some =inplace registrations. I will investigate further.

@gbaz gbaz reopened this Oct 6, 2017
@gbaz
Copy link
Contributor

gbaz commented Oct 6, 2017

The (or a) problem is indeed with some builds of the platform, created with cabal 2.0. In particular this generated, as @treblacy pointed out, inplace abis where they should not have been. This is because, for reasons obscure to me, we did exactly what @treblacy thought was nuts, which is explicitly asked to use them! I think this must have made some sense some time ago when inplace things had no abi hash generated, but of course broke terribly with cabal 2.0.

See commit 669e8ab which appears to fix this.

This issue should only have affected full builds of the platform on mac and linux. I'll try to have some new builds out soon.

@gbaz
Copy link
Contributor

gbaz commented Oct 6, 2017

A new mac build is out. New linux build hopefully soon.

@gbaz
Copy link
Contributor

gbaz commented Nov 23, 2017

The new release indeed came out shortly after, just didn't close this issue.

The underlying cause should be fixed properly by #293

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants