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

vimPlugins.nvim-treesitter: workaround for duplicate grammars #339589

Merged
merged 1 commit into from
Sep 5, 2024

Conversation

PerchunPak
Copy link
Member

@PerchunPak PerchunPak commented Sep 4, 2024

Description of changes

See #339076 (comment)

Things done

  • Built on platform(s)
    • x86_64-linux
    • aarch64-linux
    • x86_64-darwin
    • aarch64-darwin
  • For non-Linux: Is sandboxing enabled in nix.conf? (See Nix manual)
    • sandbox = relaxed
    • sandbox = true
  • Tested, as applicable:
  • Tested compilation of all packages that depend on this change using nix-shell -p nixpkgs-review --run "nixpkgs-review rev HEAD". Note: all changes have to be committed, also see nixpkgs-review usage
  • Tested basic functionality of all binary files (usually in ./result/bin/)
  • 24.11 Release Notes (or backporting 23.11 and 24.05 Release notes)
    • (Package updates) Added a release notes entry if the change is major or breaking
    • (Module updates) Added a release notes entry if the change is significant
    • (Module addition) Added a release notes entry if adding a new NixOS module
  • Fits CONTRIBUTING.md.

@BirdeeHub, could you please try rebuilding your system on this PR and see if the issue persists? I didn't test this.


Add a 👍 reaction to pull requests you find important.

@PerchunPak
Copy link
Member Author

See also #319233 (comment)

Result of nixpkgs-review pr 339589 run on x86_64-linux 1

1 package built:
  • vimPluginsUpdater

@BirdeeHub
Copy link
Contributor

Im completely fine with this solution for this purpose for the reasons stated in my most recent comment on the other thread

@BirdeeHub
Copy link
Contributor

BirdeeHub commented Sep 4, 2024

I forgot to mention, yes, I did rebuild agaisnt the branch workaround-339076. It does work.

It also still works with the norg overlay active and all the other random stuff I could throw at it like multiple ones on different versions.

@PerchunPak PerchunPak added the 12.approvals: 2 This PR was reviewed and approved by two reputable people label Sep 5, 2024
@fpletz
Copy link
Member

fpletz commented Sep 5, 2024

Not sure what to do with the other PR but let's get this in as this seems to restore the previous behavior.

@fpletz fpletz merged commit 2399c29 into NixOS:master Sep 5, 2024
35 of 37 checks passed
@PerchunPak PerchunPak deleted the workaround-339076 branch September 5, 2024 14:16
@PerchunPak
Copy link
Member Author

Not sure what to do with the other PR

I will work on it, but later

@pinpox
Copy link
Member

pinpox commented Sep 7, 2024

I started getting this error messages when starting neovim after the last update:

Error detected while processing BufReadPost Autocommands for "*":
Error executing lua callback: ...-neovim-unwrapped-0.10.1/share/nvim/runtime/filetype.lua:35: Error executing lua: ...-neovim-unwrapped-0.10.1/share/nvim/runtime/filetype.lua:36: BufReadPost
 Autocommands for "*"..FileType Autocommands for "*": Vim(append):Error executing lua callback: ....10.1/share/nvim/runtime/lua/vim/treesitter/language.lua:112: Failed to load parser for lan
guage 'nix': uv_dlopen: no error
stack traceback:
        [C]: in function '_ts_add_language'
        ....10.1/share/nvim/runtime/lua/vim/treesitter/language.lua:112: in function 'add'
        ...1/share/nvim/runtime/lua/vim/treesitter/languagetree.lua:111: in function 'new'
        ...wrapped-0.10.1/share/nvim/runtime/lua/vim/treesitter.lua:41: in function '_create_parser'
        ...wrapped-0.10.1/share/nvim/runtime/lua/vim/treesitter.lua:108: in function 'get_parser'
        ...wrapped-0.10.1/share/nvim/runtime/lua/vim/treesitter.lua:416: in function 'start'
        .../start/nvim-treesitter/lua/nvim-treesitter/highlight.lua:20: in function 'attach'
        ...es/start/nvim-treesitter/lua/nvim-treesitter/configs.lua:509: in function 'attach_module'
        ...es/start/nvim-treesitter/lua/nvim-treesitter/configs.lua:532: in function 'reattach_module'
        ...es/start/nvim-treesitter/lua/nvim-treesitter/configs.lua:133: in function <...es/start/nvim-treesitter/lua/nvim-treesitter/configs.lua:132>
        [C]: in function 'nvim_cmd'
        ...-neovim-unwrapped-0.10.1/share/nvim/runtime/filetype.lua:36: in function <...-neovim-unwrapped-0.10.1/share/nvim/runtime/filetype.lua:35>
        [C]: in function 'nvim_buf_call'
        ...-neovim-unwrapped-0.10.1/share/nvim/runtime/filetype.lua:35: in function <...-neovim-unwrapped-0.10.1/share/nvim/runtime/filetype.lua:10>
stack traceback:
        [C]: in function 'nvim_cmd'
        ...-neovim-unwrapped-0.10.1/share/nvim/runtime/filetype.lua:36: in function <...-neovim-unwrapped-0.10.1/share/nvim/runtime/filetype.lua:35>
        [C]: in function 'nvim_buf_call'
        ...-neovim-unwrapped-0.10.1/share/nvim/runtime/filetype.lua:35: in function <...-neovim-unwrapped-0.10.1/share/nvim/runtime/filetype.lua:10>
stack traceback:
        [C]: in function 'nvim_buf_call'
        ...-neovim-unwrapped-0.10.1/share/nvim/runtime/filetype.lua:35: in function <...-neovim-unwrapped-0.10.1/share/nvim/runtime/filetype.lua:10>

Could this be related?

@BirdeeHub
Copy link
Contributor

BirdeeHub commented Sep 7, 2024

doesnt look like it. Looks more like one of the two things pointed out in this thread:

#332580

Try not lazy loading treesitter and/or making sure your parsers are in the RTP BEFORE the builtin lib/parsers. youre getting collisions with the nvim builtin grammars. It looks exactly like the error I get from using lazy.nvim without a wrapper that does the RTP reset properly on nix

@BirdeeHub
Copy link
Contributor

BirdeeHub commented Sep 7, 2024

The issue fixed by this PR was a build time issue, and it just removes duplicates rather than failing the build on duplicates. I would be very surprised if this error came from this PR. Your error looks like an issue with load order at startup, something this PR didn't change.

@pinpox
Copy link
Member

pinpox commented Sep 7, 2024

Thanks for clarifying. it was indeed an error with leftover files in ~/.config/share. Solved!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants