ruff icon indicating copy to clipboard operation
ruff copied to clipboard

PowerPC pip package is not suitable for systems with 64 KiB pages

Open nwf opened this issue 1 year ago • 3 comments

I'm not sure if this is the right place; if not, please point me in the right direction and sorry for the noise.

Trying to run the pip packaged ruff on Debian 12.2 on a PowerPC LE system (in Docker, on a Raptor Computing Talos II workstation, if it matters) whose uname -a describes itself as Linux 0abaa1dc35a7 6.1.0-13-powerpc64le #1 SMP Debian 6.1.55-1 (2023-09-29) ppc64le GNU/Linux results in a very short trip:

root@0abaa1dc35a7:/# python3 -m venv /root/venv

root@0abaa1dc35a7:/# /root/venv/bin/pip3 install ruff
Collecting ruff
  Using cached ruff-0.2.2-py3-none-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl (8.2 MB)
Installing collected packages: ruff
Successfully installed ruff-0.2.2

root@0abaa1dc35a7:/# /root/venv/bin/ruff
<jemalloc>: Unsupported system page size
<jemalloc>: Unsupported system page size
memory allocation of 5 bytes failed
Aborted (core dumped)

Debian builds their PowerPC kernels to use 64 KiB pages; /boot/config-$(uname -r) contains

# CONFIG_PPC_4K_PAGES is not set
CONFIG_PPC_64K_PAGES=y
CONFIG_PAGE_SIZE_64KB=y
CONFIG_PPC_PAGE_SHIFT=16

~~I suspect that~~ configuring jemalloc to assume 64 KiB pages will allow it to also function on 4 KiB page systems: https://github.com/jemalloc/jemalloc/issues/2572#issuecomment-1823559681

nwf avatar Feb 21 '24 18:02 nwf

I think this is the same root cause as https://github.com/astral-sh/ruff/issues/3791#issuecomment-1489722670

The difference is that you're building from source. So you would have to set the env variable yourself as far as I understand. @konstin or is there a way for us to set an env variable in the wheel code?

MichaReiser avatar Feb 21 '24 21:02 MichaReiser

I didn't mean to be building from source. I see that the log I attached above was the second time through so pip said "Using cached" rather than "Downloading" but it definitely downloaded the first time:

root@0abaa1dc35a7:/# python3 -m venv /usr/local/pyvenv && /usr/local/pyvenv/bin/pip3 install ruff
Collecting ruff
  Downloading ruff-0.2.2-py3-none-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl (8.2 MB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 8.2/8.2 MB 11.1 MB/s eta 0:00:00

nwf avatar Feb 21 '24 21:02 nwf

is there a way for us to set an env variable in the wheel code?

maturin doesn't support this atm, but it should be passed through if you set it outside the build command.

konstin avatar Feb 22 '24 09:02 konstin