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

uv pip install llama-cpp-python fails "File exists when symlinking..." #1670

Closed
abetlen opened this issue Aug 8, 2024 · 6 comments
Closed
Labels
bug Something isn't working

Comments

@abetlen
Copy link
Owner

abetlen commented Aug 8, 2024

Steps

uv pip install llama-cpp-python

Output

Failed to download and build `llama-cpp-python==0.2.87`
  Caused by: Failed to extract archive
  Caused by: failed to unpack `/home/andrei/.cache/uv/built-wheels-v3/.tmp5H3yE1/llama_cpp_python-0.2.87/vendor/llama.cpp/spm-headers/ggml-alloc.h`
  Caused by: File exists (os error 17) when symlinking ../ggml/include/ggml-alloc.h to /home/andrei/.cache/uv/built-wheels-v3/.tmp5H3yE1/llama_cpp_python-0.2.87/vendor/llama.cpp/spm-headers/ggml-alloc.h
@abetlen abetlen added the bug Something isn't working label Aug 8, 2024
@charliermarsh
Copy link

Hey @abetlen -- I didn't look into this deeply but I did notice that when I untar the latest source distribution, every entry is repeated (unlike in prior releases):

❯ tar -tf llama_cpp_python-0.2.87.tar.gz | tail
llama_cpp_python-0.2.87/vendor/llama.cpp/tests/test-tokenizer-0.py
llama_cpp_python-0.2.87/vendor/llama.cpp/tests/test-tokenizer-0.sh
llama_cpp_python-0.2.87/vendor/llama.cpp/tests/test-tokenizer-0.sh
llama_cpp_python-0.2.87/vendor/llama.cpp/tests/test-tokenizer-1-bpe.cpp
llama_cpp_python-0.2.87/vendor/llama.cpp/tests/test-tokenizer-1-bpe.cpp
llama_cpp_python-0.2.87/vendor/llama.cpp/tests/test-tokenizer-1-spm.cpp
llama_cpp_python-0.2.87/vendor/llama.cpp/tests/test-tokenizer-1-spm.cpp
llama_cpp_python-0.2.87/vendor/llama.cpp/tests/test-tokenizer-random.py
llama_cpp_python-0.2.87/vendor/llama.cpp/tests/test-tokenizer-random.py
llama_cpp_python-0.2.87/PKG-INFO

So when uv sees the repeated symlink, it tries to write it, but the target already exists.

@abetlen
Copy link
Owner Author

abetlen commented Aug 12, 2024

Hey @charliermarsh thank you so much for taking a look, that helped me narrow down the issue to a bug in scikit-build-core>=0.10.0 that included files twice in the source distribution if they were explicitly included in the pyproject.toml.

@charliermarsh
Copy link

Awesome, I'm glad I could help!

henryiii pushed a commit to scikit-build/scikit-build-core that referenced this issue Aug 13, 2024
Currently if a file matches the explicit `sdist.include` it is included
twice in the source distribution.

This causes an error with some package managers such as `uv` (See
abetlen/llama-cpp-python#1670 (comment)).
@henryiii
Copy link

scikit-build-core 0.10.2 should fix this (thanks to @abetlen)!

@alonsosilvaallende
Copy link

This is solved in version v0.2.88.

@abetlen
Copy link
Owner Author

abetlen commented Aug 13, 2024

@henryiii thanks for the quick merge!

@abetlen abetlen closed this as completed Aug 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

4 participants