Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

allow per-target env detection #91

Merged
merged 4 commits into from
Jul 14, 2024
Merged

Conversation

Torrekie
Copy link

This fixes #90.

It allows all environment variables that detected by read_and_watch_env and read_and_watch_env_os to be general or target-specific, which allows some unavoidable cross-compiling scene.

When compiling jemalloc-sys under Cargo projects, TARGET is set. Variables can be set as target-specific in the form of <TARGET_TRIPLE>_MYENV. For example, AARCH64_APPLE_IOS_JEMALLOC_OVERRIDE will set JEMALLOC_OVERRIDE when cargo is targeting aarch64-apple-ios, which is not affecting other targets.

When AARCH64_APPLE_IOS_JEMALLOC_OVERRIDE and JEMALLOC_OVERRIDE are both set, the build.rs will prefer prefixed one instead of the non-prefixed one. The unprefixed one would only be used when target-specific one is not set.

jemalloc-sys/build.rs Outdated Show resolved Hide resolved
Torrekie and others added 2 commits June 17, 2024 18:06
Signed-off-by: Torrekie <[email protected]>
jemalloc-sys/build.rs Outdated Show resolved Hide resolved
jemalloc-sys/build.rs Outdated Show resolved Hide resolved
@BusyJay
Copy link
Member

BusyJay commented Jun 21, 2024

You can ignore the aarch64 failure. The clippy failure is not related to your change, but if you can fix it in this PR we can merge it all together.

Copy link
Member

@BusyJay BusyJay left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@BusyJay BusyJay merged commit 2fde3d8 into tikv:main Jul 14, 2024
8 of 9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Allow per-target JEMALLOC_OVERRIDE env
2 participants