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: CONFIRMED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal (vote)
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-05-24 10:43 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.