-
Notifications
You must be signed in to change notification settings - Fork 111
Add script to check if a library is supported by the GraalVM Reachability Metadata repository #811
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
base: master
Are you sure you want to change the base?
Conversation
check-library-support.sh
Outdated
| fi | ||
|
|
||
| # Check if the version exists in any tested-versions (exact match) | ||
| MATCH=$(jq --arg ver "$VERSION" 'any(.[]["tested-versions"][]?; . == $ver)' "$INDEX_FILE") |
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 would go without jq. We need to add a section in the README.md that allows a copy-paste script similar to install scripts such as curl -s "https://get.sdkman.io" | bash.
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 replaced the usage of jq with awk and migrated the script to be usable with curl, so it can now be used without cloning the repository. The copy-paste command can now be found in the README.md too.
…lity Metadata repository
… curl and update README.md
b59951b to
4bd1a83
Compare
README.md
Outdated
| If you’d like yours to appear there as well, open a pull request updating [this JSON file](https://github.com/oracle/graalvm-reachability-metadata/blob/master/library-and-framework-list.json). | ||
| Before submitting a pull request, please read [this guide](docs/CONTRIBUTING.md#tested-libraries-and-frameworks). | ||
|
|
||
| You can also check if metadata for a library exists on the repository directly from your terminal without cloning it using: |
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.
Put this first. Do we have tickets for running with preserve and detecting libraries that don't require metadata?
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.
Done, the command is referenced first in the README now. I've also opened the ticket.
|
|
||
| set -euo pipefail | ||
|
|
||
| if [ "$#" -ne 1 ]; then |
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.
On which OS-es does this script work?
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.
Maybe mention that in the readme.
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.
The script should have native support on Linux and macOS, while Windows can run it through channels such as WSL or Windows Git Bash. I've added a line in the README explaining this.
| set -euo pipefail | ||
|
|
||
| if [ "$#" -ne 1 ]; then | ||
| echo "Usage: $0 <groupId>:<artifactId>:<version>" |
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.
If the library is not parsing properly we need to display nice errors.
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've added an additional check if the argument provided to the command is in the GAV format (displaying an error if wrong format is used).
What does this PR do?
In this PR we introduce a script for easy checking if a library is supported by the GraalVM Reachability Metadata repository. We do this by parsing the
index.jsonfile for the particular library (if it exists) and looking for the requested version undertested-versions. If it exists, the library is supported.To use the script, position yourself in the root of the repository and call:
./check-library-support.sh <groupId:artifactId:version>(e.g.:org.hibernate.orm:hibernate-core:7.0.0.Final).Fixes: #808.
P.S: We should wait for the merge of #802 before merging this PR, as we should add the usage of the script to the
README.md.