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: asdf latest --all report wrong runtimes (#1180) #1191
Closed
Closed
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
#!/usr/bin/env bash | ||
|
||
exit 0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
#!/usr/bin/env bash | ||
|
||
# We want certain versions to fail installation for various reasons in the tests | ||
check_dummy_versions() { | ||
local bad_versions=" other-dummy " | ||
if [[ "$bad_versions" == *" $ASDF_INSTALL_VERSION "* ]]; then | ||
echo "Dummy couldn't install version: $ASDF_INSTALL_VERSION (on purpose)" | ||
exit 1 | ||
fi | ||
} | ||
|
||
check_dummy_versions | ||
mkdir -p "$ASDF_INSTALL_PATH" | ||
env >"$ASDF_INSTALL_PATH/env" | ||
echo "$ASDF_INSTALL_VERSION" >"$ASDF_INSTALL_PATH/version" | ||
|
||
# create the dummy executable | ||
mkdir -p "$ASDF_INSTALL_PATH/bin" | ||
cat <<EOF >"$ASDF_INSTALL_PATH/bin/dummy" | ||
echo This is Dummy ${ASDF_INSTALL_VERSION}! \$2 \$1 | ||
EOF | ||
chmod +x "$ASDF_INSTALL_PATH/bin/dummy" | ||
mkdir -p "$ASDF_INSTALL_PATH/bin/subdir" | ||
cat <<EOF >"$ASDF_INSTALL_PATH/bin/subdir/other_bin" | ||
echo This is Other Bin ${ASDF_INSTALL_VERSION}! \$2 \$1 | ||
EOF | ||
chmod +x "$ASDF_INSTALL_PATH/bin/subdir/other_bin" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
#!/usr/bin/env bash | ||
|
||
versions_list=(1.0 2.0 dist-1.0.0 dist-1.1.0 other-dist-1.0 other-dist-2.0-src rc1 rc1-beta) | ||
echo "${versions_list[@]}" | ||
# Sending message to STD error to ensure that it is ignored | ||
echo "ignore this error" >&2 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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'm uncomfortable with this being part of asdf. I know we have similar logic that already exists in a few places, but this doesn't feel like a future-proof solution. We're effectively using versions to store more than the version number. Versions are a combination of tool type (e.g. openjdk) and version (e.g. 1.2.3). I know this is a pretty fundamental change, but I think we might be better off either introducing a type field in addition to version, or specifying that plugins only support one type of thing (e.g. instead of a java plugin we have an openjdk plugin). Thoughts?
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.
interesting proposal. I know this would also upset the Hashicorp plugin which manages the binaries for the Hashi ecosystem and not just different sources of the same runtime. I feel like Java and Hashicorp plugins are different enough and both valid in the spec we have defined 🤔