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

Luarocks build failure, issuing installing neotest and haskell nvim treesitter #179

Closed
dfontenot opened this issue Jul 20, 2024 · 7 comments

Comments

@dfontenot
Copy link

Neovim version (nvim -v)

v0.10.0

Operating system/version

Arch Linux

How to reproduce the issue

Install Haskell treesitter grammar using :TSUpdate Open nvim and wait for lazy.nvim to try to install neotest-haskell

Expected behaviour

The lazy.nvim install of neotest-haskell to succeed. Additionally, I expected the newest version of neotest to be installed. I see it's installing scm-1, however, that version is much older than the latest neotest build on luarocks.

Actual behaviour

Warning: Failed searching manifest: Failed downloading https://nvim-neorocks.github.io/rocks-binaries/dev/manifest-5.1 - failed downloading https://nvim-neorocks.github.io/rocks-binaries/dev/manifest-5.1
        Cloning into 'neotest'...
        Installing https://luarocks.org/neotest-haskell-2.1.0-1.src.rock
        Missing dependencies for neotest-haskell 2.1.0-1:
           neotest (not installed)
           tree-sitter-haskell (not installed)

        neotest-haskell 2.1.0-1 depends on lua >= 5.1 (5.1-1 provided by VM: success)
        neotest-haskell 2.1.0-1 depends on neotest (not installed)
        Installing https://luarocks.org/dev/neotest-scm-1.rockspec
        Cloning into 'plenary.nvim'...
        Missing dependencies for neotest scm-1:
           plenary.nvim (not installed)
           nvim-treesitter (not installed)

        neotest scm-1 depends on lua 5.1 (5.1-1 provided by VM: success)
        neotest scm-1 depends on plenary.nvim (not installed)
        Installing https://luarocks.org/plenary.nvim-scm-1.rockspec
        Cloning into 'luassert'...
        Missing dependencies for plenary.nvim scm-1:
           luassert (not installed)

        plenary.nvim scm-1 depends on lua >= 5.1, < 5.4 (5.1-1 provided by VM: success)
        plenary.nvim scm-1 depends on luassert (not installed)
        Installing https://luarocks.org/dev/luassert-scm-1.rockspec
        Cloning into 'say'...
        Missing dependencies for luassert scm-1:
           say >= 1.4.0-1 (not installed)

        luassert scm-1 depends on lua >= 5.1 (5.1-1 provided by VM: success)
        luassert scm-1 depends on say >= 1.4.0-1 (not installed)
        Installing https://luarocks.org/dev/say-scm-1.rockspec

        say scm-1 depends on lua >= 5.1 (5.1-1 provided by VM: success)
        No existing manifest. Attempting to rebuild...
        say scm-1 is now installed in /home/me/.local/share/nvim/lazy-rocks/neotest-haskell (license: MIT)

        luassert scm-1 is now installed in /home/me/.local/share/nvim/lazy-rocks/neotest-haskell (license: MIT <http://opensource.org/licenses/MIT>)


        Error: Failed installing dependency: https://luarocks.org/dev/neotest-scm-1.rockspec - Could not satisfy dependency nvim-treesitter: No results matching query were found for Lua 5.1.
        plenary.nvim scm-1 is now installed in /home/me/.local/share/nvim/lazy-rocks/neotest-haskell (license: MIT/X11)

        neotest scm-1 depends on nvim-treesitter (not installed)
        Failed installing neotest-haskell with `luarocks`.

        --------------------------------------------------------------------------------

        Trying to build from source.
        Cloning into 'neotest'...
        Missing dependencies for neotest-haskell scm-1:
           neotest (not installed)
           tree-sitter-haskell (not installed)

        neotest-haskell scm-1 depends on lua >= 5.1 (5.1-1 provided by VM: success)
        neotest-haskell scm-1 depends on neotest (not installed)
        Installing https://luarocks.org/dev/neotest-scm-1.rockspec

        Error: Failed installing dependency: https://luarocks.org/dev/neotest-scm-1.rockspec - Could not satisfy dependency nvim-treesitter: No results matching query were found for Lua 5.1.
        Missing dependencies for neotest scm-1:
           nvim-treesitter (not installed)

        neotest scm-1 depends on lua 5.1 (5.1-1 provided by VM: success)
        neotest scm-1 depends on plenary.nvim (scm-1 installed: success)
        neotest scm-1 depends on nvim-treesitter (not installed)

A minimal Neovim config used to reproduce this issue.

require('lazy').setup(
{
    'folke/neodev.nvim',
    opts = {
      library = {
        enabled = true,
        runtime = true,
        types = true,
        plugins = {
          'neotest',
          'nvim-treesitter',
          'plenary.nvim',
        },
      },
      lspconfig = true,
      pathStrict = true,
    },
  },
{
    'nvim-neotest/neotest',
    dependencies = {
      'nvim-neotest/nvim-nio',
      'antoinemadec/FixCursorHold.nvim',
      'nvim-treesitter/nvim-treesitter',
      'mrcjkb/neotest-haskell',
      'nvim-lua/plenary.nvim',
    },
    event = 'BufEnter',
  }
)
@dfontenot dfontenot added the bug Something isn't working label Jul 20, 2024
@mrcjkb
Copy link
Owner

mrcjkb commented Jul 20, 2024

Hey 👋

This is two lazy.nvim issues:

  1. It tries to install luarocks dependencies from the dev manifest instead of the root manifest, which is why it's trying to install scm-1 versions of neotest. It should try to install from the root manifest (without the --dev flag) first if the version of the plugin being installed is a semver version.

  2. It uses generated mappings to exclude neovim plugins from being installed via luarocks. This appears to be broken now that the neotest-haskell rock has tree-sitter-haskell as a dependency.

I see it's installing scm-1, however, that version is much older than the latest neotest build on luarocks.

That is not true. The scm-1 rockspec was uploaded a year ago, but it installs the latest HEAD instead of a semver version (scm = source code management, e.g. git).
The issue here is that the rockspec lists nvim-treesitter in its dependencies, which has been removed from luarocks because the luarocks package was broken and nvim-treesitter isn't meant to be used as a dependency anymore.
I've opened an issue for that:

As a workaround for the lazy.nvim issues, you can pin neotest-haskell to version 2.0.0.

Closing, as this is not a neotest-haskell bug.

@mrcjkb mrcjkb closed this as completed Jul 20, 2024
@mrcjkb mrcjkb removed the bug Something isn't working label Jul 20, 2024
@dfontenot
Copy link
Author

Perfect that seems to have fixed it.

That is not true. The scm-1 rockspec was uploaded a year ago, but it installs the latest HEAD instead of a semver version (scm = source code management, e.g. git).

My mistake, did not understand that about luarocks.

@Zim-Inn
Copy link

Zim-Inn commented Oct 5, 2024

As a workaround for the lazy.nvim issues, you can pin neotest-haskell to version 2.0.0.

How to pin the version?
LazyVim's official doc refers to set config.defaults.version = "2.0.0" , but I don't know how to set it in lua config file. Is there any example?

@mrcjkb
Copy link
Owner

mrcjkb commented Oct 5, 2024

I don't use LazyVim, so you're best off asking there :)

@Zim-Inn
Copy link

Zim-Inn commented Oct 5, 2024

Perfect that seems to have fixed it.

How did you solve it? I met the same problem. Can you give me a config lua file example?

@dfontenot
Copy link
Author

Perfect that seems to have fixed it.

How did you solve it? I met the same problem. Can you give me a config lua file example?

tag = '2.0.0'

@Zim-Inn
Copy link

Zim-Inn commented Oct 7, 2024

Thank you, it works perfectly

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

No branches or pull requests

3 participants