agda-language-server icon indicating copy to clipboard operation
agda-language-server copied to clipboard

Trouble updating `Agda` and `agda-language-server` at the same time

Open foxyseta opened this issue 1 year ago • 2 comments

While I am able to use

cabal install --overwrite-policy=always Agda
cabal install --overwrite-policy=always agda-language-server

when running

cabal install --overwrite-policy=always Agda agda-language-server

I get

Resolving dependencies...
Build profile: -w ghc-9.4.8 -O1
In order, the following will be built (use -v for more details):
 - agda-language-server-0.0.3.0 (lib) (requires build)
 - agda-language-server-0.0.3.0 (exe:als) (requires build)
Starting     agda-language-server-0.0.3.0 (lib)
Building     agda-language-server-0.0.3.0 (lib)

Failed to build agda-language-server-0.0.3.0.
Build log (
/home/foxy/.cache/cabal/logs/ghc-9.4.8/agda-language-server-0.0.3.0-a4c9e30592f7f6ffa836aff71ad7eceafe5da87251e3e8966c3329a7a1520b76.log
):
Configuring library for agda-language-server-0.0.3.0..
Preprocessing library for agda-language-server-0.0.3.0..
Building library for agda-language-server-0.0.3.0..
[ 1 of 25] Compiling Agda.Position    ( src/Agda/Position.hs, dist/build/Agda/Position.o, dist/build/Agda/Position.dyn_o )

src/Agda/Position.hs:21:1: error:
    Could not load module ‘Language.LSP.Types’
    It is a member of the hidden package ‘lsp-types-1.6.0.1’.
    Perhaps you need to add ‘lsp-types’ to the build-depends in your .cabal file.
    It is a member of the hidden package ‘lsp-types-1.6.0.1’.
    Perhaps you need to add ‘lsp-types’ to the build-depends in your .cabal file.
    Use -v (or `:set -v` in ghci) to see a list of the files searched for.
   |
21 | import qualified Language.LSP.Types as LSP
   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
[ 2 of 25] Compiling Control.Concurrent.SizedChan ( src/Control/Concurrent/SizedChan.hs, dist/build/Control/Concurrent/SizedChan.o, dist/build/Control/Concurrent/SizedChan.dyn_o )
[ 3 of 25] Compiling Paths_agda_language_server ( dist/build/autogen/Paths_agda_language_server.hs, dist/build/Paths_agda_language_server.o, dist/build/Paths_agda_language_server.dyn_o )
[ 4 of 25] Compiling Render.RichText  ( src/Render/RichText.hs, dist/build/Render/RichText.o, dist/build/Render/RichText.dyn_o )

src/Render/RichText.hs:41:1: error:
    Could not find module ‘Agda.Interaction.Options.IORefs’
    Perhaps you meant
      Agda.Interaction.Options.Base
      Agda.Interaction.Options.Base
      Agda.Interaction.Options.Base
    Use -v (or `:set -v` in ghci) to see a list of the files searched for.
   |
41 | import qualified Agda.Interaction.Options.IORefs as Agda
   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

src/Render/RichText.hs:45:27: error:
    Module ‘Agda.Utils.Suffix’ does not export ‘subscriptAllowed’
   |
45 | import Agda.Utils.Suffix (subscriptAllowed, toSubscriptDigit)
   |                           ^^^^^^^^^^^^^^^^
[18 of 25] Compiling Server.CommandController ( src/Server/CommandController.hs, dist/build/Server/CommandController.o, dist/build/Server/CommandController.dyn_o )
[19 of 25] Compiling Server.ResponseController ( src/Server/ResponseController.hs, dist/build/Server/ResponseController.o, dist/build/Server/ResponseController.dyn_o )
Error: cabal: Failed to build agda-language-server-0.0.3.0 (which is required
by exe:als from agda-language-server-0.0.3.0). See the build log above for
details.

Am I perhaps not using the proper cabal command/flag to upgrade packages?

foxyseta avatar Sep 19 '24 13:09 foxyseta

I'm not sure what's your goal of upgrades. But I've managed to upgrade the lsp packages to >= 2 and now it builds with various versions of Agda (still working on 2.7.0 though).

Here's a Stack lockfile with some versions pinned down https://github.com/agda/agda-language-server/blob/af389aa74dc1d96d5866215d912c793405a7db32/stack.yaml.lock Not sure if this will help.

banacorn avatar Nov 30 '24 08:11 banacorn

"Goal of upgrades" as in, what versions of Agda and ALS I am upgrading to? If so, it is 2.7.0.1 for Agda and 0.2.6.3.0 for ALS.

(still working on 2.7.0 though)

I see! Is this why cabal can successfully install the two as binaries separately, but not together?

Unrelated: even though I am installing ALS 0.2.6.3.0, invoking als --version outputs v0.0.3.0 instead. Am I doing something wrong?

foxyseta avatar Nov 30 '24 13:11 foxyseta

I am pretty sure this is not relevant any more, as the latest Agda stable release is v2.8.0, which is incompatible with ALS 0.2.6.3.0 anyway.

foxyseta avatar Oct 04 '25 15:10 foxyseta