Skip to content

Commit 97c5a5e

Browse files
yawkatmulticode-agentCopilot
authored
Support Temurin on Linux RISC-V (#1269)
* Document Temurin RISC-V compatibility Co-Authored-By: multicode <[email protected]> * Expose RISC-V as a canonical architecture Co-Authored-By: multicode <[email protected]> * Support Temurin on Linux RISC-V Co-Authored-By: multicode <[email protected]> * Address RISC-V review feedback Co-Authored-By: multicode <[email protected]> * Fix casing for RISC-V architecture in tests Co-authored-by: Copilot Autofix powered by AI <[email protected]> * Update __tests__/java-platform-contract.test.ts --------- Co-authored-by: multicode <[email protected]> Co-authored-by: Copilot Autofix powered by AI <[email protected]>
1 parent 1aa87b6 commit 97c5a5e

7 files changed

Lines changed: 39 additions & 7 deletions

File tree

‎README.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,7 @@ steps:
150150
| `java-version-file` | Path to `.java-version`, `.tool-versions`, or `.sdkmanrc`. Used when `java-version` is not set. | |
151151
| `distribution` | Java distribution keyword. Values are case-sensitive and must match one of the supported keywords below. Required unless `java-version-file` points to `.sdkmanrc` with a recognized distribution suffix. | |
152152
| `java-package` | Package variant such as `jdk`, `jre`, `jdk+fx`, `jre+fx`, `jdk+crac`, `jre+crac`, `jdk+jmods`, `jdk+jcef`, `jre+jcef`, `jdk+ft`, or `jre+ft`. Support varies by distribution. | `jdk` |
153-
| `architecture` | Package architecture. Canonical values are `x86`, `x64`, `armv7`, `aarch64`, `ppc64le`, `ppc64`, and `s390x`. Aliases `ia32`, `amd64`, `arm`, and `arm64` are normalized. | Runner architecture |
153+
| `architecture` | Package architecture. Canonical values are `x86`, `x64`, `armv7`, `aarch64`, `ppc64le`, `ppc64`, `riscv64`, and `s390x`. Aliases `ia32`, `amd64`, `arm`, and `arm64` are normalized. | Runner architecture |
154154
| `jdk-file` | Local compressed JDK archive. Requires `distribution: jdkfile`. | |
155155
| `check-latest` | Check remote metadata for the latest version satisfying the version spec before using the runner tool cache. | `false` |
156156
| `force-download` | Always download Java and replace any matching version in the tool cache. | `false` |

‎__tests__/distributors/temurin-installer.test.ts‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -293,7 +293,8 @@ describe('getAvailableVersions', () => {
293293
it.each([
294294
['amd64', 'x64'],
295295
['arm', 'arm'],
296-
['arm64', 'aarch64']
296+
['arm64', 'aarch64'],
297+
['riscv64', 'riscv64']
297298
])(
298299
'defaults to os.arch(): %s mapped to distro arch: %s',
299300
async (osArch: string, distroArch: string) => {

‎__tests__/java-platform-contract.test.ts‎

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ describe('Java platform capabilities', () => {
2525
['aarch64', 'aarch64'],
2626
['arm64', 'aarch64'],
2727
['ppc64le', 'ppc64le'],
28+
['RiScV64', 'riscv64'],
2829
['s390x', 's390x']
2930
])('normalizes architecture %s to %s', (input, expected) => {
3031
expect(normalizeArchitecture(input)).toBe(expected);
@@ -68,6 +69,12 @@ describe('Java platform capabilities', () => {
6869
);
6970
});
7071

72+
it('allows Temurin on Linux riscv64', () => {
73+
expect(validateJavaPlatform('temurin', 'linux', 'riscv64', '25')).toBe(
74+
'riscv64'
75+
);
76+
});
77+
7178
it('rejects OS-specific restrictions with a consistent diagnostic', () => {
7279
expect(() =>
7380
validateJavaPlatform('oracle', 'win32', 'arm64', '21')
@@ -115,6 +122,7 @@ describe('Java platform capabilities', () => {
115122
'aarch64',
116123
'ppc64le',
117124
'ppc64',
125+
'riscv64',
118126
's390x'
119127
]) {
120128
expect(content).toContain(architecture);

‎action.yml‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ inputs:
1717
required: false
1818
default: 'jdk'
1919
architecture:
20-
description: "The architecture of the package (`x86`, `x64`, `armv7`, `aarch64`, `ppc64le`, `ppc64`, or `s390x`). Aliases `ia32`, `amd64`, `arm`, and `arm64` are normalized to `x86`, `x64`, `armv7`, and `aarch64`. Supported values vary by distribution and operating system. Defaults to the action runner's architecture."
20+
description: "The architecture of the package (`x86`, `x64`, `armv7`, `aarch64`, `ppc64le`, `ppc64`, `riscv64`, or `s390x`). Aliases `ia32`, `amd64`, `arm`, and `arm64` are normalized to `x86`, `x64`, `armv7`, and `aarch64`. Supported values vary by distribution and operating system. Defaults to the action runner's architecture."
2121
required: false
2222
jdk-file:
2323
description: 'Path to where the compressed JDK is located'

‎dist/setup/index.js‎

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31022,7 +31022,14 @@ function createUnsupportedPackageError(distributionName, packageType, supportedP
3102231022

3102331023

3102431024
const X64_ARM64 = ['x64', 'aarch64'];
31025-
const STANDARD_LINUX = ['x64', 'x86', 'aarch64', 'ppc64le', 's390x'];
31025+
const STANDARD_LINUX = [
31026+
'x64',
31027+
'x86',
31028+
'aarch64',
31029+
'ppc64le',
31030+
'riscv64',
31031+
's390x'
31032+
];
3102631033
const JAVA_PLATFORM_CAPABILITIES = {
3102731034
[_package_types_js__WEBPACK_IMPORTED_MODULE_2__/* .JavaDistribution */ .zS.Temurin]: {
3102831035
platforms: {
@@ -31164,6 +31171,7 @@ const CANONICAL_ARCHITECTURES = [
3116431171
'aarch64',
3116531172
'ppc64le',
3116631173
'ppc64',
31174+
'riscv64',
3116731175
's390x'
3116831176
];
3116931177
const PLATFORM_ALIASES = {

‎docs/advanced-usage.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -649,7 +649,7 @@ absent from a vendor catalog.
649649

650650
| Distribution | Linux | macOS | Windows | Other / version restrictions |
651651
| --- | --- | --- | --- | --- |
652-
| `temurin` | `x64`, `x86`, `armv7`, `aarch64`, `ppc64le`, `s390x` | `x64`, `aarch64` | `x64`, `x86`, `aarch64` | Linux `armv7` is available through Java 17. |
652+
| `temurin` | `x64`, `x86`, `armv7`, `aarch64`, `ppc64le`, `riscv64`, `s390x` | `x64`, `aarch64` | `x64`, `x86`, `aarch64` | Linux `armv7` is available through Java 17. |
653653
| `zulu` | `x64`, `x86`, `armv7`, `aarch64` | `x64`, `aarch64` | `x64`, `x86`, `aarch64` | |
654654
| `liberica` | `x64`, `x86`, `armv7`, `aarch64`, `ppc64le` | `x64`, `aarch64` | `x64`, `x86`, `aarch64` | Solaris: `x64`. |
655655
| `liberica-nik` | `x64`, `aarch64` | `x64`, `aarch64` | `x64`, `aarch64` | |

‎src/distributions/platform-types.ts‎

Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,14 @@ import {JavaDistribution} from './package-types.js';
55
export type JavaPlatform = 'linux' | 'macos' | 'windows' | 'solaris';
66

77
export type JavaArchitecture =
8-
'x86' | 'x64' | 'armv7' | 'aarch64' | 'ppc64le' | 'ppc64' | 's390x';
8+
| 'x86'
9+
| 'x64'
10+
| 'armv7'
11+
| 'aarch64'
12+
| 'ppc64le'
13+
| 'ppc64'
14+
| 'riscv64'
15+
| 's390x';
916

1017
interface VersionedArchitecture {
1118
architecture: JavaArchitecture;
@@ -27,7 +34,14 @@ export type JavaPlatformCapability =
2734
RestrictedPlatformCapability | UnrestrictedPlatformCapability;
2835

2936
const X64_ARM64 = ['x64', 'aarch64'] as const;
30-
const STANDARD_LINUX = ['x64', 'x86', 'aarch64', 'ppc64le', 's390x'] as const;
37+
const STANDARD_LINUX = [
38+
'x64',
39+
'x86',
40+
'aarch64',
41+
'ppc64le',
42+
'riscv64',
43+
's390x'
44+
] as const;
3145

3246
export const JAVA_PLATFORM_CAPABILITIES: Record<
3347
JavaDistribution,
@@ -174,6 +188,7 @@ const CANONICAL_ARCHITECTURES: readonly JavaArchitecture[] = [
174188
'aarch64',
175189
'ppc64le',
176190
'ppc64',
191+
'riscv64',
177192
's390x'
178193
];
179194

0 commit comments

Comments
 (0)