Skip to content

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.

@Torrekie Torrekie force-pushed the patch-per-target-env branch from b316bf7 to c2234c2 Compare June 17, 2024 10:00
Torrekie and others added 2 commits June 17, 2024 18:06
Signed-off-by: Torrekie <[email protected]>
@Torrekie Torrekie force-pushed the patch-per-target-env branch from c2234c2 to 88b54a4 Compare June 17, 2024 10:08
@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
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