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

Bump mtl and transformer bounds (fixes #8144) #8149

Closed
wants to merge 1 commit into from

Conversation

Mikolaj
Copy link
Member

@Mikolaj Mikolaj commented May 19, 2022

Fixes #8144.

@Mikolaj
Copy link
Member Author

Mikolaj commented May 19, 2022

[Edit: we managed to find an error, so let's put this on hold until the ecosystem catches up or we manage to determine additional deps to bump. See comments below.]

Anybody? If nobody wants to review, I'd just merge, because there is not much to review and the changes probably don't have any effect until GHC 9.4 and won't show in CI until hackage-security is updated, anyway.

@fgaz
Copy link
Member

fgaz commented May 19, 2022

Does it at least build with appropriate --constraint and --allow-newer flags?

@Mikolaj
Copy link
Member Author

Mikolaj commented May 19, 2022

@fgaz: you were right, this was worth trying and we did get an early error:

I tried cabal build --project-file=cabal.project.mine cabal-install --constraint "transformers >=0.6" --constraint "mtl >=2.3" --allow-newer --constraint "happy >=1.21.0" and it seems I can't transitively constrain happy that is used as a tool in another package (one of the test harnesses, probably) (and I'm not sure happy 1.21 would compile, but worth trying):

Building executable 'happy' for happy-1.20.0..
[ 1 of 19] Compiling AbsSyn           ( src/AbsSyn.lhs, dist/build/happy/happy-tmp/AbsSyn.o )
[ 2 of 19] Compiling GenUtils         ( src/GenUtils.lhs, dist/build/happy/happy-tmp/GenUtils.o )
[ 3 of 19] Compiling NameSet          ( src/NameSet.hs, dist/build/happy/happy-tmp/NameSet.o )
[ 4 of 19] Compiling ParamRules       ( src/ParamRules.hs, dist/build/happy/happy-tmp/ParamRules.o )

src/ParamRules.hs:41:17: error:
    Not in scope: type constructor or class ‘ExceptT’
   |
41 | type M2       = ExceptT String M1
   |                 ^^^^^^^

src/ParamRules.hs:81:10: error:
    Not in scope: type constructor or class ‘ExceptT’
   |
81 | runM2 :: ExceptT e (Writer w) a -> Either e (a, w)
   |          ^^^^^^^
Error: cabal: Failed to build exe:happy from happy-1.20.0 (which is required
by test:long-tests from cabal-install-3.7.0.0). See the build log above for
details.

@Mikolaj Mikolaj marked this pull request as draft May 19, 2022 12:44
@Mikolaj
Copy link
Member Author

Mikolaj commented May 19, 2022

Any help would be welcome, BTW. :)

@Mikolaj Mikolaj added the attention: needs-help Help wanted with this issue/PR label May 19, 2022
@andreasabel
Copy link
Member

andreasabel commented May 19, 2022

The export of ExceptT is missing from mtl-2.3 in error:

I expect a patch on hackage soon.

The idea that testing with mtl-2.3 RC3 should be sufficient to go through with mtl-2.3, but this is now not true. Hopefully with the patched version.

@Mikolaj
Copy link
Member Author

Mikolaj commented May 19, 2022

Wow, good to know. Thanks.

@Mikolaj Mikolaj force-pushed the master branch 2 times, most recently from 3a20c7c to 9be49fc Compare May 23, 2022 12:47
@ulysses4ever
Copy link
Collaborator

Is there a plan for this? What is it waiting for?

@Mikolaj
Copy link
Member Author

Mikolaj commented Jun 8, 2022

It was waiting for a fix to mtl. Is is it ready now?

@ulysses4ever
Copy link
Collaborator

Right… I was under the impression that the patch was out (and it was), but it turned out that there’s no release yet… Okay, waiting some more.

@Mikolaj Mikolaj force-pushed the master branch 2 times, most recently from f55ae05 to 9be49fc Compare July 7, 2022 20:12
@Mikolaj
Copy link
Member Author

Mikolaj commented Jul 21, 2022

@mergify rebase

@mergify
Copy link
Contributor

mergify bot commented Jul 21, 2022

rebase

✅ Branch has been successfully rebased

@Mikolaj
Copy link
Member Author

Mikolaj commented Jul 21, 2022

Apparently, happy has been changed not to use the new broken mtl and so compiles fine (using the old mtl) and now have some new errors. The errors for hackage-security are expected and should vanish once mtl is fixed, but the other set seems unrelated and worth investigating if somebody has moment.

~/r/cabal$ cabal build --project-file=cabal.project.mine cabal-install --constraint "transformers >=0.6" --constraint "mtl >=2.3" --allow-newer --constraint "happy >=1.21.0"
Resolving dependencies...
Build profile: -w ghc-9.2.3 -O0
In order, the following will be built (use -v for more details):
 - transformers-0.6.0.4 (lib) (requires build)
 - mtl-2.3 (lib) (requires build)
 - random-1.2.1.1 (lib) (requires build)
 - parsec-3.1.15.1 (lib) (requires build)
 - exceptions-0.10.5 (lib) (requires build)
 - edit-distance-0.2.2.1 (lib) (requires build)
 - network-uri-2.6.4.1 (lib) (requires build)
 - Cabal-syntax-3.7.0.0 (lib) (first run)
 - safe-exceptions-0.1.7.3 (lib) (requires build)
 - HTTP-4000.4.1 (lib) (requires build)
 - Cabal-3.7.0.0 (lib) (first run)
 - hackage-security-0.6.2.1 (lib) (configuration changed)
 - cabal-install-solver-3.7.0.0 (lib) (first run)
 - cabal-install-3.7.0.0 (lib) (first run)
 - cabal-install-3.7.0.0 (exe:cabal) (first run)
