mirror of
https://gitea.com/actions/setup-java.git
synced 2026-07-09 19:22:05 +08:00
Map Zulu x86 architecture to i686 for Azul Metadata API (#1079)
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>
(cherry picked from commit 8a3e8157a1)
This commit is contained in:
@@ -45,7 +45,7 @@ describe('getAvailableVersions', () => {
|
|||||||
packageType: 'jdk',
|
packageType: 'jdk',
|
||||||
checkLatest: false
|
checkLatest: false
|
||||||
},
|
},
|
||||||
'?os=macos&archive_type=tar.gz&java_package_type=jdk&javafx_bundled=false&crac_supported=false&arch=x86&release_status=ga&availability_types=ca&page=1&page_size=100'
|
'?os=macos&archive_type=tar.gz&java_package_type=jdk&javafx_bundled=false&crac_supported=false&arch=i686&release_status=ga&availability_types=ca&page=1&page_size=100'
|
||||||
],
|
],
|
||||||
[
|
[
|
||||||
{
|
{
|
||||||
@@ -54,7 +54,7 @@ describe('getAvailableVersions', () => {
|
|||||||
packageType: 'jdk',
|
packageType: 'jdk',
|
||||||
checkLatest: false
|
checkLatest: false
|
||||||
},
|
},
|
||||||
'?os=macos&archive_type=tar.gz&java_package_type=jdk&javafx_bundled=false&crac_supported=false&arch=x86&release_status=ea&availability_types=ca&page=1&page_size=100'
|
'?os=macos&archive_type=tar.gz&java_package_type=jdk&javafx_bundled=false&crac_supported=false&arch=i686&release_status=ea&availability_types=ca&page=1&page_size=100'
|
||||||
],
|
],
|
||||||
[
|
[
|
||||||
{
|
{
|
||||||
@@ -183,7 +183,7 @@ describe('getAvailableVersions', () => {
|
|||||||
describe('getArchitectureOptions', () => {
|
describe('getArchitectureOptions', () => {
|
||||||
it.each([
|
it.each([
|
||||||
[{architecture: 'x64'}, 'x64'],
|
[{architecture: 'x64'}, 'x64'],
|
||||||
[{architecture: 'x86'}, 'x86'],
|
[{architecture: 'x86'}, 'i686'],
|
||||||
[{architecture: 'aarch64'}, 'aarch64'],
|
[{architecture: 'aarch64'}, 'aarch64'],
|
||||||
[{architecture: 'arm64'}, 'aarch64'],
|
[{architecture: 'arm64'}, 'aarch64'],
|
||||||
[{architecture: 'arm'}, 'arm']
|
[{architecture: 'arm'}, 'arm']
|
||||||
|
|||||||
@@ -46,7 +46,7 @@ describe('getAvailableVersions', () => {
|
|||||||
packageType: 'jdk',
|
packageType: 'jdk',
|
||||||
checkLatest: false
|
checkLatest: false
|
||||||
},
|
},
|
||||||
'?os=linux_glibc&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=linux_glibc&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'
|
||||||
],
|
],
|
||||||
[
|
[
|
||||||
{
|
{
|
||||||
@@ -55,7 +55,7 @@ describe('getAvailableVersions', () => {
|
|||||||
packageType: 'jdk',
|
packageType: 'jdk',
|
||||||
checkLatest: false
|
checkLatest: false
|
||||||
},
|
},
|
||||||
'?os=linux_glibc&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=linux_glibc&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'
|
||||||
],
|
],
|
||||||
[
|
[
|
||||||
{
|
{
|
||||||
@@ -186,7 +186,7 @@ describe('getAvailableVersions', () => {
|
|||||||
describe('getArchitectureOptions', () => {
|
describe('getArchitectureOptions', () => {
|
||||||
it.each([
|
it.each([
|
||||||
[{architecture: 'x64'}, 'x64'],
|
[{architecture: 'x64'}, 'x64'],
|
||||||
[{architecture: 'x86'}, 'x86'],
|
[{architecture: 'x86'}, 'i686'],
|
||||||
[{architecture: 'aarch64'}, 'aarch64'],
|
[{architecture: 'aarch64'}, 'aarch64'],
|
||||||
[{architecture: 'arm64'}, 'aarch64'],
|
[{architecture: 'arm64'}, 'aarch64'],
|
||||||
[{architecture: 'arm'}, 'arm']
|
[{architecture: 'arm'}, 'arm']
|
||||||
|
|||||||
@@ -46,7 +46,7 @@ describe('getAvailableVersions', () => {
|
|||||||
packageType: 'jdk',
|
packageType: 'jdk',
|
||||||
checkLatest: false
|
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'
|
||||||
],
|
],
|
||||||
[
|
[
|
||||||
{
|
{
|
||||||
@@ -55,7 +55,7 @@ describe('getAvailableVersions', () => {
|
|||||||
packageType: 'jdk',
|
packageType: 'jdk',
|
||||||
checkLatest: false
|
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'
|
||||||
],
|
],
|
||||||
[
|
[
|
||||||
{
|
{
|
||||||
@@ -184,7 +184,7 @@ describe('getAvailableVersions', () => {
|
|||||||
describe('getArchitectureOptions', () => {
|
describe('getArchitectureOptions', () => {
|
||||||
it.each([
|
it.each([
|
||||||
[{architecture: 'x64'}, 'x64'],
|
[{architecture: 'x64'}, 'x64'],
|
||||||
[{architecture: 'x86'}, 'x86'],
|
[{architecture: 'x86'}, 'i686'],
|
||||||
[{architecture: 'aarch64'}, 'aarch64'],
|
[{architecture: 'aarch64'}, 'aarch64'],
|
||||||
[{architecture: 'arm64'}, 'aarch64'],
|
[{architecture: 'arm64'}, 'aarch64'],
|
||||||
[{architecture: 'arm'}, 'arm']
|
[{architecture: 'arm'}, 'arm']
|
||||||
|
|||||||
@@ -185,7 +185,11 @@ export class ZuluDistribution extends JavaBase {
|
|||||||
case 'x64':
|
case 'x64':
|
||||||
return 'x64';
|
return 'x64';
|
||||||
case 'x86':
|
case 'x86':
|
||||||
return 'x86';
|
// The Azul Metadata API's "x86" value returns both 32-bit (i686) and
|
||||||
|
// 64-bit (x64) packages, which are indistinguishable by version and
|
||||||
|
// would let a 32-bit request resolve to a 64-bit JDK. Use "i686" to
|
||||||
|
// target only genuine 32-bit builds, matching the legacy API behavior.
|
||||||
|
return 'i686';
|
||||||
case 'aarch64':
|
case 'aarch64':
|
||||||
case 'arm64':
|
case 'arm64':
|
||||||
return 'aarch64';
|
return 'aarch64';
|
||||||
|
|||||||
Reference in New Issue
Block a user