xmonad / xmonad-contrib

Contributed modules for xmonad
https://xmonad.org
BSD 3-Clause "New" or "Revised" License
579 stars 272 forks source link

build errors with ghc-9.6.1 (wrong/redundant imports) #805

Closed jwaldmann closed 1 year ago

jwaldmann commented 1 year ago

Hi. I am trying cabal install --allow-newer=base --lib with ghc-9.6.1, and I am getting errors due to some exports moving (from Prelude to Control.Monad?). I see that you don't have 9.6 in the CI matrix, so perhaps it's too early. On the other hand, I saw that xmonad/master (not published on hackage) is build-able with 9.6. (NB: I should stay on 9.4 for a while, but I am thinking, if no-one's testing 9.6, then GHC HQ will quickly release 9.8, 9.10, ...)

[ 12 of 310] Compiling XMonad.Actions.CycleRecentWS ( XMonad/Actions/CycleRecentWS.hs, dist/build/XMonad/Actions/CycleRecentWS.o, dist/build/XMonad/Actions/CycleRecentWS.dyn_o )

XMonad/Actions/CycleRecentWS.hs:47:35: error:
    Module ‘Control.Monad.State’ does not export ‘when’
   |
47 | import Control.Monad.State (lift, when)
   |                                   ^^^^

...
[ 92 of 310] Compiling XMonad.Actions.MessageFeedback ( XMonad/Actions/MessageFeedback.hs, dist/build/XMonad/Actions/MessageFeedback.o, dist/build/XMonad/Actions/MessageFeedback.dyn_o )

XMonad/Actions/MessageFeedback.hs:50:39: warning: [-Wunused-imports]
    The import of ‘liftA2’ from module ‘XMonad.Prelude’ is redundant
   |
50 | import XMonad.Prelude       ( isJust, liftA2, void )
   |                                       ^^^^^^
...
[105 of 310] Compiling XMonad.Hooks.DebugEvents ( XMonad/Hooks/DebugEvents.hs, dist/build/XMonad/Hooks/DebugEvents.o, dist/build/XMonad/Hooks/DebugEvents.dyn_o )

XMonad/Hooks/DebugEvents.hs:36:1: warning: [-Wunused-imports]
    The import of ‘Control.Monad.Fail’ is redundant
      except perhaps to import instances from ‘Control.Monad.Fail’
    To import instances alone, use: import Control.Monad.Fail()
   |
36 | import           Control.Monad.Fail
   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
...
[138 of 310] Compiling XMonad.Actions.MostRecentlyUsed ( XMonad/Actions/MostRecentlyUsed.hs, dist/build/XMonad/Actions/MostRecentlyUsed.o, dist/build/XMonad/Actions/MostRecentlyUsed.dyn_o )

XMonad/Actions/MostRecentlyUsed.hs:40:1: warning: [-Wunused-imports]
    The import of ‘Control.Applicative’ is redundant
      except perhaps to import instances from ‘Control.Applicative’
    To import instances alone, use: import Control.Applicative()
   |
40 | import Control.Applicative (liftA2)
   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
...

(and more instances of these)

liskin commented 1 year ago

It's definitely our intention to add 9.6 to the CI matrix ASAP, it's just life that keeps interfering 🙂

slotThe commented 1 year ago

Now that setlocale got revbumped, I've added 9.6.1 to the CI.

@jwaldmann contrib should now at least build on 9.6 if you specify --allow-newer=base. All that's left is to cherry-pick the relevant commits, and release 0.17.2 on Hackage.

slotThe commented 1 year ago

Oh, interesting, xmonad-contrib 0.17.1 builds for me with 9.6. The changes that made HEAD break were only introduced after the release, which would mean we only have to release xmonad 0.17.2. @jwaldmann can you confirm?

jwaldmann commented 1 year ago

yes, I can cabal install --lib for 635711e994a2aad75fe70dc148e9232d1f86e608

slotThe commented 1 year ago

Closing in tandem with https://github.com/xmonad/xmonad/issues/443

l29ah commented 11 months ago

https://hackage.haskell.org/package/xmonad-contrib no new releases here, why did you close it?

liskin commented 11 months ago

https://hackage.haskell.org/package/xmonad-contrib no new releases here, why did you close it?

https://github.com/xmonad/xmonad-contrib/issues/805#issuecomment-1487343399 says that the latest release builds with 9.6 fine and therefore new release isn't strictly necessary. Is that not the case?

l29ah commented 11 months ago

Building xmonad-contrib-0.17.1 with ghc-9.6.2 results in this for me:

[ 72 of 308] Compiling XMonad.Hooks.WorkspaceByPos ( XMonad/Hooks/WorkspaceByPos.hs, dist/build/XMonad/Hooks/WorkspaceByPos.o, dist/build/XMonad/Hooks/WorkspaceByPos.dyn_o )

XMonad/Hooks/WorkspaceByPos.hs:29:30: error:
    Module ‘Control.Monad.Except’ does not export ‘lift’
   |
29 | import Control.Monad.Except (lift, runExceptT, throwError)
   |                              ^^^^
[119 of 308] Compiling XMonad.Util.PureX ( XMonad/Util/PureX.hs, dist/build/XMonad/Util/PureX.o, dist/build/XMonad/Util/PureX.dyn_o )

XMonad/Util/PureX.hs:153:10: error: [GHC-88464]
    Variable not in scope: void :: X Any -> X ()
    Suggested fix:
      Perhaps you want to add ‘void’ to the import list in the import of
      ‘XMonad.Prelude’ (XMonad/Util/PureX.hs:56:1-54).
    |
153 | defile = void . windowBracket' getAny
    |          ^^^^

XMonad/Util/PureX.hs:197:15: error: [GHC-88464]
    Variable not in scope: join :: f0 (m a) -> m a
    Suggested fix:
      Perhaps you want to add ‘join’ to the import list in the import of
      ‘XMonad.Prelude’ (XMonad/Util/PureX.hs:56:1-54).
    |
197 | withFocii f = join $ (whenJust' <$> peek) <*> (f <$> curTag)
    |               ^^^^
geekosaur commented 11 months ago

FWIW I get no errors or warnings with xmonad-contrib-0.17.1 and ghc 9.6.2.

liskin commented 11 months ago

Those aren't GHC 9.6 issues. Those are mtl 2.3 issues, and the deps of xmonad-contrib 0.17.1 were revised to disallow mtl 2.3: https://hackage.haskell.org/package/xmonad-contrib-0.17.1/revisions/ But yeah, it's a good argument for pushing a release I suppose.

slotThe commented 11 months ago

I wouldn't be opposed to doing a release soon (a lot has changed!), but—as others have said—this should have been resolved by the revbump

geekosaur commented 11 months ago

It sounds like they downloaded the tarball from Hackage so they could build offline? But Hackage has this weird immutability thing, you need to manually look for and download the latest revision cabal file (there's a link but it's not that obvious) because it never updates an artifact once uploaded.