-
Notifications
You must be signed in to change notification settings - Fork 3.1k
workaround for SDKMAN getting stuck #8528
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
Conversation
c61c14d
to
b4cc7da
Compare
I got impatient and wiped out the Travis CI cache, so I need to use some other repository to test if this actually fixes this. |
Ref scala/scala#8528 Currently SDKMAN blocks for prompt when there's a new version of SDKMAN. This is an attempted workaround.
This comment has been minimized.
This comment has been minimized.
Ref scala/scala#8528 Currently SDKMAN blocks for prompt when there's a new version of SDKMAN. This is an attempted workaround.
Currently SDKMAN blocks for prompt when there's a new version of SDKMAN. ``` $ sdk list java ... ATTENTION: A new version of SDKMAN is available... The current version is 5.7.4+362, but you have 5.7.3+337. Would you like to upgrade now? (Y/n): ``` This in turn blocks our automated AdoptOpenJDK installation script: ``` sdk install java $(sdk list java | grep -o "$ADOPTOPENJDK\.[0-9\.]*hs-adpt" | head -1) ``` An additional setting `sdkman_auto_selfupdate=true` is needed so it's updated automatically. This also adds `| true` to `sdk install` because it started to return 1 if the same Jave version is already installed.
- source "$HOME/.sdkman/bin/sdkman-init.sh" | ||
|
||
install: | ||
- sdk install java $(sdk list java | grep -o "$ADOPTOPENJDK\.[0-9\.]*hs-adpt" | head -1) | ||
- sdk install java $(sdk list java | grep -o "$ADOPTOPENJDK\.[0-9\.]*hs-adpt" | head -1) | true |
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.
Note that the latest SDKMAN started failing when the JDK version is already installed, so we need this workaround here.
Thanks, I used this PR as an example at the office of how knowledge transfer works in an open society. |
I should give credits to Marco Vermeulen, SDKMAN himself, who helped me fix this issue via their Slack channel. |
Ref scala/scala#8528 Currently SDKMAN blocks for prompt when there's a new version of SDKMAN. This is an attempted workaround.
Currently SDKMAN blocks for prompt when there's a new version of SDKMAN.
This in turn blocks our automated AdoptOpenJDK installation script:
An additional setting
sdkman_auto_selfupdate=true
is needed so it's updated automatically.Due to frikke/sdkman-cli@1fe19fe, the latest SDKMAN returns exist code of
1
when the desired JDK is already installed. To workaround this, I added| true
tosdk install
line.