fix(jemalloc-sys): pin --libdir to avoid distro site-script lib64 redirect - #181
Draft
rtyler wants to merge 1 commit into
Draft
fix(jemalloc-sys): pin --libdir to avoid distro site-script lib64 redirect#181rtyler wants to merge 1 commit into
rtyler wants to merge 1 commit into
Conversation
…irect
Some Linux distributions ship an autoconf site-script
(/usr/share/site/<triple>) that silently rewrites the configured libdir
from `${prefix}/lib` to `${prefix}/lib64` for 64-bit hosts (e.g. the
OpenSUSE aarch64 site script). jemalloc is compiled via `./configure`
inside the build script, so its static libraries end up in
`$OUT_DIR/lib64`. However, build.rs hard-codes the link-search path as
`$OUT_DIR/lib`, so cargo can't find `libjemalloc_pic.a` and the build
fails with:
error: could not find native static library `jemalloc_pic`,
perhaps an -L flag is missing?
Fix: pass `--libdir=${out_dir}/lib` explicitly to configure. This
overrides any site-script redirect and keeps the installed path
consistent with the search path already emitted by build.rs.
Reproduces on: OpenSUSE Leap 16 aarch64 (site script at
/usr/share/site/aarch64-unknown-linux-gnu).
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Signed-off-by: R Tyler Croy <rtyler@buoyantdata.com>
|
Important Draft PR not reviewedDraft PRs are not automatically reviewed by default.
To automatically review draft PRs, update your CodeRabbit configuration: reviews:
auto_review:
drafts: trueThanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
Welcome @rtyler! It looks like this is your first PR to tikv/jemallocator 🎉 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This was a 🦜 generated fix to a build error that has been buggin' the heck out of me in delta-io/delta-rs when using aarch64 machines.
Some Linux distributions ship an autoconf site-script (/usr/share/site/) that silently rewrites the configured libdir from
${prefix}/libto${prefix}/lib64for 64-bit hosts (e.g. the OpenSUSE aarch64 site script). jemalloc is compiled via./configureinside the build script, so its static libraries end up in$OUT_DIR/lib64. However, build.rs hard-codes the link-search path as$OUT_DIR/lib, so cargo can't findlibjemalloc_pic.aand the build fails with:error: could not find native static library
jemalloc_pic,perhaps an -L flag is missing?
Fix: pass
--libdir=${out_dir}/libexplicitly to configure. This overrides any site-script redirect and keeps the installed path consistent with the search path already emitted by build.rs.Reproduces on: OpenSUSE Leap 16 aarch64 (site script at /usr/share/site/aarch64-unknown-linux-gnu).