Skip to content
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

Merged
merged 5 commits into from
Sep 24, 2020

Conversation

temporaer
Copy link
Contributor

@temporaer temporaer commented May 27, 2020

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

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.
@bpeake-illuscio
Copy link

Any movement on this? I cannot use my azure pypi on wsl Ubuntu because of this issue.

@keyz182 keyz182 mentioned this pull request Jul 1, 2020
Copy link
Member

@zooba zooba left a 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.

src/artifacts_keyring/plugin.py Outdated Show resolved Hide resolved
src/artifacts_keyring/plugin.py Outdated Show resolved Hide resolved
src/artifacts_keyring/plugin.py Outdated Show resolved Hide resolved
src/artifacts_keyring/plugin.py Outdated Show resolved Hide resolved
setup.cfg Outdated Show resolved Hide resolved
temporaer and others added 2 commits August 7, 2020 21:49
Co-authored-by: Steve Dower <steve.dower@microsoft.com>
@temporaer
Copy link
Contributor Author

@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 check_output, tested on my system and it succeeded.
While this workaround "works", I think the problem should really be fixed upstream.

@temporaer
Copy link
Contributor Author

@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("."))
Copy link
Contributor

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.

Copy link
Member

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).

@aasim aasim merged commit 62e5b7b into microsoft:master Sep 24, 2020
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

Successfully merging this pull request may close these issues.

None yet

4 participants