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
let deploy generator install symlinks #7044
let deploy generator install symlinks #7044
Conversation
I am trying to fix this for 1.25.2. I have added some more tests instead of modifying existing to check all behaviors are addressed. Also, I am unconditionally removing the |
conans/client/generators/deploy.py
Outdated
if not os.path.isabs(link_target): | ||
link_target = os.path.join(os.path.dirname(src), link_target) | ||
linkto = os.path.relpath(link_target, os.path.dirname(src)) | ||
if os.path.isfile(dst): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks wrong. When dst is link already isfile return False, when dst is broken link exists return False too. We need to do os.path.exists(dst) or os.path.islink(dst)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have added it, together with more tests. Actually it was not necessary, because the os.symlink()
actually works when it is a broken symlink. But I agree it is more evident to explicitly remove it here. Please check again, thanks!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@memsharded looks good now
Changelog: Bugfix: Fix deploy generator management of relative symlinks.
Docs: Omit
Close #7037
Supersedes #7036 also taking the #6994 to Conan 1.25.2