-
Notifications
You must be signed in to change notification settings - Fork 1k
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
[fix] The deployer runtime_deploy should preserve symlinks #17824
[fix] The deployer runtime_deploy should preserve symlinks #17824
Conversation
Signed-off-by: Uilian Ries <[email protected]>
Signed-off-by: Uilian Ries <[email protected]>
Signed-off-by: Uilian Ries <[email protected]>
Signed-off-by: Uilian Ries <[email protected]>
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.
Looking good!
@pytest.mark.parametrize("symlink, expected", | ||
[(True, ["libfoo.so.0.1.0", "libfoo.so.0", "libfoo.so"]), | ||
(False, ["libfoo.so.0.1.0",])]) | ||
def test_runtime_deploy_symlinks(symlink, expected): |
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.
Shouldnt this test be skipped for Windows?
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.
It could be skipped for Windows, but keeping it we make sure we are not breaking in Windows as a regression test.
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.
Isee, this test will fail in Windows machines without symlinks enabled:
>>> os.symlink("potato", "mypotato")
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
OSError: [WinError 1314] A required privilege is not held by the client
It passes because in our CI maybe we enabled it, it is not the default.
But ok, if it works in Windows if symlinks enabled, good then, I'll try to remind it when running locally.
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.
A comment will be nice
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.
Should we protect users by checking if symlink is enabled in Windows and avoid copying symlinks. Or, raise a ConanException when symlinks=True and Windows symlinks is not enabled. At least, it would not break with a OSError for users.
Co-authored-by: James <[email protected]>
Signed-off-by: Uilian Ries <[email protected]>
Signed-off-by: Uilian Ries <[email protected]>
Signed-off-by: Uilian Ries <[email protected]>
Changelog: Fix: runtime_deploy preserves symbolic links along with their libraries.
Docs: conan-io/docs#3992
When some application links to a shared on Linux, it keeps its name expected to be loaded at runtime. The current
runtime_deploy
only provides*.so
but doesn't preserve original symlinks, failing the application when running.Still, there is a case of preserving subfolders in the structure, but I don't want to include it in this PR to keep it as simple as possible.
Related to #16938
develop
branch, documenting this one.