Skip to content

Failed to install hererocks #1266

@myste1tainn

Description

@myste1tainn
  • nvim --version:
NVIM v0.9.4
Build type: Release
LuaJIT 2.1.1696795921

   system vimrc file: "$VIM/sysinit.vim"
  fall-back for $VIM: "/opt/homebrew/Cellar/neovim/0.9.4/share/nvim"

Run :checkhealth for more info
  • git --version:
git version 2.39.3 (Apple Git-145)
  • Operating system/version:
macOS Sonoma 14.2.1
  • Terminal name/version:
kitty 0.26.5 created by Kovid Goyal

Steps to reproduce

  1. Setup plugins.lua file like
local packer = require('packer')
local packer_luarocks = require('packer.luarocks')

packer.init({
  luarocks = {
    python_cmd = 'python3'
  },
  profile = {
    enable = false,
    theshold = 1,
  },
  log = { level = 'warn' },
})

packer_luarocks.install_commands()
packer_luarocks.install_hererocks()()
packer_luarocks.setup_paths()

local fn = vim.fn
local install_path = fn.stdpath('data') .. '/site/pack/packer/start/packer.nvim'
if fn.empty(fn.glob(install_path)) > 0 then
  --vim.cmd [[packadd packer.nvim]]
  packer_bootstrap = fn.system({ 'git',
    'clone', '--depth', '1', 'https://github.com/wbthomason/packer.nvim', install_path })
end

local use_rocks = packer.use_rocks

return packer.startup(function(use)
  use_rocks { 'rxlua' }
end)
  1. Run :PackerSync

Actual behaviour

