Skip to content
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

Tests failed with vector 0.12.2.0 #969

Closed
felixonmars opened this issue Jan 31, 2021 · 5 comments
Closed

Tests failed with vector 0.12.2.0 #969

felixonmars opened this issue Jan 31, 2021 · 5 comments

Comments

@felixonmars
Copy link
Contributor

Running 4 test suites...
Test suite doctests: RUNNING...
/build/haskell-lens/src/lens-4.19.2/src/Control/Lens/Wrapped.hs:1334: failure in expression `ala Sum foldMap [1,2,3,4]'
expected: 10
 but got:
          ^
          <interactive>:1371:9: error:
              Ambiguous occurrence ‘foldMap’
              It could refer to
                 either ‘Foldable.foldMap’,
                        imported from ‘Data.Foldable’ at /build/haskell-lens/src/lens-4.19.2/src/Control/Lens/Wrapped.hs:123:1-42
                     or ‘Vector.foldMap’,
                        imported from ‘Data.Vector’ at /build/haskell-lens/src/lens-4.19.2/src/Control/Lens/Wrapped.hs:149:1-38
                     or ‘Unboxed.foldMap’,
                        imported from ‘Data.Vector.Unboxed’ at /build/haskell-lens/src/lens-4.19.2/src/Control/Lens/Wrapped.hs:151:1-47
                     or ‘Storable.foldMap’,
                        imported from ‘Data.Vector.Storable’ at /build/haskell-lens/src/lens-4.19.2/src/Control/Lens/Wrapped.hs:152:1-49
                     or ‘Prim.foldMap’,
                        imported from ‘Data.Vector.Primitive’ at /build/haskell-lens/src/lens-4.19.2/src/Control/Lens/Wrapped.hs:150:1-46

/build/haskell-lens/src/lens-4.19.2/src/Control/Lens/Wrapped.hs:1371: failure in expression `alaf Sum foldMap Prelude.length ["hello","world"]'
expected: 10
 but got:
          ^
          <interactive>:1379:10: error:
              Ambiguous occurrence ‘foldMap’
              It could refer to
                 either ‘Foldable.foldMap’,
                        imported from ‘Data.Foldable’ at /build/haskell-lens/src/lens-4.19.2/src/Control/Lens/Wrapped.hs:123:1-42
                     or ‘Vector.foldMap’,
                        imported from ‘Data.Vector’ at /build/haskell-lens/src/lens-4.19.2/src/Control/Lens/Wrapped.hs:149:1-38
                     or ‘Unboxed.foldMap’,
                        imported from ‘Data.Vector.Unboxed’ at /build/haskell-lens/src/lens-4.19.2/src/Control/Lens/Wrapped.hs:151:1-47
                     or ‘Storable.foldMap’,
                        imported from ‘Data.Vector.Storable’ at /build/haskell-lens/src/lens-4.19.2/src/Control/Lens/Wrapped.hs:152:1-49
                     or ‘Prim.foldMap’,
                        imported from ‘Data.Vector.Primitive’ at /build/haskell-lens/src/lens-4.19.2/src/Control/Lens/Wrapped.hs:150:1-46

Examples: 904  Tried: 899  Errors: 0  Failures: 2
@RyanGlScott
Copy link
Collaborator

Thanks for the bug report. I've applied Hackage revisions to every affected lens release such that their doctests test suites require vector < 0.12.2.

This bug isn't present on the master branch of lens by virtue of the fact that it has switched from doctest to cabal-docspec. Unlike doctest, which imports everything from each module's normal imports, cabal-docspec only imports things from $setup blocks, which means that we no longer import anything from Data.Vector.* when running the doctests for Control.Lens.Wrapped. As a result, there is no longer any ambiguity about which foldMap is being used in the doctests.

The only thing that remains to be done is to upload a version of lens to Hackage that uses cabal-docspec.

RyanGlScott added a commit that referenced this issue Jan 31, 2021
This makes errors like the ones observed in #969 less likely to occur
in the future.
RyanGlScott added a commit that referenced this issue Jan 31, 2021
This makes errors like the ones observed in #969 less likely to occur
in the future.
@phadej
Copy link
Collaborator

phadej commented Feb 17, 2021

@RyanGlScott this is fixed, isn't it? Just no release yet?

FWIW, master compiles with GHC-9.0 without need for head.hackage (you only need it for tests, but that should change soon too).

@RyanGlScott
Copy link
Collaborator

@RyanGlScott this is fixed, isn't it? Just no release yet?

Correct. Since #969 (comment) specifically mentions a Hackage version of lens, I was waiting until lens-5 was uploaded to Hackage before closing this issue.

FWIW, master compiles with GHC-9.0 without need for head.hackage (you only need it for tests, but that should change soon too).

Indeed. I was originally waiting until we updated our CI to support GHC 9.0.1 before uploading lens-5, but those efforts appear to have stalled on haskell-CI/haskell-ci#474. I've verified that all of the lens repo build and validates with GHC 9.0.1 now, so do you think we should just make a release now and update CI later?

@phadej
Copy link
Collaborator

phadej commented Feb 17, 2021

... validates with GHC 9.0.1 now, so do you think we should just make a release now and update CI later?

Yes, I'd go for it. (I made few GHC-9.0 compatible releases so as well, and also don't feel particularly nice of not having CI check for them, but I'd rather unblock people - e.g. edward who wants to use lens with GHC-9.0 :P )

@RyanGlScott
Copy link
Collaborator

Now that I've uploaded lens-5 to Hackage, we can finally close this.

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

No branches or pull requests

3 participants