-
-
Notifications
You must be signed in to change notification settings - Fork 411
Avoid using system java
unless explicitly specified
#5705
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
base: main
Are you sure you want to change the base?
Conversation
172c1c2
to
bbfcb7e
Compare
8edf91c
to
7fb17ff
Compare
Ho can a user explicitly configure to use the system-installed Is it this? //| mill-jvm-version: system |
@lefou yes I believe that's the way to do it |
Since using |
mill-jvm-version
config required, avoid using system java
unless explicitly specified java
unless explicitly specified
This would make Mill builds more reproducible, and avoid the JVM-version confusion that e.g. @makingthematrix encountered recently in the discord channel.
The basic question is what to do if
//| mill-jvm-version
is not explicitly set. It seems all options have tradeoffsNot providing any default and forcing the user to provide one
//| mill-jvm-version
even if they don't care about itdist.run
ordist.installLocal
, where providing an explicit JVM for every test case would be super annoying. But special handling would make them diverge from normal build files (although they already diverge, e.g. not using a bootstrap script and not requiring amill-version
specified)Using some hardcoded default even if there is a
java
environmentally installedjava
they installed to take effect in the absence of other explicit configurationcom-lihaoyi
libraries are built with 11, Spring-Boot requires 17, etc.Using the environmental
java
installation as the default,java
installation would encounter failures.//| mill-jvm-version
in their build header, most users likely won't by default, won't know that they should, and when they hit weird Java version errors they won't know that this is the solution for it. e.g. all thecom-lihaoyi
projects never did this, and if we as the experts aren't doing this ourselves we can't realistically expect others to do soWe are currently at (3), but of these options I think (1) is probably the best.
The increased up-front inconvenience can be mitigated by copy-pasteable instructions on
installation-ide.adoc
and having an explicit default be included in all the example zip downloads. The longer-term convenience of "Mill projects are easy for anyone to checkout and build" would definitely be very valuable, and can be a differentiator over other build tools where that is generally not the caseThis is a breaking change, but it doesn't break binary compatibility, and we can provide a good error message to smooth the upgrade path. So it'll likely go into 1.1.0