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 lock, downgrade fourmolu to 0.11 #3797

Closed
wants to merge 3 commits into from

Conversation

cab404
Copy link

@cab404 cab404 commented Sep 8, 2023

Would be glad on some help getting nix packages building again. This fixes build for 9.4.6 (and actually bumps nixpkgs to include 9.4.6), alas that required downgrading fourmolu — without that I cannot resolve dependencies :(

@cab404 cab404 requested a review from georgefst as a code owner September 8, 2023 18:11
@michaelpj
Copy link
Collaborator

Sorry, I don't understand. Why would we downgrade fourmolu?

@brandonchinn178
Copy link
Contributor

@cab404 fourmolu 0.14 most definitely works for GHC 9.2+ 🙂 What exactly is the resolver issue? It's probably other dependencies that need to get bumped, as opposed to downgrading fourmolu

@cab404
Copy link
Author

cab404 commented Sep 12, 2023

If you try building it as is:
nix build .\#packages.x86_64-linux.haskell-language-server-94

warning: Git tree '/home/cab/data/cab/forks/haskell-language-server' is dirty
error: builder for '/nix/store/mq6i09rnkg632whvw6w21mr26rim7lsk-hls-fourmolu-plugin-2.2.0.0.drv' failed with exit code 1;
       last 10 log lines:
       > configureFlags: --verbose --prefix=/nix/store/6prjsr50gjdzkkfqajnc0m0jb3s4icp6-hls-fourmolu-plugin-2.2.0.0 --libdir=$prefix/lib/$compiler --libsubdir=$abi/$libname --with-gcc=gcc --package-db=/build/tmp.K6WG3uRFb9/package.conf.d --ghc-options=-j16 +RTS -A64M -RTS --disable-split-objs --disable-library-profiling --disable-profiling --enable-shared --disable-coverage --enable-static --disable-executable-dynamic --disable-tests --disable-benchmarks --enable-library-vanilla --disable-library-for-ghci --ghc-option=-split-sections --extra-lib-dirs=/nix/store/58zvgaag2sh39iqd0i78wis9npj676cb-ncurses-6.4/lib --extra-lib-dirs=/nix/store/df10ppbxbsc5xnyc1bsh4xra2vxq5dbb-libffi-3.4.4/lib --extra-lib-dirs=/nix/store/1qq748gdkykzykkxmi1kgpajnv27r92r-gmp-with-cxx-6.3.0/lib --extra-lib-dirs=/nix/store/zwx92rxwxd1y6yslljn2p14winw1l8w9-ghc-9.4.6/lib
       > Using Parsec parser
       > Warning: hls-fourmolu-plugin.cabal:52:21: Boolean values are case sensitive,
       > use 'True' or 'False'.
       > Configuring hls-fourmolu-plugin-2.2.0.0...
       > CallStack (from HasCallStack):
       >   withMetadata, called at libraries/Cabal/Cabal/src/Distribution/Simple/Utils.hs:370:14 in Cabal-3.8.1.0:Distribution.Simple.Utils
       > Error: Setup: Encountered missing or private dependencies:
       > fourmolu >=0.13 && <0.14
       >
       For full logs, run 'nix log /nix/store/mq6i09rnkg632whvw6w21mr26rim7lsk-hls-fourmolu-plugin-2.2.0.0.drv'.
error: 1 dependencies of derivation '/nix/store/6ghv59y6vlw5g5k2bqm7100hnv05hyi3-haskell-language-server-ghc9.4.6-2.2.0.0.drv' failed to build

@cab404
Copy link
Author

cab404 commented Sep 12, 2023

After patching in fourmolu 0.13 or 0.14:

warning: Git tree '/home/cab/data/cab/forks/haskell-language-server' is dirty
error: builder for '/nix/store/h154lfg0cad939h4gwmi7h6b352g2c33-fourmolu-0.14.0.0.drv' failed with exit code 1;
       last 10 log lines:
       > updateAutotoolsGnuConfigScriptsPhase
       > configuring
       > configureFlags: --verbose --prefix=/nix/store/zsbf30v549f98xfpjzgr47iwd3ydfqf6-fourmolu-0.14.0.0 --libdir=$prefix/lib/$compiler --libsubdir=$abi/$libname --with-gcc=gcc --package-db=/build/tmp.ZcFz9vEm7e/package.conf.d --ghc-options=-j16 +RTS -A64M -RTS --disable-split-objs --disable-library-profiling --disable-profiling --enable-shared --disable-coverage --enable-static --disable-executable-dynamic --disable-tests --disable-benchmarks --enable-library-vanilla --disable-library-for-ghci --ghc-option=-split-sections --extra-lib-dirs=/nix/store/58zvgaag2sh39iqd0i78wis9npj676cb-ncurses-6.4/lib --extra-lib-dirs=/nix/store/df10ppbxbsc5xnyc1bsh4xra2vxq5dbb-libffi-3.4.4/lib --extra-lib-dirs=/nix/store/1qq748gdkykzykkxmi1kgpajnv27r92r-gmp-with-cxx-6.3.0/lib
       > Using Parsec parser
       > Configuring fourmolu-0.14.0.0...
       > CallStack (from HasCallStack):
       >   withMetadata, called at libraries/Cabal/Cabal/src/Distribution/Simple/Utils.hs:370:14 in Cabal-3.8.1.0:Distribution.Simple.Utils
       > Error: Setup: Encountered missing or private dependencies:
       > Cabal-syntax >=3.10 && <3.11, ghc-lib-parser >=9.6 && <9.7
       >
       For full logs, run 'nix log /nix/store/h154lfg0cad939h4gwmi7h6b352g2c33-fourmolu-0.14.0.0.drv'.
error: 1 dependencies of derivation '/nix/store/c9pmj4w57n92f54g5i5ia00fvd67rch0-hls-fourmolu-plugin-2.2.0.0.drv' failed to build
error: 1 dependencies of derivation '/nix/store/aw3bkfbj6ax7jxgpzvz1zdj1ghn2sbsl-haskell-language-server-ghc9.4.6-2.2.0.0.drv' failed to build

@cab404
Copy link
Author

cab404 commented Sep 12, 2023

And, finally, after patching in Cabal-syntax and ghc-lib-parser:

warning: Git tree '/home/cab/data/cab/forks/haskell-language-server' is dirty
error: builder for '/nix/store/whrrshyciiv9afakdi62rqixin0prwz3-ghc-lib-parser-ex-9.4.0.0.drv' failed with exit code 1;
       last 10 log lines:
       > updateAutotoolsGnuConfigScriptsPhase
       > configuring
       > configureFlags: --verbose --prefix=/nix/store/qsnvxsqpph1mywlrkm2pyk6ngh1r8q6s-ghc-lib-parser-ex-9.4.0.0 --libdir=$prefix/lib/$compiler --libsubdir=$abi/$libname --with-gcc=gcc --package-db=/build/tmp.XhuXMypxjb/package.conf.d --ghc-options=-j16 +RTS -A64M -RTS --disable-split-objs --disable-library-profiling --disable-profiling --enable-shared --disable-coverage --enable-static --disable-executable-dynamic --enable-tests --disable-benchmarks --enable-library-vanilla --disable-library-for-ghci --ghc-option=-split-sections -f-auto --extra-lib-dirs=/nix/store/58zvgaag2sh39iqd0i78wis9npj676cb-ncurses-6.4/lib --extra-lib-dirs=/nix/store/df10ppbxbsc5xnyc1bsh4xra2vxq5dbb-libffi-3.4.4/lib --extra-lib-dirs=/nix/store/1qq748gdkykzykkxmi1kgpajnv27r92r-gmp-with-cxx-6.3.0/lib
       > Using Parsec parser
       > Configuring ghc-lib-parser-ex-9.4.0.0...
       > CallStack (from HasCallStack):
       >   withMetadata, called at libraries/Cabal/Cabal/src/Distribution/Simple/Utils.hs:370:14 in Cabal-3.8.1.0:Distribution.Simple.Utils
       > Error: Setup: Encountered missing or private dependencies:
       > ghc-lib-parser >=9.4 && <9.5
       >
       For full logs, run 'nix log /nix/store/whrrshyciiv9afakdi62rqixin0prwz3-ghc-lib-parser-ex-9.4.0.0.drv'.
error: 1 dependencies of derivation '/nix/store/h54n030rf4zykk6q7cmksvj5aphzc17w-stylish-haskell-0.14.4.0.drv' failed to build
error: 1 dependencies of derivation '/nix/store/7ya0v6k1482p6vq9dphzrg1gdx3jyp5j-hls-stylish-haskell-plugin-2.2.0.0.drv' failed to build
error: 1 dependencies of derivation '/nix/store/xg9llsdnn2f8z00py4yrbzpmsqm6zkjn-haskell-language-server-ghc9.4.6-2.2.0.0.drv' failed to build

@cab404
Copy link
Author

cab404 commented Sep 12, 2023

@michaelpj @brandonchinn178 Sorry for keeping you waiting for an answer~

@cab404
Copy link
Author

cab404 commented Sep 12, 2023

After you try overriding ghc-lib-parser-ex with nixpkgs packaging, you go onto iteratively blindly bumping ormolu and stylish-haskell.

      fourmolu = dontCheck (hself.callCabal2nix "fourmolu" inputs.fourmolu-013 {});
      Cabal-syntax = hsuper.Cabal-syntax_3_10_1_0;
      ghc-lib-parser-ex = hsuper.ghc-lib-parser-ex_9_6_0_1;
      ormolu = hsuper.ormolu_0_7_1_0;
      ghc-lib-parser = hsuper.ghc-lib-parser_9_6_2_20230523;
      stylish-haskell = appendConfigureFlag  hsuper.stylish-haskell_0_14_5_0 "-fghc-lib";

After all that you slam into the following:

haskell-language-server-ghc9.4.6> Configuration files installed in:
haskell-language-server-ghc9.4.6> /nix/store/3mrhnqrbfvipdvz331syg5gx7n4f5gwj-haskell-language-server-ghc9.4.6-2.2.0.0/etc
haskell-language-server-ghc9.4.6> No alex found
haskell-language-server-ghc9.4.6> Using ar found on system at:
haskell-language-server-ghc9.4.6> /nix/store/8zxgqm6d879hskwh5g1l4crysl01kdv0-binutils-2.40/bin/ar
haskell-language-server-ghc9.4.6> No c2hs found
haskell-language-server-ghc9.4.6> No cpphs found
haskell-language-server-ghc9.4.6> No doctest found
haskell-language-server-ghc9.4.6> Using gcc version 12.3.0 given by user at:
haskell-language-server-ghc9.4.6> /nix/store/v1wa8ysdv5lc516fbh25m8ysigwv1k20-gcc-wrapper-12.3.0/bin/gcc
haskell-language-server-ghc9.4.6> Using ghc version 9.4.6 found on system at:
haskell-language-server-ghc9.4.6> /nix/store/zwx92rxwxd1y6yslljn2p14winw1l8w9-ghc-9.4.6/bin/ghc
haskell-language-server-ghc9.4.6> Using ghc-pkg version 9.4.6 found on system at:
haskell-language-server-ghc9.4.6> /nix/store/zwx92rxwxd1y6yslljn2p14winw1l8w9-ghc-9.4.6/bin/ghc-pkg-9.4.6
haskell-language-server-ghc9.4.6> No ghcjs found
haskell-language-server-ghc9.4.6> No ghcjs-pkg found
haskell-language-server-ghc9.4.6> No greencard found
haskell-language-server-ghc9.4.6> Using haddock version 2.27.0 found on system at:
haskell-language-server-ghc9.4.6> /nix/store/zwx92rxwxd1y6yslljn2p14winw1l8w9-ghc-9.4.6/bin/haddock-ghc-9.4.6
haskell-language-server-ghc9.4.6> No happy found
haskell-language-server-ghc9.4.6> Using haskell-suite found on system at: haskell-suite-dummy-location
haskell-language-server-ghc9.4.6> Using haskell-suite-pkg found on system at: haskell-suite-pkg-dummy-location
haskell-language-server-ghc9.4.6> No hmake found
haskell-language-server-ghc9.4.6> Using hpc version 0.68 found on system at:
haskell-language-server-ghc9.4.6> /nix/store/zwx92rxwxd1y6yslljn2p14winw1l8w9-ghc-9.4.6/bin/hpc
haskell-language-server-ghc9.4.6> Using hsc2hs version 0.68.8 found on system at:
haskell-language-server-ghc9.4.6> /nix/store/zwx92rxwxd1y6yslljn2p14winw1l8w9-ghc-9.4.6/bin/hsc2hs
haskell-language-server-ghc9.4.6> Using hscolour version 1.24 found on system at:
haskell-language-server-ghc9.4.6> /nix/store/sjq43agrrxcbzrc08qspm12zc2fzzihg-hscolour-1.24.4/bin/HsColour
haskell-language-server-ghc9.4.6> No jhc found
haskell-language-server-ghc9.4.6> Using ld found on system at:
haskell-language-server-ghc9.4.6> /nix/store/yrjm2yaqy70jacs7mzkvmrg23iyjwm9q-binutils-wrapper-2.40/bin/ld.gold
haskell-language-server-ghc9.4.6> No pkg-config found
haskell-language-server-ghc9.4.6> Using runghc version 9.4.6 found on system at:
haskell-language-server-ghc9.4.6> /nix/store/zwx92rxwxd1y6yslljn2p14winw1l8w9-ghc-9.4.6/bin/runghc-9.4.6
haskell-language-server-ghc9.4.6> Using strip version 2.40 found on system at:
haskell-language-server-ghc9.4.6> /nix/store/v1wa8ysdv5lc516fbh25m8ysigwv1k20-gcc-wrapper-12.3.0/bin/strip
haskell-language-server-ghc9.4.6> Using tar found on system at:
haskell-language-server-ghc9.4.6> /nix/store/q5lvjrl7b12vqmsd93h013z9dqkbva0p-gnutar-1.35/bin/tar
haskell-language-server-ghc9.4.6> No uhc found
haskell-language-server-ghc9.4.6> *** abort because of serious configure-time warning from Cabal

@cab404
Copy link
Author

cab404 commented Sep 12, 2023

And after you actually read the reason for halting (abort because of serious configure-time warning from Cabal), you go a bit higher in the log, and discover that your dependency tree became bodged enough to fail to please Cabal.

haskell-language-server-ghc9.4.6> Warning:
haskell-language-server-ghc9.4.6>     This package indirectly depends on multiple versions of the same package. This is very likely to cause a compile failure.
haskell-language-server-ghc9.4.6>       package ormolu (ormolu-0.7.1.0-8MFGVHr9MKOIdGONdzQSbK) requires Cabal-syntax-3.10.1.0-8cQeWId0fw1FDGnbQvAPHA
haskell-language-server-ghc9.4.6>       package hls-cabal-plugin (hls-cabal-plugin-2.2.0.0-Ftbrl5icGVNL7kIQjWHy0f) requires Cabal-syntax-3.10.1.0-8cQeWId0fw1FDGnbQvAPHA
haskell-language-server-ghc9.4.6>       package fourmolu (fourmolu-0.13.0.0-5955oVua2b28s8l76FTD4Z) requires Cabal-syntax-3.10.1.0-8cQeWId0fw1FDGnbQvAPHA
haskell-language-server-ghc9.4.6>       package Cabal (Cabal-3.8.1.0) requires Cabal-syntax-3.8.1.0

@cab404
Copy link
Author

cab404 commented Sep 12, 2023

So you go ahead and override Cabal as well, hoping that nothing in API changed too much to break with all those repinnings — and perform another 10 20 minute build.

@cab404
Copy link
Author

cab404 commented Sep 12, 2023

And only after that, and praying, you get a working HLS binary (and then you just need to go and fix it for other 3 versions).

In other words, downgrading it to 0.11 was a quicker way to go on with my workday after encountering a wild 9.4.5→6 bump — although I should probably had kept it in a draft

@michaelpj
Copy link
Collaborator

The Nix build is on a best-effort basis (for reasons like this), and frankly I'm thinking of getting rid of it because it's always broken and we really can't promise to keep it working. I certainly don't think we should force a downgrade on ourselves. The build plan with fourmolu-0.14 works fine, if the Nix build can't handle it, so much the worse for the Nix build.

@cab404
Copy link
Author

cab404 commented Sep 13, 2023

The Nix build is on a best-effort basis (for reasons like this), and frankly I'm thinking of getting rid of it because it's always broken and we really can't promise to keep it working. I certainly don't think we should force a downgrade on ourselves. The build plan with fourmolu-0.14 works fine, if the Nix build can't handle it, so much the worse for the Nix build.

But 9.4 dourmolu plugin requested 0.13 in cabal? Maybe I didn't rebase since it got updated?

@fendor
Copy link
Collaborator

fendor commented Nov 15, 2023

I think this isn't relevant any more since #3804 has been merged.
Feel free to reopen if I am overlooking something.

@fendor fendor closed this Nov 15, 2023
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

Successfully merging this pull request may close these issues.

4 participants