Firstyear / obs-service-cargo

OBS Source Service and utilities for Rust software packaging
Mozilla Public License 2.0
16 stars 9 forks source link

Invalid symlink exceptions #32

Closed QaidVoid closed 1 year ago

QaidVoid commented 1 year ago

By default, copytree function in shutil copies the linked file instead of the symlink, which throws an exception if there is invalid symlink. This seems to cause issue with packages that provide invalid symlink. For instance, xh provides assets/xhs and assets/xhs.1.gz which are invalid symlinks, resulting in cargo_vendor service to fail.

I'm not really sure about the benefits of copying the linked file instead of the symlink. So, just copying the original symlink seems like a good solution to me. Or, provide symlink param to allow setting it manually (which I've been using for now).

Firstyear commented 1 year ago

I'm not sure there is a benefit to leaving it false then tbh. I think symlink defaulting to true sounds like the right move here to allow the vendoring to be exactly represented as it was created. Can you see any potential issues with symlink=true in copytree?

QaidVoid commented 1 year ago

I guess there won't be any issue with using symlink=true. So, setting it by default should be the best option.

Firstyear commented 1 year ago

Thanks, I've made that change and I'll update it in obs asap.