haskell / lsp

Haskell library for the Microsoft Language Server Protocol
360 stars 89 forks source link

lsp-types-2.0.0.0/metamodel/Language/LSP/MetaModel.hs:12:13: error: • Exception when trying to run compile-time code #492

Closed juhp closed 1 year ago

juhp commented 1 year ago

lsp-types-2.0.0.0 fails to build in current Stackage Nightly:

       Building library 'metamodel' for lsp-types-2.0.0.0..
       [2 of 2] Compiling Language.LSP.MetaModel

       /var/stackage/work/unpack-dir/unpacked/lsp-types-2.0.0.0-0cacdab7f5caa7241cae23c92e73955d08045e29a85179ba2cde8e4fdbae25ee/metamodel/Language/LSP/MetaModel.hs:12:13: error:
           • Exception when trying to run compile-time code:
               /var/stackage/work/unpack-dir/unpacked/lsp-types-2.0.0.0-0cacdab7f5caa7241cae23c92e73955d08045e29a85179ba2cde8e4fdbae25ee/metaModel.json: withBinaryFile: does not exist (No such file or directory)
             Code: (loadMetaModelFromFile
                      =<< makeRelativeToProject "metaModel.json")
           • In the untyped splice:
               $(loadMetaModelFromFile =<< makeRelativeToProject "metaModel.json")
          |
       12 | metaModel = $(loadMetaModelFromFile =<< makeRelativeToProject "metaModel.json")
          |             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

My guess is that you forgot to include metaModel.json in .cabal. It might be good to build from sdist in CI.

7c78 commented 1 year ago

I cannot build lsp-test successfully, it says "unknown package: extra"

image

juhp commented 1 year ago

@7c78 quite unrelated and you just need to run cabal update first to initialize the package list.

7c78 commented 1 year ago

@juhp sorry, my bad. I usually do not have to use cabal update when I set up a Haskell environment with Nix.

michaelpj commented 1 year ago

I pushed lsp-types-2.0.0.1 with the fix.