Found error `Failed to install hererocks'

Expected behaviour

Able to install hererocks and the luarocks dependencies

packer files

-- This file can be loaded by calling `lua require('plugins')` from your init.vim
-- Only required if you have packer configured as `opt`
--

local packer = require('packer')
local packer_luarocks = require('packer.luarocks')

packer.init({
  luarocks = {
    python_cmd = 'python3'
  },
  profile = {
    enable = false,
    theshold = 1,
  },
  log = { level = 'warn' },
})

packer_luarocks.install_commands()
packer_luarocks.install_hererocks()()
packer_luarocks.setup_paths()

local fn = vim.fn
local install_path = fn.stdpath('data') .. '/site/pack/packer/start/packer.nvim'
if fn.empty(fn.glob(install_path)) > 0 then
  --vim.cmd [[packadd packer.nvim]]
  packer_bootstrap = fn.system({ 'git',
    'clone', '--depth', '1', 'https://github.com/wbthomason/packer.nvim', install_path })
end

local use_rocks = packer.use_rocks

return packer.startup(function(use)
  use_rocks { 'rxlua' }
  use { '~/Sources/neovim-plugins/ui.nvim' }
  use { 'ElPiloto/significant.nvim' }
  use { 'wbthomason/packer.nvim' }
  use { 'shougo/deoplete.nvim' }

  -- LSP setup for flutter
  use { 'akinsho/flutter-tools.nvim', requires = 'nvim-lua/plenary.nvim' }

  -- LspSasga, using the one from tami5 cuz it's maintain and has more functions
  --use { 'glepnir/lspsaga.nvim' }
  use { 'tami5/lspsaga.nvim' }

  use { 'nvim-lua/plenary.nvim' }
  use { 'nvim-lua/popup.nvim' }

  -- Files navigation
  use { 'nvim-telescope/telescope-fzf-native.nvim', run = 'make' }
  use {
    'nvim-telescope/telescope.nvim',
    requires = {
      { "nvim-telescope/telescope-live-grep-args.nvim" },
      { "nvim-telescope/telescope-dap.nvim" }
    }
  }

  -- Specifically for Dart formatting
  use {
    "dart-lang/dart-vim-plugin"
  }

  -- Mason for LSP & DAP mgt.
  use {
    "williamboman/mason.nvim",
    "williamboman/mason-lspconfig.nvim",
    "williamboman/nvim-lsp-installer",
    {
      "neovim/nvim-lspconfig",
      after = "nvim-lsp-installer",
      config = function()
        require("nvim-lsp-installer").setup {}
        -- mason and the mason-lspconfig setup order (strict order, don't swap)
        require("mason").setup()
        require("mason-lspconfig").setup {
          -- NOTE: sourcekit server is not available in mason
          --  ensure_installed = {
          "lua_ls",
          "dartls",
          "angularls",
          "bashls",
          -- "shfmt",
          "cssls",
          "cssmodules_ls",
          "dockerls",
          "dotls",
          "eslint",
          "gopls",
          "groovyls",
          "html",
          "jdtls",
          "jsonls",
          "lemminx",
          "tsserver",
          "vimls",
          "yamlls"
        }
        require("user.lsp.lsp")
        require("user.lsp.lsp-servers-autoconfig") -- This is where i've stored most of the `require("lspconfig").{lang_ls_name}.setup{}`
      end
    },
    run = ":MasonUpdate" -- :MasonUpdate updates registry contents
  }

  -- Formatter
  use {
    'mhartington/formatter.nvim',
    'jose-elias-alvarez/null-ls.nvim'
  }

  -- Formerly used this for completion
  -- use { 'hrsh7th/nvim-compe' }

  -- main
  use { 'neoclide/coc.nvim', branch = 'release' }
  -- snippets packages for coc.nvim, alongside usage, not dependencies
  use { 'SirVer/ultisnips' }
  use { 'honza/vim-snippets' }
  use { 'neoclide/coc-snippets' }


  -- main
  --use { 'ms-jpq/coq_nvim', branch = 'coq' }
  -- 9000+ snippets
  --use { 'ms-jpq/coq.artifacts', branch = 'artifacts' }
  -- Utils
  -- - shell repl
  -- - nvim lua api
  -- - scientific calculator
  -- - comment banner
  -- - etc
  --use { 'ms-jpq/coq.thirdparty', branch = '3p' }

  use { 'nvim-treesitter/nvim-treesitter', run = ":TSUpdate" }
  use { 'nvim-treesitter/nvim-treesitter-textobjects' }
  use { 'kyazdani42/nvim-web-devicons' }

  use { 'norcalli/nvim-terminal.lua' }

  -- DAP for deebugging
  use 'jbyuki/one-small-step-for-vimkind'
  use 'mfussenegger/nvim-dap'
  use 'rcarriga/nvim-dap-ui'
  use 'theHamsta/nvim-dap-virtual-text'

  -- Go IDE
  use 'ray-x/go.nvim'
  use 'ray-x/guihua.lua'

  -- Java IDE
  use 'mfussenegger/nvim-jdtls'
  -- Status line
  use {
    'glepnir/galaxyline.nvim',
    branch = 'main',
    -- your statusline
    -- some optional icons
    requires = { 'kyazdani42/nvim-web-devicons', opt = true }
  }

  -- Util
  use 'famiu/nvim-reload'

  -- UI for nvim
  use 'mjlbach/neovim-ui'
  use 'mfussenegger/nvim-lua-debugger'

  -- Auto tagging for HTML & TSX
  use 'windwp/nvim-ts-autotag'
  -- Auto pairings for multiple char e.g. Single Quote
  use 'windwp/nvim-autopairs'

  -- inlay hints
  use 'lvimuser/lsp-inlayhints.nvim'

  if packer_bootstrap then
    require('packer').sync()
  end
end)
  • Additional information

Since the installation failed, I've dug into the luarocks.lua a bit and found the line which composed the `hererocks' installation command like so

python3 /Users/arnon.keereena/.cache/nvim/packer_hererocks/hererocks.py --verbose -j 2.1.1696795921 -r latest /Users/arnon.keereena/.cache/nvim/packer_hererocks/2.1.1696795921

which returns the results like

Error: bad LuaJIT version 2.1.1696795921
  • My install $ luajit -v is
LuaJIT 2.1.1696795921 -- Copyright (C) 2005-2023 Mike Pall. https://luajit.org/

But then after some googling certain user is using the Neovim of 0.5 and Luajit of the 2.3.0-beta3, so I tried changing the command like so

python3 /Users/arnon.keereena/.cache/nvim/packer_hererocks/hererocks.py --verbose -j 2.1.0-beta3 -r latest /Users/arnon.keereena/.cache/nvim/packer_hererocks/2.1.1696795921

Now the installation pass (manually)

After that I went into the Neovim again, now I am able to install the luarocks package as normal. Not sure if there a compatibility problem with the Luajit and what not. But this is what I've found and circumvent so far.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugv1An issue or PR relevant to packer v2

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions