almond icon indicating copy to clipboard operation
almond copied to clipboard

Relationship between launcher.jar, installer, and initial boostrap?

Open mpacer opened this issue 5 years ago • 2 comments

Is there a good explanation of the relationship between the launcher, the installer, and the initial bootstrap (through coursier)?

mpacer avatar Dec 18 '18 03:12 mpacer

I can tell you a bit about those here:

  • the output of the coursier bootstrap command during install, almond say, is a small JAR containing the URLs (from Maven Central typically) of the JARs of almond itself and its dependencies, along with code able to pick them from or download them to the coursier cache, and then run them. (Unzip it and look e.g. at the bootstrap-jar-urls file in it.)

The -i and -I options that are passed to it make the bootstrap load some of these JARs in a first classloader, and the others in a second one with the former as parent. This allows the JARs of the second classloader not to be seen from the user session, that only uses the first classloader as a basis. Thanks to that, all the scalameta stuff added recently in almond don't interfer with the user dependencies.

scalafmt or scalafix rely on that for their installation, although they don't use the -i / -I options. The various vscode language servers for scala rely on the launch command of coursier, which works a bit like bootstrap. And the coursier launcher itself, is a bootstrap too.

  • launcher.jar, found in the installation directory, is just a copy of the bootstrap above. The copy and kernel.json generation are handled around here. Upon installation, almond just copies the bootstrap as launcher.jar in the installation directory, so that the initial bootstrap can be removed for example.

alexarchambault avatar Dec 18 '18 21:12 alexarchambault

I don't see what you mean by the "installer" though.

alexarchambault avatar Dec 18 '18 21:12 alexarchambault