Map Zulu x86 architecture to i686 for Azul Metadata API

The Azul Metadata API's `arch=x86` returns both 32-bit (i686) and 64-bit
(x64) packages. Because the two variants share identical java_version and
distro_version, setup-java cannot distinguish them and may resolve an
explicit `architecture: x86` request to a 64-bit JDK (and for Java 21+,
where 32-bit is dropped, x86 silently returns x64 instead of failing).

The legacy Zulu Discovery API used `arch=x86&hw_bitness=32` to target only
32-bit builds. The Metadata API exposes the equivalent via `arch=i686`,
which returns only genuine 32-bit builds with full version parity to the
old behavior. Map x86 -> i686 to restore correct 32-bit resolution.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
This commit is contained in:
Bruno Borges
2026-07-08 07:39:46 -04:00
parent f7121373a9
commit 31ebf0f230
5 changed files with 19 additions and 11 deletions
@@ -88,7 +88,7 @@ describe('getAvailableVersions', () => {
packageType: 'jdk',
checkLatest: false
},
'?os=windows&archive_type=zip&java_package_type=jdk&javafx_bundled=false&crac_supported=false&arch=x86&release_status=ga&availability_types=ca&page=1&page_size=100'
'?os=windows&archive_type=zip&java_package_type=jdk&javafx_bundled=false&crac_supported=false&arch=i686&release_status=ga&availability_types=ca&page=1&page_size=100'
],
[
{
@@ -97,7 +97,7 @@ describe('getAvailableVersions', () => {
packageType: 'jdk',
checkLatest: false
},
'?os=windows&archive_type=zip&java_package_type=jdk&javafx_bundled=false&crac_supported=false&arch=x86&release_status=ea&availability_types=ca&page=1&page_size=100'
'?os=windows&archive_type=zip&java_package_type=jdk&javafx_bundled=false&crac_supported=false&arch=i686&release_status=ea&availability_types=ca&page=1&page_size=100'
],
[
{
@@ -226,7 +226,7 @@ describe('getAvailableVersions', () => {
describe('getArchitectureOptions', () => {
it.each([
[{architecture: 'x64'}, 'x64'],
[{architecture: 'x86'}, 'x86'],
[{architecture: 'x86'}, 'i686'],
[{architecture: 'aarch64'}, 'aarch64'],
[{architecture: 'arm64'}, 'aarch64'],
[{architecture: 'arm'}, 'arm']