-
Notifications
You must be signed in to change notification settings - Fork 17
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
If system dotnet version is higher than dotnetcore2 runtime one, use that. #21
Conversation
The dotenetcore2-packaged runtime fails on Ubuntu 19+, claiming it doesn't find a supported libssl. dotnetcore 3 is not available on pypi. This PR at allows users to work around the issue by installing dotnet-sdk-3.1 manually in their system, artifacts-keyring will give precedence to a newer dotnet system binary.
Any movement on this? I cannot use my azure pypi on wsl Ubuntu because of this issue. |
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.
Suggested some simplifying changes that I haven't fully tested, but it should avoid adding the new dependency.
Co-authored-by: Steve Dower <steve.dower@microsoft.com>
@zooba thanks for the suggestion. I'm not sure how much it affects robustness, but maybe it's worth it. I applied your changes and added a minor fix for |
@zooba any remaining blockers for merging this? |
@@ -32,7 +33,19 @@ def __init__(self): | |||
self.exe = [tool_path] | |||
else: | |||
try: | |||
from dotnetcore2.runtime import get_runtime_path | |||
sys_version = tuple(int(i) for i in | |||
subprocess.check_output(["dotnet", "--version"]).decode().strip().partition("-")[0].split(".")) |
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.
Coding by exception anti-pattern here, but l guess it simplifies the flow.
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.
@aasim If anything, this is the opposite of coding by exception because we're handling too broad a base class. We could have replaced except Exception
below with except (subprocess.CalledProcessError, OSError, TypeError, ValueError, OverflowError, UnicodeDecodeError)
to handle all the possibilities, but there's really nothing gained by that.
Also, exception handling in general is not an anti-pattern in Python. It's often more efficient than look-before-you-leap style (unlike say, .NET, which is wildly inefficient).
The dotenetcore2-packaged runtime fails on Ubuntu 19+, claiming it
doesn't find a supported libssl. dotnetcore 3 is not available on pypi (#20).
This PR at allows users to work around the issue by installing
dotnet-sdk-3.1 manually in their system, artifacts-keyring will give
precedence to a newer dotnet system binary.
Note that artifacts-credprovider actually recommends using dotnetcore v3.1:
https://github.com/Microsoft/artifacts-credprovider/#prerequisites