Have you tried Ristretto before this proposal? and did not find anything similar?
None
What you wanted to do.
Comment or remove #cgo LDFLAGS: line so that go install/build will use CGO_LDFLAGS.
What you actually did.
I have a package A that uses https://github.com/open-policy-agent/opa which internally uses https://github.com/dgraph-io/badger which then uses https://github.com/dgraph-io/ristretto.
A -> https://github.com/open-policy-agent/opa -> https://github.com/dgraph-io/badger ->https://github.com/dgraph-io/ristretto
https://github.com/dgraph-io/ristretto.Z has 2 files z.calloc_nojemalloc and z.calloc_jemalloc . right now when I build package A we are not passing any tag which causes dgraph-io/ristretto to use default calloc implementation. now we want to use jemalloc and thus to enable we need to pass -tags=jemalloc which will build that z.calloc_jemalloc.
z.jemalloc_calloc.go has hardcoded path on how to get libraries once jemalloc is installed (https://github.com/dgraph-io/ristretto/blob/main/z/calloc_jemalloc.go#L10-L12). Since installing jemalloc requires sudo permission as part of ./configure --install-with-prefix=_je, our build system cannot have permission to install and put files under /usr/local/lib. Hence we tried multiple options to use CGO-FLAGS that can override the hardcoded path but it is not getting overriden.
Have you tried Ristretto before this proposal? and did not find anything similar?
None
What you wanted to do.
Comment or remove
#cgo LDFLAGS:
line so that go install/build will useCGO_LDFLAGS
.What you actually did.
I have a package A that uses
https://github.com/open-policy-agent/opa
which internally useshttps://github.com/dgraph-io/badger
which then useshttps://github.com/dgraph-io/ristretto
.A -> https://github.com/open-policy-agent/opa -> https://github.com/dgraph-io/badger ->https://github.com/dgraph-io/ristretto
https://github.com/dgraph-io/ristretto.Z
has 2 filesz.calloc_nojemalloc
andz.calloc_jemalloc
. right now when I build packageA
we are not passing any tag which causesdgraph-io/ristretto
to use default calloc implementation. now we want to usejemalloc
and thus to enable we need to pass -tags=jemalloc
which will build thatz.calloc_jemalloc
.z.jemalloc_calloc.go
has hardcoded path on how to get libraries once jemalloc is installed (https://github.com/dgraph-io/ristretto/blob/main/z/calloc_jemalloc.go#L10-L12). Since installing jemalloc requires sudo permission as part of./configure --install-with-prefix=_je
, our build system cannot have permission to install and put files under/usr/local/lib
. Hence we tried multiple options to useCGO-FLAGS
that can override the hardcoded path but it is not getting overriden.Why wasn't it great, with examples.
No response
Additional information.
No response