Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 943666 - dev-util/rizin-0.7.3-r1: failed to parse signatures with system dev-libs/tree-sitter
Summary: dev-util/rizin-0.7.3-r1: failed to parse signatures with system dev-libs/tree...
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal
Assignee: John Helmert III
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2024-11-17 13:27 UTC by Azamat H. Hackimov
Modified: 2024-12-15 17:28 UTC (History)
7 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Azamat H. Hackimov 2024-11-17 13:27:36 UTC
After installation rizin throws numerous warnings about failing to parse own signatures:

rizin -A /usr/bin/true
error parsing "wmemcmp" func arg type "wchar_t*": 
error parsing "erff" func arg type "float": 
error parsing "erfc" func arg type "double": 
error parsing "erfl" func arg type "long double": 
error parsing "asin" func arg type "double": 
error parsing "ldexpf" func arg type "float": 
error parsing "ldexpl" func arg type "long double": 
error parsing "fetestexcept" func arg type "int": 
error parsing "wscanf" func arg type "const wchar_t*": 
error parsing "getuid" func return type "uid_t":  
error parsing "imaxdiv" func arg type "intmax_t": 
error parsing "asinf" func arg type "float": 
error parsing "isgraph" func arg type "int": 
error parsing "asinh" func arg type "double": 
error parsing "vsprintf" func arg type "char*": 
error parsing "asinl" func arg type "long double": 
...


If compile rizin with -Duse_sys_tree_sitter=disabled (and unmerge dev-libs/tree-sitter and dev-libs/tree-sitter-c), parsing is correct. Bundled tree-sitter is 0.21.0 while system provides 0.23.0. Seems there some breaking changes between these two versions.
Comment 1 John Helmert III archtester Gentoo Infrastructure gentoo-dev Security 2024-12-15 03:16:27 UTC
I think this is actually not due to changes in tree-sitter, but an exposure of rizin's dependency on a fork of tree-sitter-c, which is used if -Duse_sys_tree_sitter=disabled and tree-sitter{-c,} aren't available (which is how you got it fixed by toggling those), and I tried patching in newer tree-sitters and couldn't reproduce.

I think it's unfortunately untenable to use system tree-sitter at this point as it's clearly not supported.
Comment 2 John Helmert III archtester Gentoo Infrastructure gentoo-dev Security 2024-12-15 03:18:57 UTC
(In reply to John Helmert III from comment #1)
> I think it's unfortunately untenable to use system tree-sitter at this point
> as it's clearly not supported.

Sorry, I meant tree-sitter*-c*. System tree-sitter *should* still be fine.
Comment 3 Larry the Git Cow gentoo-dev 2024-12-15 04:57:45 UTC
The bug has been referenced in the following commit(s):

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=1c28e908cbcf88be92d030870e17574408cb455d

commit 1c28e908cbcf88be92d030870e17574408cb455d
Author:     John Helmert III <ajak@gentoo.org>
AuthorDate: 2024-12-15 04:51:49 +0000
Commit:     John Helmert III <ajak@gentoo.org>
CommitDate: 2024-12-15 04:52:24 +0000

    dev-util/rizin: depend on libpcre2[jit], force bundled tree-sitter-c
    
    Rizin can automagically pick up a dependency on an incompatible
    system-tree-sitter-c, so instead force usage of the forked
    subproject. Note that I'm patching this as a one-off in this version
    since the forked package has been renamed upstream and thus this
    should be obsolete by the next release.
    
    Also add a dependency on libpcre2[jit], since Rizin automagically
    enables usage of it based on the target architecture, and we're not
    keyworded for anywhere that doesn't have support except for x32, for
    which usage is likely exceedingly rare (if existent).
    
    Bug: https://bugs.gentoo.org/943666
    Closes: https://bugs.gentoo.org/945113
    Signed-off-by: John Helmert III <ajak@gentoo.org>

 .../rizin-0.7.3-force-local-tree-sitter-c.patch    |  22 +++++
 .../rizin-0.7.3-tree-sitter-underlinking.patch     |  31 +++++++
 dev-util/rizin/rizin-0.7.3-r2.ebuild               | 101 +++++++++++++++++++++
 profiles/arch/amd64/x32/package.mask               |   4 +
 4 files changed, 158 insertions(+)
Comment 4 John Helmert III archtester Gentoo Infrastructure gentoo-dev Security 2024-12-15 05:21:50 UTC
Does this -r2 look better to you?
Comment 5 Azamat H. Hackimov 2024-12-15 13:07:44 UTC
Looks good, no more "error parsing" warnings.
Comment 6 John Helmert III archtester Gentoo Infrastructure gentoo-dev Security 2024-12-15 17:28:14 UTC
Great, thanks!