python-poetry / poetry

Python packaging and dependency management made easy
https://python-poetry.org
MIT License
31.59k stars 2.26k forks source link

Cannot install package from git on Windows if repository contains symlinks #7798

Open bruchar1 opened 1 year ago

bruchar1 commented 1 year ago

poetry add git+https://github.com/mesonbuild/meson.git does not work on Windows, because it tries to create a symlink.

However, I can git clone this repository with no problems, and I can install it with pip with no problems (pip install git+https://github.com/mesonbuild/meson.git).

This was reported in #6246. However, I do think this is a poetry bug, since pip can manage it with no problems.

dimbleby commented 1 year ago

you didn't provide output, so no-one can see what the problem is.

If this is truly a duplicate of #6246 then it can be closed for the same reasons that one is closed, TLDR being that if a fix can be made it must be made in dulwich so please raise the issue there.

bruchar1 commented 1 year ago

λ poetry add git+https://github.com/mesonbuild/meson.git Creating virtualenv mt-fT1b7t6V-py3.10 in C:\Users\charles.brunet\AppData\Local\pypoetry\Cache\virtualenvs

[WinError 1314] Le client ne dispose pas d’un privilège nécessaire: '../Cellar/boost/0.3.0/include/boost' -> 'C:\Users\charles.brunet\AppData\Local\pypoetry\Cache\virtualenvs\mt-fT1b7t6V-py3.10\src\meson\test cases\frameworks\35 boost symlinks\boost\include\boost'

The message is in French, but it means: "Client has no required privileges".

This has nothing to do with dulwich, it is simply a different example of the same symptoms. It cannot be solved in meson repo, because those symlinks are needed for testing.

dimbleby commented 1 year ago

It cannot be solved in meson repo

no-one suggested that.

dulwich is poetry's default git client. If you provided output with -vvv as the issue template asks, I expect you would see that this failure is raised from that library.

clintonroy commented 1 year ago

I'm not a windows person, but i think regular users can't make symlinks on windows, hence the permissions error. What does the git checkout do? make the symlink? resolve it? elide it?

bruchar1 commented 1 year ago

Sorry for the confusion. I didn't realized what dulwich was...

Yes, symlinks on Windows require elevated privileges.

git writes a text file containing the path pointed by the symlink.

jelmer commented 1 year ago

This should be resolved by https://github.com/jelmer/dulwich/pull/1171