Skip to content
This repository has been archived by the owner on Aug 19, 2024. It is now read-only.

clarified instructions for mac #76

Closed
wants to merge 1 commit into from
Closed

clarified instructions for mac #76

wants to merge 1 commit into from

Conversation

MarcoLotz
Copy link

While installing on Mac Sonoma, I've verified that the suggested sourcing script does not work. Instead, another source command is provided at the end of the installation process:

sdkman instructions

Since this seems to be very system dependent, I believe that making it explicit would be a minor positive contribution to future users reading the documentation. At the end of the day, they should follow what's in the output of the installation script and not only the scripts that are provided there.

I have reworded to make it more explicit.

@marc0der
Copy link
Member

marc0der commented Jan 5, 2024

Hi @MarcoLotz, from the installation directory it seems like you are using Homebrew to install SDKMAN, so I think this doesn't have much to do with macOS Sonoma but more with the means of installation. @helpermethod might be able shed some more light on this issue as he performed all the Homebrew integration.

@MarcoLotz
Copy link
Author

Hi @marc0der, thanks for the swift reply. I've followed only the commands from that sdkman website page (curling the script and executing it).

Indeed it's likely that the scripts verifies that it running in a macos with homebrew and installs the correct taps / casks. I haven't read the script source, just seemed that users running those 3 steps could face a different outcome at step #2 when using macos on those settings.

I can rewrite to make it explicit that users should follow what's in the terminal output, and as an example in many linux systems you would get the following source command.

Does it sound reasonable to you?

@marc0der
Copy link
Member

marc0der commented Jan 5, 2024

No probs at all, and always happy to help.

If you aren't installing SDKMAN using Homebrew, something else might be up with your environment. The installer is pretty dumb in that it looks for the presence of an SDKMAN_DIR environment variable (which can be set to override the default installation location), or else it will fall back to the sensible default of your home directory (which sets SDKMAN_DIR as $HOME/.sdkman.

To help diagnose the problem, would you mind providing a dump of your environment by running the following two commands?

$ echo $SDKMAN_DIR
$ echo $HOME

This should give us more clues as to what's going on. Also, can you quickly sweep through your bash/zsh profile to check where and how the SDKMAN_DIR is being set? This is usually set at the final few lines in your profile.

@MarcoLotz
Copy link
Author

Good point, i've found out the culprit. What happened is that, before using the sdkman website guide, I did try to install using the brew install method (from here: https://github.com/sdkman/homebrew-tap) - but it failed.

In the same terminal then, I ran the script from the website. Since the env var was already set, even if the original install failed, it used the homebrew directory. Thank you for the finding! I will close the PR since it's clearly not in scope.

@MarcoLotz MarcoLotz closed this Jan 6, 2024
@MarcoLotz MarcoLotz deleted the bugfix/instructions branch January 6, 2024 12:02
@marc0der
Copy link
Member

marc0der commented Jan 6, 2024

Great stuff and thanks. Please shout if you experience any other issues.

On a side note, @helpermethod should we take a look into why the brew installation is failing? I'm not a Mac user, so not sure of what's required.

@helpermethod
Copy link
Member

Hi @MarcoLotz,

the Homebrew formula is currently broken for a number of reasons, nothing unfixable, but I didn't have enough time to fix those issues yet.

It boils down to these problems:

  • Homebrew changed some naming conventions, so the formula name is not valid anymore
  • For the native part written in Rust, an additional ZIP file needs to be downloaded and installed
  • The version file is currently missing
  • When upgrading the SDKMAN! Homebrew release, the candidates get lost because they reside in SDKMAN_CANDIDATES_DIR, which is relative to SDKMAN_DIR

Another problem is that JReleaser currently autogenerates the formula. But when adding another ZIP file (the native one), whose version is not known at release time, we may need to update the formula manually.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants