wbthomason / packer.nvim

A use-package inspired plugin manager for Neovim. Uses native packages, supports Luarocks dependencies, written in Lua, allows for expressive config
MIT License
7.82k stars 266 forks source link

The `requires` key seems to prevent a plugin from getting installed #994

Closed vendion closed 2 years ago

vendion commented 2 years ago

Steps to reproduce

  1. Add a plugin and set dependencies using the requires key
  2. Try to get packer.nvim to istall the plugin and the dependency using either PackerInstall or PackerSync

Actual behaviour

PackerInstall does nothing in the case, and PackerSync reports everything is up-to date.

Expected behaviour

Plugins getting installed

packer files

Plugin specification file(s) 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 packer_bootstrap = fn.system({'git', 'clone', '--depth', '1', 'https://github.com/wbthomason/packer.nvim', install_path}) vim.cmd [[packadd packer.nvim]] end local packer = require("packer") packer.init({ enable = true, -- enable profiling via :PackerCompile profile=true threshold = 0, -- the amount in ms that a plugins load time must be over for it to be included in the profile max_jobs = 20, -- Limit the number of simultaneous jobs. nil means no limit. Set to 20 in order to prevent PackerSync form being "stuck" -> https://github.com/wbthomason/packer.nvim/issues/746 -- Have packer use a popup window display = { open_fn = function() return require("packer.util").float({ border = "rounded" }) end, }, }) return packer.startup(function(use) use {'wbthomason/packer.nvim'} -- [[ -- Themes & Display -- ]] use {'arcticicestudio/nord-vim'} use { "nvim-lualine/lualine.nvim", config = require('vendion.config.lualine'), event = "VimEnter", requires = { { "kyazdani42/nvim-web-devicons" }, { "SmiteshP/nvim-navic" }, }, } -- [[ -- Utilities -- ]] use { 'TimUntersberger/neogit', requires = 'nvim-lua/plenary.nvim' } use { "nvim-telescope/telescope.nvim", requires = { {'nvim-lua/plenary.nvim'}, {'nvim-lua/popup.nvim'}, {'BurntSushi/ripgrep'}, {'sharkdp/fd', opt = true}, {'nvim-telescope/telescope-fzf-native.nvim', run = 'make' }, { "jvgrootveld/telescope-zoxide" }, { "crispgm/telescope-heading.nvim" }, { "nvim-telescope/telescope-symbols.nvim" }, { "nvim-telescope/telescope-file-browser.nvim" }, { "nvim-telescope/telescope-packer.nvim" }, { "nvim-telescope/telescope-ui-select.nvim" }, }, config = require('vendion.config.telescope'), } use {"ThePrimeagen/git-worktree.nvim"} use {"ThePrimeagen/harpoon"} use {"mbbill/undotree"} use {"sbdchd/neoformat"} use { "nvim-treesitter/nvim-treesitter", -- run = ":TSUpdate", requires = { { "nvim-treesitter/playground" }, { "romgrk/nvim-treesitter-context" }, }, } use { 'windwp/nvim-autopairs' } -- [[ -- Syntax -- ]] use {"tpope/vim-dadbod"} -- [[ -- Auto Complete & LSP -- ]] use {"hrsh7th/nvim-cmp"} use {"neovim/nvim-lspconfig"} use {"hrsh7th/cmp-nvim-lsp"} use {"hrsh7th/cmp-buffer"} use {'hrsh7th/cmp-path'} use {'hrsh7th/cmp-cmdline'} use {"tzachar/cmp-tabnine", run = "./install.sh" } use {"onsails/lspkind-nvim"} use {"nvim-lua/lsp_extensions.nvim"} use {"glepnir/lspsaga.nvim"} use {"simrat39/symbols-outline.nvim"} use {"L3MON4D3/LuaSnip"} use {"saadparwaiz1/cmp_luasnip"} use {"hrsh7th/cmp-calc"} use {"f3fora/cmp-spell"} use {"dmitmel/cmp-digraphs"} use {"andersevenrud/cmp-tmux"} use {"hrsh7th/cmp-emoji"} use {"hrsh7th/cmp-nvim-lua"} use {"kristijanhusak/vim-dadbod-completion"} -- [[ -- Debugging -- ]] use {"mfussenegger/nvim-dap"} use {"rcarriga/nvim-dap-ui"} use {"theHamsta/nvim-dap-virtual-text"} -- Automatically set up your configuration after cloning packer.nvim -- Put this at the end after all plugins if packer_bootstrap then require('packer').sync() end end)
packer log file [ERROR Tue 02 Aug 2022 03:12:24 AM -03 30710176441497] ...e/nvim/site/pack/packer/start/packer.nvim/lua/packer.lua:983: Failure running setup function: "/home/vendion/.config/nvim/lua/vendion/config/lualine.lua:1: module 'nvim-navic' not found:\n\tno field package.preload['nvim-navic']\n\tno file './nvim-navic.lua'\n\tno file'/usr/share/luajit-2.1.0-beta3/nvim-navic.lua'\n\tno file '/usr/local/share/lua/5.1/nvim-navic.lua'\n\tno file '/usr/local/share/lua/5.1/nvim-navic/init.lua'\n\tno file '/usr/share/lua/5.1/nvim-navic.lua'\n\tno file '/usr/share/lua/5.1/nvim-navic/init.lua'\n\tno file './nvim-navic.so'\n\tno file '/usr/local/lib/lua/5.1/nvim-navic.so'\n\tno file '/usr/lib/lua/5.1/nvim-navic.so'\n\tno file '/usr/local/lib/lua/5.1/loadall.so'" [WARN Tue 02 Aug 2022 03:12:41 AM -03 30727040961373] ...ite/pack/packer/start/packer.nvim/lua/packer/display.lua:654: No plugin selected!
packer compiled file -- Automatically generated packer.nvim plugin loader code if vim.api.nvim_call_function('has', {'nvim-0.5'}) ~= 1 then vim.api.nvim_command('echohl WarningMsg | echom "Invalid Neovim version for packer.nvim! | echohl None"') return end vim.api.nvim_command('packadd packer.nvim') local no_errors, error_msg = pcall(function() local time local profile_info local should_profile = false if should_profile then local hrtime = vim.loop.hrtime profile_info = {} time = function(chunk, start) if start then profile_info[chunk] = hrtime() else profile_info[chunk] = (hrtime() - profile_info[chunk]) / 1e6 end end else time = function(chunk, start) end end local function save_profiles(threshold) local sorted_times = {} for chunk_name, time_taken in pairs(profile_info) do sorted_times[#sorted_times + 1] = {chunk_name, time_taken} end table.sort(sorted_times, function(a, b) return a[2] > b[2] end) local results = {} for i, elem in ipairs(sorted_times) do if not threshold or threshold and elem[2] > threshold then results[i] = elem[1] .. ' took ' .. elem[2] .. 'ms' end end _G._packer = _G._packer or {} _G._packer.profile_output = results end time([[Luarocks path setup]], true) local package_path_str = "/home/vendion/.cache/nvim/packer_hererocks/2.1.0-beta3/share/lua/5.1/?.lua;/home/vendion/.cache/nvim/packer_hererocks/2.1.0-beta3/share/lua/5.1/?/init.lua;/home/vendion/.cache/nvim/packer_hererocks/2.1.0-beta3/lib/luarocks/rocks-5.1/?.lua;/home/vendion/.cache/nvim/packer_hererocks/2.1.0-beta3/lib/luarocks/rocks-5.1/?/init.lua" local install_cpath_pattern = "/home/vendion/.cache/nvim/packer_hererocks/2.1.0-beta3/lib/lua/5.1/?.so" if not string.find(package.path, package_path_str, 1, true) then package.path = package.path .. ';' .. package_path_str end if not string.find(package.cpath, install_cpath_pattern, 1, true) then package.cpath = package.cpath .. ';' .. install_cpath_pattern end time([[Luarocks path setup]], false) time([[try_loadstring definition]], true) local function try_loadstring(s, component, name) local success, result = pcall(loadstring(s), name, _G.packer_plugins[name]) if not success then vim.schedule(function() vim.api.nvim_notify('packer.nvim: Error running ' .. component .. ' for ' .. name .. ': ' .. result, vim.log.levels.ERROR, {}) end) end return result end time([[try_loadstring definition]], false) time([[Defining packer_plugins]], true) _G.packer_plugins = { ["nord-vim"] = { loaded = true, path = "/home/vendion/.local/share/nvim/site/pack/packer/start/nord-vim", url = "https://github.com/arcticicestudio/nord-vim" }, ["packer.nvim"] = { loaded = true, path = "/home/vendion/.local/share/nvim/site/pack/packer/start/packer.nvim", url = "https://github.com/wbthomason/packer.nvim" } } time([[Defining packer_plugins]], false) if should_profile then save_profiles() end end) if not no_errors then error_msg = error_msg:gsub('"', '\\"') vim.api.nvim_command('echohl ErrorMsg | echom "Error in packer_compiled: '..error_msg..'" | echom "Please check your config for correctness" | echohl None') end
vendion commented 2 years ago

After some debugging I think I have a clearer picture of what is going on and it may be due to user error so I'm closing this and movinig to the discussions tab.