Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 932626 - dev-libs/tree-sitter-cpp (and friends): doesn't respect CC
Summary: dev-libs/tree-sitter-cpp (and friends): doesn't respect CC
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal
Assignee: Matthew Smith
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: tc-directly
  Show dependency tree
 
Reported: 2024-05-24 10:23 UTC by Sam James
Modified: 2024-07-05 11:03 UTC (History)
2 users (show)

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


Attachments
eclass fix (fix-tree-sitter-cc.diff,507 bytes, patch)
2024-05-24 10:28 UTC, Arthur Zamarin
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Sam James archtester Gentoo Infrastructure gentoo-dev Security 2024-05-24 10:23:57 UTC
It doesn't seem to respect CC:
```
[...]
>>> Compiling source in /var/tmp/portage/dev-libs/tree-sitter-cpp-0.22.0/work/tree-sitter-cpp-0.22.0 ...
make -j80 STRIP= PREFIX=/usr LIBDIR=/usr/lib64
sed  -e 's|@URL@||' \
        -e 's|@VERSION@|0.22.0|' \
        -e 's|@LIBDIR@|/usr/lib64|' \
        -e 's|@INCLUDEDIR@|/usr/include|' \
        -e 's|@REQUIRES@||' \
        -e 's|@ADDITIONAL_LIBS@||' \
        -e 's|=/usr|=${prefix}|' \
        -e 's|@PREFIX@|/usr|' bindings/c/tree-sitter-cpp.pc.in > tree-sitter-cpp.pc
cc -O3 -pipe -mcpu=native -fdiagnostics-color=always -ggdb3 -flto -fno-vect-cost-model -U_FORTIFY_SOURCE -fno-hardened -fpermissive -Isrc -std=c11 -fPIC   -c -o src/scanner.o src/scanner.c
cc -O3 -pipe -mcpu=native -fdiagnostics-color=always -ggdb3 -flto -fno-vect-cost-model -U_FORTIFY_SOURCE -fno-hardened -fpermissive -Isrc -std=c11 -fPIC   -c -o src/parser.o src/parser.c
ar rcs libtree-sitter-cpp.a src/parser.o src/scanner.o
cc -Wl,-O1 -Wl,--as-needed -Wl,--defsym=__gentoo_check_ldflags__=0 -shared -Wl,-soname,libtree-sitter-cpp.so.0 src/parser.o src/scanner.o  -o libtree-sitter-cpp.so
[...]
```
Comment 1 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2024-05-24 10:24:12 UTC
Sorry for the lack of full log, hopefully it's obvious. If not, I can get the logs later, heading out now.
Comment 2 Arthur Zamarin archtester Gentoo Infrastructure gentoo-dev Security 2024-05-24 10:28:20 UTC
Created attachment 894204 [details, diff]
eclass fix

This is the eclass fix for now, I don't have the capacity to send to ML for now. Since this is trivial oneline, feel free to drop attribute if you want.
Comment 3 Agostino Sarubbo gentoo-dev 2024-05-24 10:43:36 UTC
from my records on CI, it works for me.

if you emerge it with USE="-native-symlinks" it fails, but if you set CC in package.env it works for me.

Usually I file bugs for unrespected CC when with USE="-native-symlinks" + CC="x86_64-pc-linux-gnu-gcc" the build still looks for cc/gcc.
Comment 4 Larry the Git Cow gentoo-dev 2024-07-05 11:03:03 UTC
The bug has been closed via the following commit(s):

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

commit f4d5509345750e68f3c8d76b360e9e26a1ccc35f
Author:     Arthur Zamarin <arthurzam@gentoo.org>
AuthorDate: 2024-06-12 07:09:33 +0000
Commit:     Arthur Zamarin <arthurzam@gentoo.org>
CommitDate: 2024-07-05 10:55:38 +0000

    tree-sitter-grammar.eclass: respect CC & AR
    
    Closes: https://bugs.gentoo.org/932626
    Signed-off-by: Arthur Zamarin <arthurzam@gentoo.org>
    Signed-off-by: Brahmajit Das <brahmajit.xyz@gmail.com>
    Closes: https://github.com/gentoo/gentoo/pull/37122
    Signed-off-by: Arthur Zamarin <arthurzam@gentoo.org>

 eclass/tree-sitter-grammar.eclass | 2 ++
 1 file changed, 2 insertions(+)