`java-packages.nix` attempts to automatically decide which java to use
for bootstrapping. When this works, it works well. However when it
fails due to the user setting `config.allowNonSource=false` on a
non-x86 platform, the reported failure is extremely confusing and does
not mention the `NIXPKGS_ALLOW_NONSOURCE=1` option to proceed, or
that `allowNonSource` had anything to do with the eval failure.
Here's why this is happening:
Currently, `java-packages.nix` makes its detection choice based on
`adoptopenjdk.jdk-hotspot.meta.available`. If the user has set
`config.allowNonSource=false` then the `adoptopenjdk-bin` packages
will all report `_.meta.available==false`. If
`adoptopenjdk.jdk-hotspot.meta.available==false` then the detection
code will proceed to use `callPackage path args`, *even if that
package is **also** `meta.unavailable`* for end-user-unfixable
reasons.
In the case of `openjdk8`, the `path` passed is a `nix` expression
that only works on x86. The user has two options for continuing the
build: buy an x86 machine or add an `allowNonSource` exception for the
bootstrap jdk. The second option is generally preferred, but the user
is only offered the first option.
The following comment appears above the line in `java-packages.nix`
which does the automatic selection:
```
/* adoptopenjdk not available for i686, so fall back to our old builds for bootstrapping */
```
Since the intent here was to decide based on "i686-ness", let's query
the authoritative source for i686ness in nixpkgs: `stdenv.hostPlatform`.
This reduces the build closure size.
Reducing the build closure size reduces the number of rebuilds
across time and it helps with such tasks as bisecting the staging
branch.
AdoptOpenJDK Hotspot is now Eclipse Temurin and AdoptOpenJDK OpenJ9 is
now IBM Semeru Runtime.
Adds `temurin-bin` and `semeru-bin` packages.
AdoptOpenJDK 13, 14, and 15 is no longer supported. AdoptOpenJDK 13 and
14 are removed. AdoptOpenJDK 15 is left only for some packages
depending it.