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

More improved SDK lookup. #278

Merged
merged 3 commits into from
Sep 16, 2023

Conversation

oraluben
Copy link
Contributor

@oraluben oraluben commented Aug 14, 2023

This PR:

  1. Fixes a bug that only the first branch in sdk_version_regexes can be retrieved by match.group(1);
  2. Support more JDK vendors to suppress warning;
  3. Try to support mx intellijinit on windows.

@dougxc

Before:

$ mx intellijinit
Parsing /Users/yyc/Library/Application Support/JetBrains/IntelliJIdea2023.2/options/jdk.table.xml for SDK definitions
  Found Python SDK /Users/yyc/.local/miniforge3/bin/python with values {'name': 'Python 3.9 (base)', 'type': 'Python SDK', 'version': '3.10.9'}
WARNING:   Couldn't understand JavaSDK version specification "Eclipse Temurin version 19.0.1" for /Users/yyc/.sdkman/candidates/java/19.0.1-tem
  Found Java SDK /Users/yyc/.sdkman/candidates/java/19.0.1-tem with values {'name': '19', 'type': 'JavaSDK', 'version': '19.0.1'}
WARNING:   Couldn't understand JavaSDK version specification "GraalVM version 20" for /Users/yyc/.sdkman/candidates/java/labs-20-b10
WARNING:   Couldn't understand JavaSDK version specification "Amazon Corretto version 1.8.0_362" for /Users/yyc/.sdkman/candidates/java/8.0.362-amzn
WARNING:   Couldn't understand JavaSDK version specification "Eclipse Temurin version 11.0.18" for /Users/yyc/.sdkman/candidates/java/11.0.18-tem
  Found Java SDK /Users/yyc/IdeaProjects/jdk/build/labs-21-debug/images/graal-builder-jdk with values {'name': '21', 'type': 'JavaSDK', 'version': '21'}
WARNING:   Couldn't understand JavaSDK version specification "Eclipse Temurin version 20" for /Users/yyc/.sdkman/candidates/java/20-tem
  Found Python SDK /usr/bin/python3 with values {'name': 'Python 3.9', 'type': 'Python SDK', 'version': '3.9.6'}
  Found Python SDK /Users/yyc/.local/miniconda3/envs/yitian_env/bin/python3.11 with values {'name': 'Python 3.11 (yitian_env)', 'type': 'Python SDK', 'version': '3.11.4'}

After:

$ mx intellijinit                  
Parsing /Users/yyc/Library/Application Support/JetBrains/IntelliJIdea2023.2/options/jdk.table.xml for SDK definitions
  Found Python SDK /Users/yyc/.local/miniforge3/bin/python with values {'name': 'Python 3.9 (base)', 'type': 'Python SDK', 'version': '3.10.9'}
  Found Java SDK /Users/yyc/.sdkman/candidates/java/19.0.1-tem with values {'name': 'labs-20', 'type': 'JavaSDK', 'version': '19.0.1'}
  Found Java SDK /Users/yyc/.sdkman/candidates/java/labs-20-b10 with values {'name': '20', 'type': 'JavaSDK', 'version': '20'}
  Found Java SDK /Users/yyc/.sdkman/candidates/java/8.0.362-amzn with values {'name': 'corretto-1.8', 'type': 'JavaSDK', 'version': '1.8.0_362'}
  Found Java SDK /Users/yyc/.sdkman/candidates/java/11.0.18-tem with values {'name': 'temurin-11', 'type': 'JavaSDK', 'version': '11.0.18'}
  Found Java SDK /Users/yyc/IdeaProjects/jdk/build/labs-21-debug/images/graal-builder-jdk with values {'name': '21', 'type': 'JavaSDK', 'version': '21'}
  Found Java SDK /Users/yyc/.sdkman/candidates/java/20-tem with values {'name': 'temurin-20', 'type': 'JavaSDK', 'version': '20'}
  Found Python SDK /usr/bin/python3 with values {'name': 'Python 3.9', 'type': 'Python SDK', 'version': '3.9.6'}
  Found Python SDK /Users/yyc/.local/miniconda3/envs/yitian_env/bin/python3.11 with values {'name': 'Python 3.11 (yitian_env)', 'type': 'Python SDK', 'version': '3.11.4'}

@oracle-contributor-agreement oracle-contributor-agreement bot added the OCA Verified All contributors have signed the Oracle Contributor Agreement. label Aug 14, 2023
@oraluben
Copy link
Contributor Author

SDK detect on Windows seems not working as expected based on some report in slack. It should be easy to fix but I don't have Windows device, so commit it untested.

@dougxc
Copy link
Member

dougxc commented Aug 14, 2023

Thanks for the PR @oraluben . With @pejovica 's help, we will test it on Windows and then I will merge it.

@graalvmbot graalvmbot merged commit d7bee1b into graalvm:master Sep 16, 2023
2 checks passed
@oraluben oraluben deleted the more-improved-sdk-lookup branch September 17, 2023 01:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
OCA Verified All contributors have signed the Oracle Contributor Agreement.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants