sdkman / sdkman-cli

The SDKMAN! Command Line Interface
https://sdkman.io
Apache License 2.0
5.97k stars 629 forks source link

Do not check and warn of stale candidates cache. #1197

Closed marc0der closed 1 year ago

wherka-ama commented 1 year ago

@marc0der : when can we expect new release that would contain this fix please?

marc0der commented 1 year ago

This has been fixed many months ago. Can you confirm what version you are on?

wherka-ama commented 1 year ago

This has been fixed many months ago. Can you confirm what version you are on? SDKMAN! script: 5.18.1 native: 0.2.9

It was installed from the script(curl -s https://get.sdkman.io | bash) a couple of minutes ago.

I can see it was merged indeed, but there was no new release since March 31st.

marc0der commented 1 year ago

We no longer check for the stale candidates cache. The code simply isn't there anymore. Can you explain exactly what you are seeing?

wherka-ama commented 1 year ago

We no longer check for the stale candidates cache. The code simply isn't there anymore. Can you explain exactly what you are seeing?

The code is not in the main branch, but it is in the release where the script(https://get.sdkman.io/) gets it from:

# Global variables
export SDKMAN_SERVICE="https://api.sdkman.io/2"
export SDKMAN_VERSION="5.18.1"
export SDKMAN_NATIVE_VERSION="0.2.9"
...
# fetch distribution
sdkman_zip_file="${sdkman_tmp_folder}/sdkman-${SDKMAN_VERSION}.zip"
echo "* Downloading..."
curl --fail --location --progress-bar "${SDKMAN_SERVICE}/broker/download/sdkman/install/${SDKMAN_VERSION}/${SDKMAN_PLATFORM}" > "$sdkman_zip_file"

This is quite important to suppress this check as it messes things up quite badly in the docker images we used the sdkman in. Sometimes we freeze specific sdks in and we don't touch it for a good while. The cache may indeed get stale, but when we're in the offline mode like in this context, we couldn't care less about the state of the cache.

It leads to things like:

export JDK_17_HOME=$(sdk home java 17.0.5-amzn)
..
JDK_17_HOME=We periodically need to update the local cache. Please run:

  $ sdk update

/usr/local/sdkman/candidates/java/17.0.5-amzn

I can patch that locally and that's what I do, but I don't think it's the best course of action. I'd rather pull a nice an clean upstream version from you.

BTW: thanks a lot for a great work on this project! Much appreciated!

marc0der commented 1 year ago

@wherka-ama Thanks for the information, it helps me lots in trying to figure out what the problem is. Will let you know when I've investigated further.

marc0der commented 1 year ago

@wherka-ama just a heads-up that version 5.18.2 has landed, and it resolves your issue.

wherka-ama commented 1 year ago

@wherka-ama just a heads-up that version 5.18.2 has landed, and it resolves your issue.

Great news! Thank you very much indeed.