astral-sh / uv

An extremely fast Python package and project manager, written in Rust.
https://docs.astral.sh/uv
Apache License 2.0
27.66k stars 796 forks source link

UV 0.5.1 fails to build xgboost #9068

Open blbuford opened 2 weeks ago

blbuford commented 2 weeks ago

Here's a minimum dockerfile to reproduce the error:

FROM python:3.11.9-slim-bookworm
RUN apt-get update \
    && apt-get install -y git build-essential cmake --no-install-recommends \
    && rm -rf /var/lib/apt/lists/*
RUN pip install uv==0.5.1
RUN uv pip install --system --no-cache --no-binary xgboost xgboost==1.5.2

Changing that uv==0.5.1 to uv==0.5.0 makes the docker build -f tmp/uv-fails.Dockerfile . pass. Also up-to-date pip works as well, so I suspect there's something with the newest version of uv.

From what I can see about the error, somewhere in the compilation uv makes some god-awful looking path that exceeds 4096 characters and looks like:

/tmp/.tmphc3YDw/sdists-v6/pypi/xgboost/1.5.2/zwaKdpTMLMT2TpKaD0bTH/src/build/temp.linux-x86_64-cpython-311/xgboost/src/build/temp.linux-x86_64-cpython-311/xgboost/src/build/temp.linux-x86_64-cpython-311/xgboost/src/build/temp.linux-x86_64-cpython-311/xgboost/src/build/temp.linux-x86_64-cpython-311/xgboost/src/build/temp.linux-x86_64-cpython-311/xgboost/src/build/temp.linux-x86_64-cpython-311/xgboost/src/build/temp.linux-x86_64-cpython-311/xgboost/src/build/temp.linux-x86_64-cpython-311/xgboost/src/build/temp.linux-x86_64-cpython-311/xgboost/src/build/temp.linux-x86_64-cpython-311/xgboost/src/build/temp.linux-x86_64-cpython-311/xgboost/src/build/temp.linux-x86_64-cpython-311/xgboost/src/build/temp.linux-x86_64-cpython-311/xgboost/src/build/temp.linux-x86_64-cpython-311/xgboost/src/build/temp.linux-x86_64-cpython-311/xgboost/src/build/temp.linux-x86_64-cpython-311/xgboost/src/build/temp.linux-x86_64-cpython-311/xgboost/src/build/temp.linux-x86_64-cpython-311/xgboost/src/build/temp.linux-x86_64-cpython-311/xgboost/src/build/temp.linux-x86_64-cpython-311/xgboost/src/build/temp.linux-x86_64-cpython-311/xgboost/src/build/temp.linux-x86_64-cpython-311/xgboost/src/build/temp.linux-x86_64-cpython-311/xgboost/src/build/temp.linux-x86_64-cpython-311/xgboost/src/build/temp.linux-x86_64-cpython-311/xgboost/src/build/temp.linux-x86_64-cpython-311/xgboost/src/build/temp.linux-x86_64-cpython-311/xgboost/src/build/temp.linux-x86_64-cpython-311/xgboost/src/build/temp.linux-x86_64-cpython-311/xgboost/src/build/temp.linux-x86_64-cpython-311/xgboost/src/build/temp.linux-x86_64-cpython-311/xgboost/src/build/temp.linux-x86_64-cpython-311/xgboost/src/build/temp.linux-x86_64-cpython-311/xgboost/src/build/temp.linux-x86_64-cpython-311/xgboost/src/build/temp.linux-x86_64-cpython-311/xgboost/src/build/temp.linux-x86_64-cpython-311/xgboost/src/build/temp.linux-x86_64-cpython-311/xgboost/src/build/temp.linux-x86_64-cpython-311/xgboost/src/build/temp.linux-x86_64-cpython-311/xgboost/src/build/temp.linux-x86_64-cpython-311/xgboost/src/build/temp.linux-x86_64-cpython-311/xgboost/src/build/temp.linux-x86_64-cpython-311/xgboost/src/build/temp.linux-x86_64-cpython-311/xgboost/src/build/temp.linux-x86_64-cpython-311/xgboost/src/build/temp.linux-x86_64-cpython-311/xgboost/src/build/temp.linux-x86_64-cpython-311/xgboost/src/build/temp.linux-x86_64-cpython-311/xgboost/src/build/temp.linux-x86_64-cpython-311/xgboost/src/build/temp.linux-x86_64-cpython-311/xgboost/src/build/temp.linux-x86_64-cpython-311/xgboost/src/build/temp.linux-x86_64-cpython-311/xgboost/src/build/temp.linux-x86_64-cpython-311/xgboost/src/build/temp.linux-x86_64-cpython-311/xgboost/src/build/temp.linux-x86_64-cpython-311/xgboost/src/build/temp.linux-x86_64-cpython-311/xgboost/src/build/temp.linux-x86_64-cpython-311/xgboost/src/build/temp.linux-x86_64-cpython-311/xgboost/src/build/temp.linux-x86_64-cpython-311/xgboost/src/build/temp.linux-x86_64-cpython-311/xgboost/src/build/temp.linux-x86_64-cpython-311/xgboost/src/build/temp.linux-x86_64-cpython-311/xgboost/src/build/temp.linux-x86_64-cpython-311/xgboost/src/build/temp.linux-x86_64-cpython-311/xgboost/src/build/temp.linux-x86_64-cpython-311/xgboost/src/build/temp.linux-x86_64-cpython-311/xgboost/src/build/temp.linux-x86_64-cpython-311/xgboost/src/build/temp.linux-x86_64-cpython-311/xgboost/src/build/temp.linux-x86_64-cpython-311/xgboost/src/build/temp.linux-x86_64-cpython-311/xgboost/src/build/temp.linux-x86_64-cpython-311/xgboost/src/build/temp.linux-x86_64-cpython-311/xgboost/src/build/temp.linux-x86_64-cpython-311/xgboost/src/build/temp.linux-x86_64-cpython-311/xgboost/src/build/temp.linux-x86_64-cpython-311/xgboost/src/build/temp.linux-x86_64-cpython-311/xgboost/src/build/temp.linux-x86_64-cpython-311/xgboost/src/build/temp.linux-x86_64-cpython-311/xgboost/src/build/temp.linux-x86_64-cpython-311/xgboost/src/build/temp.linux-x86_64-cpython-311/xgboost/src/build/temp.linux-x86_64-cpython-311/xgboost/src/build/temp.linux-x86_64-cpython-311/xgboost/src/build/temp.linux-x86_64-cpython-311/xgboost/src/xgboost/dmlc-core/src/data/basic_row_iter.h

Let me know if you need any more info! Thanks for taking a look.

zanieb commented 2 weeks ago

Hm we changed some build behaviors in an attempt to make the file paths shorter, cc @charliermarsh

charliermarsh commented 2 weeks ago

It may not be related -- the path here seems to be repeated infinitely for some reason (src/build/temp.linux-x86_64-cpython-311/xgboost).

zanieb commented 2 weeks ago

Hm I can't think of another reason it'd regress though?

charliermarsh commented 2 weeks ago

I didn't see that it regressed. You're right, it's probably related.

charliermarsh commented 2 weeks ago

So I don't really understand the problem yet, but if you change the directory name from src to xyz in our build cache, it works...

charliermarsh commented 2 weeks ago

I think the problem is that they seem to create some sort of scratch directory at ../src. But we build from a directory named src. So it's specific to XGBoost...

zanieb commented 2 weeks ago

That's pretty particular. It seems naughty of them to escape their build directory like that. I think it's worth opening an upstream issue?

charliermarsh commented 2 weeks ago

I might be misunderstanding, it could be a problem on our end. Need to look at the source.

charliermarsh commented 2 weeks ago

Ah actually, I can't replicate this with latest XGBoost:

FROM python:3.11.9-slim-bookworm
RUN apt-get update \
    && apt-get install -y git build-essential cmake --no-install-recommends \
    && rm -rf /var/lib/apt/lists/*
RUN pip install uv==0.5.1
RUN uv pip install --system --no-cache --no-binary xgboost xgboost

I think this is really an issue with XGBoost that seems to have been fixed. I'm a little hesitant to make changes in light of that.

blbuford commented 2 weeks ago

Bummer. Why does up-to-date pip work on that, but uv does not? E.g. this works:

FROM python:3.11.9-slim-bookworm
RUN apt-get update \
    && apt-get install -y git build-essential cmake --no-install-recommends \
    && rm -rf /var/lib/apt/lists/*
RUN pip install --upgrade pip && pip install --no-cache --no-binary xgboost xgboost==1.5.2
zanieb commented 2 weeks ago

They probably do not use the same build directory naming scheme as us.