-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Open
Description
Describe the bug
Building projects that depend on dgraph-io/ristretto/v2 (such as dgraph-io/badger/v4 in this case) fails on a standard Ubuntu installation due to a CGO linking error with the jemalloc library, even when libjemalloc-dev is installed.
To Reproduce
Steps to reproduce the behavior:
sudo apt install libjemalloc-dev
- git clone https://github.com/hypermodeinc/badger.git
cd badger
./tesh.sh
- See error
Expected behavior
The Ristretto library should compile successfully with the standard go build command when libjemalloc-dev is installed. The CGO configuration should automatically include the required linker flags to resolve the C function symbols.
Screenshots
$ ./test.sh
go version go1.25.0 linux/amd64
./test.sh: line 8: [: =: unary operator expected
/tmp/badger/badger /tmp/badger
github.com/dgraph-io/ristretto/v2/z
# github.com/dgraph-io/ristretto/v2/z
/home/foobar/go/pkg/mod/github.com/dgraph-io/ristretto/[email protected]/z/calloc_jemalloc.go:74:9: could not determine what C.je_calloc refers to
/home/foobar/go/pkg/mod/github.com/dgraph-io/ristretto/[email protected]/z/calloc_jemalloc.go:104:3: could not determine what C.je_free refers to
/home/foobar/go/pkg/mod/github.com/dgraph-io/ristretto/[email protected]/z/calloc_jemalloc.go:144:2: could not determine what C.je_mallctl refers to
/home/foobar/go/pkg/mod/github.com/dgraph-io/ristretto/[email protected]/z/calloc_jemalloc.go:171:2: could not determine what C.je_malloc_stats_print refers to
Environment
- OS: Ubuntu 25.04
- Language: go version go1.25.0 linux/amd64
Additional context
None.
Metadata
Metadata
Assignees
Labels
No labels