Skip to content

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

Merged
merged 1 commit into from
Nov 6, 2019
Merged

Conversation

eed3si9n
Copy link
Member

@eed3si9n eed3si9n commented Nov 6, 2019

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.

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 to sdk install line.

@scala-jenkins scala-jenkins added this to the 2.13.2 milestone Nov 6, 2019
@eed3si9n eed3si9n force-pushed the wip/sdkman branch 2 times, most recently from c61c14d to b4cc7da Compare November 6, 2019 14:50
@eed3si9n
Copy link
Member Author

eed3si9n commented Nov 6, 2019

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.

eed3si9n added a commit to eed3si9n/io that referenced this pull request Nov 6, 2019
Ref scala/scala#8528

Currently SDKMAN blocks for prompt when there's a new version of SDKMAN. This is an attempted workaround.
@eed3si9n

This comment has been minimized.

eed3si9n added a commit to eed3si9n/io that referenced this pull request Nov 6, 2019
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
Copy link
Member Author

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.

@som-snytt
Copy link
Contributor

Thanks, I used this PR as an example at the office of how knowledge transfer works in an open society.

@eed3si9n
Copy link
Member Author

eed3si9n commented Nov 6, 2019

I should give credits to Marco Vermeulen, SDKMAN himself, who helped me fix this issue via their Slack channel.

@SethTisue SethTisue added the internal not resulting in user-visible changes (build changes, tests, internal cleanups) label Nov 6, 2019
@SethTisue SethTisue merged commit c37d550 into scala:2.13.x Nov 6, 2019
@eed3si9n eed3si9n deleted the wip/sdkman branch November 6, 2019 21:44
eed3si9n added a commit to eed3si9n/zinc that referenced this pull request Dec 28, 2019
eed3si9n added a commit to eed3si9n/zinc that referenced this pull request Jan 8, 2020
eed3si9n added a commit to eed3si9n/io that referenced this pull request Jan 19, 2020
Ref scala/scala#8528

Currently SDKMAN blocks for prompt when there's a new version of SDKMAN. This is an attempted workaround.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
internal not resulting in user-visible changes (build changes, tests, internal cleanups)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants