Now that CE binaries are publicly available, it'd be great to be able to install/upgrade it with Homebrew.
For this, a Homebrew cast must be maintained at https://github.com/Homebrew/homebrew-cask.
Happy to work on an initial integration, but thought I should ask for permission first.
I think having CE binaries available by homebrew makes sense. You have to think about any interactions between homebrew (e.g. brew doctor) and the Graal Updater. The latter adds content to the GraalVM home directory which homebrew may not like.
you can use SDK Manager as an option (https://sdkman.io). It supports GraalVM as a part of Java SDK.
You have to think about any interactions between homebrew (e.g.
brew doctor) and the Graal Updater. The latter adds content to the GraalVM home directory which homebrew may not like.
The java cask installs a JDK in /Library/Java/JavaVirtualMachines/ and a cask for GraalVM should probably just do the same. I don't see why there could be any problem with Graal Updater and brew doctor.
I'll admit I'm not familiar with how brew works so if it can safely install GraalVM and not be upset when another program (i.e. Graal Updater) subsequently modifies the installation directory, then all should be fine.
@fniephaus would you expect it to put only java related things on the path? What about the node & npm executables?
Do you know how brew resolves conflicts in the executable names between different casks? What if I run:
brew install java
brew install graalvm
Which java would take precedence? I would love to see GraalVM on brew, but it'd be great if the cask is a good citizen and doesn't interfere with the other packages there.
@shelajev the Java cask only downloads a JDK and puts it into /Library/Java/JavaVirtualMachines/. So it doesn't touch $PATH, probably for a good reason. I'd suggest to just do the same with GraalVM. brew install graalvm would still be more convenient than finding the release on Github, downloading it, and extracting it manually.
Hello all! Is there any schedule for the approval of the PR above?
Also, the GraalVM CE has already been released. The PR should probably be updated then...
Thanks!
Just checked the response from homebrew-cask, and they will not merge this PR. I think this issue should be closed here, then.
Thanks!
I'm afraid https://github.com/Homebrew/homebrew-cask/pull/58492 was closed due to https://github.com/Homebrew/homebrew-cask/pull/57374#issuecomment-453760711. Also, see the discussion at https://github.com/Homebrew/homebrew-cask/issues/57387. Looks like they only support LTS releases of Java.
What we could do, however, is to add the formula to this repository. This would allow users to install GraalVM via something like brew install oracle/graal/vm-ce.
Update: it looks like we'd need to create github.com/oracle/homebrew-graal to make this work (see here). What do you think, @dougxc?
@fniephaus there is now a repo at https://github.com/graalvm/homebrew-repo that we can use for this purpose. I believe all you need to do now is open a PR on that repo.
@dougxc thanks for the swift response. The repository name, however, defines the second part of the installation command. So with https://github.com/graalvm/homebrew-repo, it would be brew install graalvm/repo/{formula}. The docs include a few tips on how to name a custom tap and formula (e.g. a unique formula name is preferred).
I'd probably go with something like brew install graalvm/tap/graalvm-ce (so we'd need https://github.com/graalvm/homebrew-tap).
What do you think?
Ok, we will rename https://github.com/graalvm/homebrew-repo to https://github.com/graalvm/homebrew-tap.
@dougxc working on a PR...
There is now a barebones README at https://github.com/graalvm/homebrew-tap so you should be able to open a PR now.
Here you go: https://github.com/graalvm/homebrew-tap/pull/1
GraalVM CE can now be installed with brew cask install graalvm/tap/graalvm-ce! 馃殌
If you run into any problems, please open an issue at https://github.com/graalvm/homebrew-tap/issues.
Lately it seems you have to specify a java version:
brew cask install graalvm/tap/graalvm-ce-java8
or
brew cask install graalvm/tap/graalvm-ce-java11
This installer does not export gu to Path
In order to install gu, for OSX I added the following to .bash_profile:
export JAVA_HOME=$(/usr/libexec/java_home -v 1.8)
export PATH=$JAVA_HOME/bin:$PATH
I then ran the following from my terminal (using gu to install native-image):
source ~/.bash_profile
gu install native-image
Most helpful comment
GraalVM CE can now be installed with
brew cask install graalvm/tap/graalvm-ce! 馃殌If you run into any problems, please open an issue at https://github.com/graalvm/homebrew-tap/issues.