Skip to content

Install does not preserve symlink #492

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

Closed
LecrisUT opened this issue Sep 12, 2023 · 5 comments
Closed

Install does not preserve symlink #492

LecrisUT opened this issue Sep 12, 2023 · 5 comments

Comments

@LecrisUT
Copy link
Collaborator

LecrisUT commented Sep 12, 2023

Just quickly writing the issue before looking more carefully. Basically I've noticed that at least on muslinux, the symlinks are not maintained and instead the linked files are copied

FROM python:alpine

RUN apk update
RUN apk add musl-dev gcc linux-headers cmake neovim bash
RUN pip install spglib
@henryiii
Copy link
Collaborator

Symlinks are not supported by CPython’s standard library in zipfile. Wheels are just zip files.

@LecrisUT
Copy link
Collaborator Author

Hmm, bummer. Zip files themselves support symlinks though right? Is python/cpython#107845 supposed to fix that, or that is just for the build and not for the archiving?

@henryiii
Copy link
Collaborator

henryiii commented Sep 12, 2023

That’s tarfile (and security related). The issue is with zipfile, tarfile does support them. There’s a 10+ year old bug report about it somewhere. Now that windows simlink support is a lot better, I think it should be revisited. But it hasn’t afaik.

I’ve also seen a third-party library that support symlinks in zipfiles. But pip doesn’t use it.

pep 660 mentions this bug.

(and yes, zip itself supports symlinks)

@henryiii
Copy link
Collaborator

There are older issues, but this seems to be the tracking issue: python/cpython#82102

Looks like it was on hold until security issues could be worked out with tar file. But I think those were worked out.

@LecrisUT
Copy link
Collaborator Author

Should be supported automatically when that issue is resolved right?

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

No branches or pull requests

2 participants