Skip to content

Conversation

@WhyNotHugo
Copy link
Contributor

The version compiled by tikv_jemallocator by default assumes 16K pages, and doesn't work on systems which have 64K pages.

Link the system jemalloc to ensure we ruff always uses a compatible jemalloc which aligns with local system conventions.

We're currently shipping this patch downstream as otherwise builds simply don't work on systems with 64K pages.

The version compiled by tikv_jemallocator by default assumes 16K pages,
and doesn't work on systems which have 64K pages.

Link the system jemalloc to ensure we ruff always uses a compatible
jemalloc which aligns with local system conventions.
@MichaReiser
Copy link
Member

MichaReiser commented Nov 2, 2025

I'm far from an expert on this but the way we solve this in our own built pipeline is by setting JEMALLOC_SYS_WITH_LG_PAGE=16. We haven't had any issues since we increased the page size.

maturin_docker_options: -e JEMALLOC_SYS_WITH_LG_PAGE=16

@WhyNotHugo
Copy link
Contributor Author

That workaround only affects builds made by CI, not builds made downstream with release tarballs.

@WhyNotHugo
Copy link
Contributor Author

Configuring the build system in releases to use JEMALLOC_SYS_WITH_LG_PAGE=16 would also work, but most distributions prefer using the system jemalloc regardless, so doing that is likely a better fit.

@MichaReiser
Copy link
Member

but what if the target system doesn't have jemalloc installed. Wouldn't the build fail in that case?

@WhyNotHugo WhyNotHugo marked this pull request as draft November 2, 2025 02:56
@WhyNotHugo
Copy link
Contributor Author

Hang on though, looks like this final syntax isn't working the same as my previous approach.

@WhyNotHugo
Copy link
Contributor Author

The following works:

Okay, this works:

[target.x86_64-alpine-linux-musl.jemalloc]

But this does not:

[target.'cfg(all(target_env = "musl", target_os = "linux"))'.jemalloc]

I'm not entirely sure why. Maybe we'll need another approach to address this.

@WhyNotHugo
Copy link
Contributor Author

but what if the target system doesn't have jemalloc installed. Wouldn't the build fail in that case?

Right, jemalloc would need to be installed like all other build dependencies. I don't think there's any musl-based distribution which doesn't ship jemalloc.

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.

2 participants