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

Cryptic error message when there are two plugins with the same name #8

Closed
nvimtor opened this issue Sep 7, 2024 · 1 comment
Closed

Comments

@nvimtor
Copy link
Contributor

nvimtor commented Sep 7, 2024

FYI I got this

Running phase: unpackPhase
@nix { "action": "setPhase", "phase": "unpackPhase" }
unpacking source archive /nix/store/r1s6jgjm2swvzwhjy5k4bycyvimdvi19-nvim
source root is nvim
Running phase: patchPhase
@nix { "action": "setPhase", "phase": "patchPhase" }
Running phase: updateAutotoolsGnuConfigScriptsPhase
@nix { "action": "setPhase", "phase": "updateAutotoolsGnuConfigScriptsPhase" }
Running phase: buildPhase
@nix { "action": "setPhase", "phase": "buildPhase" }
debug: Attempting to open file '/nix/store/5w3dp0m37794iffsbm9vd9f1xmmhda6i-source/pkgs/applications/editors/vim/plugins/generated.nix'
debug: Attempting to open file '/nix/store/5w3dp0m37794iffsbm9vd9f1xmmhda6i-source/pkgs/development/lua-modules/generated-packages.nix'
debug: Found 22 plugins
debug: Found 19 relevant urls
debug: Found 1 relevant urls
warning: Did not find a url for nvim-cmp
warning: Did not find a url for cmp-nvim-lsp
thread 2440816 panic: reached unreachable code
???:?:?: 0x102c7f0fb in _debug.assert (???)
???:?:?: 0x102c8382f in _InputParser.parseInput (???)
???:?:?: 0x102c83e83 in _main.getPlugins (???)
???:?:?: 0x102c8cb23 in _main.main (???)
???:?:?: 0x102c8dacb in _main (???)
???:?:?: 0x188c560df in ??? (???)
???:?:?: 0x9e6bffffffffffff in ??? (???)
/nix/store/r34vx55ixx810pzl3fhcnanzcxdr6xys-stdenv-darwin/setup: line 1743: 58963 Abort trap: 6           /nix/store/cl4c8imrn9vakq1y3jmkv2qnx98xfr2a-conf>
vim.g.loaded_node_provider=0
vim.g.loaded_perl_provider=0
vim.g.loaded_python_provider=0
vim.g.loaded_python3_provider=0
vim.g.loaded_ruby_provider=0
vim.g.nix = true
vim.g.configdir = vim.fn.stdpath('\''config'\'')
vim.opt.packpath:remove(vim.g.configdir)
vim.opt.runtimepath:remove(vim.g.configdir)
vim.opt.runtimepath:remove(vim.g.configdir .. "/after")
vim.g.configdir = [[/nix/store/0xxqh9m91rwvr3nzgpwb7095vw8jbqwj-nvim-config-patched]]
vim.opt.packpath:prepend(vim.g.configdir)
vim.opt.runtimepath:prepend(vim.g.configdir)
vim.opt.runtimepath:append(vim.g.configdir .. "/after")

-- Extra config provided by user
-- Lua config

'

when I accidentally left two same plugins in the flake

It seems the error has thrown in https://github.com/NicoElbers/nv/blob/0331a51e9c124f6c6dc1fc3b67d3c015aae25b8d/patcher/src/parsers/InputParser.zig#L31C1-L42C6

I'm not familiar with Zig but would it be possible to add an error message? and just out of curiosity (again :D), is there a reason to do an assert instead of say, pick the last one with the same name?

thanks

@NicoElbers
Copy link
Owner

Good point, I should probably change this to an error message, since this is something that could be triggered by a user. Assert was easiest at the time. Should be fixed soon

NicoElbers added a commit that referenced this issue Sep 7, 2024
Previously, as mentioned in #8, broken assertions in the zig code would
generate cryptic error messages. A bunch of these assertions however
could be triggered by user behavior, like accidentally trying to include
a plugin twice, or through an incorrect assumption in nixpkgs.

In situations like these, I now have more sensible readable error
messages with potential fixes.
@NicoElbers NicoElbers mentioned this issue Sep 7, 2024
NicoElbers added a commit that referenced this issue Sep 7, 2024
Previously, as mentioned in #8, broken assertions in the zig code would
generate cryptic error messages. A bunch of these assertions however
could be triggered by user behavior, like accidentally trying to include
a plugin twice, or through an incorrect assumption in nixpkgs.

In situations like these, I now have more sensible readable error
messages with potential fixes.
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

2 participants