Starting     transformers-0.6.0.4 (lib)
...
[ 9 of 43] Compiling Hackage.Security.Util.Exit ( src/Hackage/Security/Util/Exit.hs, /home/mikolaj/r/cabal/dist-newstyle/build/x86_64-linux/ghc-9.2.3/hackage-security-0.6.2.1/build/Hackage/Security/Util/Exit.o, /home/mikolaj/r/cabal/dist-newstyle/build/x86_64-linux/ghc-9.2.3/hackage-security-0.6.2.1/build/Hackage/Security/Util/Exit.dyn_o ) [Control.Monad.Except changed]

src/Hackage/Security/Util/Exit.hs:32:34: error:
    Not in scope: type constructor or class ‘ExceptT’
   |
32 | multipleExitPoints :: Monad m => ExceptT a m a -> m a
   |                                  ^^^^^^^

src/Hackage/Security/Util/Exit.hs:40:25: error:
    Not in scope: type constructor or class ‘ExceptT’
   |
40 | exit :: Monad m => e -> ExceptT e m a
   |                         ^^^^^^^
...
[28 of 50] Compiling Distribution.Solver.Modular.Linking ( src/Distribution/Solver/Modular/Linking.hs, /home/mikolaj/r/cabal/dist-newstyle/build/x86_64-linux/ghc-9.2.3/cabal-install-solver-3.7.0.0/noopt/build/Distribution/Solver/Modular/Linking.o, /home/mikolaj/r/cabal/dist-newstyle/build/x86_64-linux/ghc-9.2.3/cabal-install-solver-3.7.0.0/noopt/build/Distribution/Solver/Modular/Linking.dyn_o )

src/Distribution/Solver/Modular/Linking.hs:245:10: error:
    • Variable not in scope:
        zipWithM_
          :: (FlaggedDep QPN -> FlaggedDep QPN -> UpdateState ())
             -> FlaggedDeps QPN -> FlaggedDeps QPN -> UpdateState ()
    • Perhaps you meant one of these:
        ‘zipWith’ (imported from Distribution.Solver.Compat.Prelude),
        ‘zipWith3’ (imported from Distribution.Solver.Compat.Prelude)
    |
245 |     go = zipWithM_ go1
    |          ^^^^^^^^^

src/Distribution/Solver/Modular/Linking.hs:306:5: error:
    • Variable not in scope:
        forM_
          :: [PackagePath]
             -> (PackagePath -> UpdateState ()) -> UpdateState ()
    • Perhaps you meant one of these:
        ‘for_’ (imported from Distribution.Solver.Compat.Prelude),
        ‘T.forM’ (imported from Data.Traversable)
    |
306 |     forM_ (S.toList linkedTo) $ \pp' -> linkDeps (Q pp' pn) newDeps
    |     ^^^^^

src/Distribution/Solver/Modular/Linking.hs:353:9: error:
    • Variable not in scope:
        forM_ :: [Flag] -> (Flag -> UpdateState ()) -> UpdateState a0
    • Perhaps you meant one of these:
        ‘for_’ (imported from Distribution.Solver.Compat.Prelude),
        ‘T.forM’ (imported from Data.Traversable)
    |
353 |         forM_ flags $ \fn -> do
    |         ^^^^^

src/Distribution/Solver/Modular/Linking.hs:356:9: error:
    • Variable not in scope:
        forM_
          :: [OptionalStanza] -> (Stanza -> UpdateState ()) -> UpdateState ()
    • Perhaps you meant one of these:
        ‘for_’ (imported from Distribution.Solver.Compat.Prelude),
        ‘T.forM’ (imported from Data.Traversable)
    |
356 |         forM_ stanzas $ \sn -> do
    |         ^^^^^

@andreasabel
Copy link
Member

andreasabel commented Jul 21, 2022

The way to fix the errors not involving ExceptT, e.g.

• Variable not in scope:
zipWithM_

is to add import Control.Monad but then also import from the mtl modules Control.Monad.* explicitly, so as to avoid annoying unused-import warnings when built with mtl < 2.3.

@mergify mergify bot added the merge delay passed Applied (usually by Mergify) when PR approved and received no updates for 2 days label Sep 1, 2022
@ulysses4ever ulysses4ever removed the merge delay passed Applied (usually by Mergify) when PR approved and received no updates for 2 days label Sep 3, 2022
@Mikolaj
Copy link
Member Author

Mikolaj commented Dec 24, 2022

Fixed in #8610.

@Mikolaj Mikolaj closed this Dec 24, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
attention: needs-help Help wanted with this issue/PR blocked: upstream
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Support transformers-0.6 and mtl-2.3
4 participants