Comments (7)
Hi,
Thanks for the reply. I am getting the error when I try to compile with clang v16.06. The plugin does compile with GCC 13.1.0
, however, neovim crashes when I try to open a python file.
/usr/local/bin/nvim: symbol lookup error: /home/gww/.local/share/nvim/lazy/nvim-treesitter/parser/python.so: undefined symbol: static_assert
It seems like it's linking the wrong version of libc
and not the one in my mamba environment.
gww@GWW-AMD:~/.config/nvim$ nm -D /home/gww/.local/share/nvim/lazy/nvim-treesitter/parser/python.so
w _ITM_deregisterTMCloneTable
w _ITM_registerTMCloneTable
U __assert_fail
w __cxa_finalize
w __gmon_start__
00000000000115ac T _fini
0000000000003000 T _init
U calloc
0000000000010e1e T delimiter_vec_new
U free
0000000000010e00 T indent_vec_new
U realloc
U static_assert
0000000000010dbf T tree_sitter_python
000000000001152c T tree_sitter_python_external_scanner_create
00000000000113e7 T tree_sitter_python_external_scanner_deserialize
0000000000011580 T tree_sitter_python_external_scanner_destroy
0000000000010e3c T tree_sitter_python_external_scanner_scan
000000000001138c T tree_sitter_python_external_scanner_serialize
gww@GWW-AMD:~/.config/nvim$ ldd /home/gww/.local/share/nvim/lazy/nvim-treesitter/parser/python.so
linux-vdso.so.1 (0x00007ffcebbdf000)
libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007fc965a70000)
/lib64/ld-linux-x86-64.so.2 (0x00007fc965cd8000)
gww@GWW-AMD:~/.config/nvim$ ldd --version ldd
ldd (Ubuntu GLIBC 2.31-0ubuntu9.9) 2.31
Copyright (C) 2020 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
Written by Roland McGrath and Ulrich Drepper.
from tree-sitter-python.
static_assert is valid in C11 (and compiling with clang and gcc with -std=c99 also works for me), there is a check for the __STDC_VERSION__
, what platform and compiler are you using?
from tree-sitter-python.
I upgraded to ubuntu 22.04 and that seems to have fixed the issue. I was using ubuntu 20 before.
from tree-sitter-python.
Hmm, weird that it was linking the wrong libraries at runtime - glad you got it fixed
from tree-sitter-python.
I upgraded to ubuntu 22.04 and that seems to have fixed the issue. I was using ubuntu 20 before.
@GWW
Did you have micromamba activated when treesitter's python.so
was compiled (and your micromamba did have gcc installed)? I assume you compiled the failing one with micromamba's gcc and after the ubuntu upgrade you compiled with the system gcc one.
Because:
Have the same problem here.
Using lazyvim and have it compiling python.so. Which fails when micromamba is activated, using its compiler with the same problem than you described, crashing(!) neovim 👎
Then I installed python-devel on the system, i.e. have system gcc, deactivate micromamba, then simply delete the python.so
from treesitter and have lazy/mason compile it again, I get a working python.so
. neovim works, also then within micromamba activated.
Differences:
strings python.so > nw # (non working, same for working one, named "w")
[foo2@fedora-4gb-hel1-3 nvim]$ diff nw w
3,4d2
< _init
< _fini
19d16
< static_assert <---- NOT in the working python.so but in the one from micromamba gcc
23,24c20
< /home/foo2/micromamba/lib
< u(UH
---
> u+UH
240c236
< tmp != ((void *)0)
---
> tmp != NULL
244,248c240,241
< GCC: (GNU) 4.4.7 20120313 (Red Hat 4.4.7-23)
< GCC: (conda-forge gcc 13.1.0-0) 13.1.0
< crti.o
< call_gmon_start
< crtstuff.c
---
> GCC: (GNU) 13.1.1 20230614 (Red Hat 13.1.1-4)
> crtbeginS.o
283a277
> crtendS.o
284a279
> _fini
289a285
> _init
294d289
< _fini
304d298
< static_assert
308d301
< _init
311a305,306
> .note.gnu.property
> .note.gnu.build-id
320d314
< .plt.got
329a324
> .got
331d325
< .data
333a328
> .gnu.build.attributes
[foo2@fedora-4gb-hel1-3 nvim]$
I'm not a C dev, have no idea how I could compile it within micromamba, i.e. set some compile flags or so (?)
Would be really good if this could work in micromamba, since I don't have root always to install gcc systemwide...
Update: Found a way
- Uninstalled system's gcc again, installed gcc in micromamba
- Tried to
export CFLAGS=-std=c99
... to no avail, crashing still withstatic_assert
problem :-( micromamba install zig
,export CC=zig
rm ~/.local/share/nvim/lazy/nvim-treesitter/parser/python.so
=> works. Zig is obviously not passing the __STDC_VERSION__
check for using static_asssert
which @amaanq mentioned.
from tree-sitter-python.
Hi,
I ended up ensuring that micromamba was deactivated and compiled the library with the system gcc
. I didn't spend much time investigating why it was causing an issue. It would be nice if it would work with micromamba but I am just happy it doesn't crash now.
from tree-sitter-python.
Micromamba uses gcc 4.4.7, static_assert was officially added in gcc 4.6 which is conditionally checked with __STDC_VERSION__
being greater than 201112L, I don't know if that's a custom gcc fork because static_assert should be available based on that flag being true, yet gcc being 4.4.7. Sorry but I'd take it up with Micromamba
from tree-sitter-python.
Related Issues (20)
- Missing git tag for v0.20.2 HOT 2
- Two nodes with kind "lambda" in 0.20.2 HOT 1
- Parsing error in while loop HOT 3
- Comment parsing HOT 2
- 3.12 "`type`" soft keyword (PEP 0695) HOT 1
- Extra indent when using an open bracket/parenthesis in string literal HOT 1
- Helping injected languages parse docstrings HOT 1
- Parameter highlight group doesn't capture references in body HOT 6
- Trailing comma in Annotated causes an error
- bug: Bad parse/behavior with docstring containing extraneous "-character HOT 1
- feature: doctest support HOT 2
- bug: Fail to parse type expression
- bug: Fail to parse from here but the online playground is fine HOT 1
- bug: release for 0.21.0 HOT 11
- bug: Special case not managed by the parser, when an expression is split without a backslash and the second line is dedented.
- bug: arguments in Callable not marked as types HOT 3
- bug: `.1l` is not valid in python2 HOT 3
- feature: pre-compiled binary wheels for M chip macOS (arm64) HOT 8
- bug: CRLF line ending weirdness on checkout HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from tree-sitter-python.