Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

IllegalArgumentException: Unknown os.arch aarch64 #20

Closed
rawlingsj opened this issue Apr 26, 2023 · 3 comments · Fixed by #22
Closed

IllegalArgumentException: Unknown os.arch aarch64 #20

rawlingsj opened this issue Apr 26, 2023 · 3 comments · Fixed by #22

Comments

@rawlingsj
Copy link

The Jenkins project recently enabled spotless-maven-plugin for Jenkinsfiles see jenkinsci/jenkins#7834. As a result we have started seeing errors when building on aarch64, s390x and ppc64le

Caused by: java.lang.IllegalArgumentException: Unknown os.arch s390x'.
    at com.diffplug.common.swt.os.OS.calculateNative (OS.java:147)
    at com.diffplug.common.swt.os.OS.detectPlatform (OS.java:113)
    at com.diffplug.common.swt.os.OS.detectPlatform (OS.java:120)

After a quick look could it be this code

String os_arch = systemProperty.apply("os.arch");
switch (os_arch) {
case "i386":
case "x86":
return LINUX_x86;
case "x86_64":
case "amd64":
return LINUX_x64;
default:
throw new IllegalArgumentException("Unknown os.arch " + os_arch + "'.");
}

that needs needs to handle extra architectures?

@nedtwigg
Copy link
Member

nedtwigg commented Apr 26, 2023

Can you make the stacktrace deeper? To show where Spotless is using this library?

I ask because durian-swt is targeted towards SWT, which no longer produces binaries for s390x and ppc64le. We could fix the aarch64 issue easily by just updating to the latest version of durian-swt, which has supported aarch64 for a while.

public enum Arch {
x86, x64, arm64;

Maybe we should add an Arch.UNKNOWN, for unknown Architectures. As long as the user never needs platform-specific artifacts like SWT UI libraries (such as for Spotless code formatter), the unknown architecture would just pass along...

@rawlingsj
Copy link
Author

Can you make the stacktrace deeper?

sure thing...

jenkins_2.402.log

nedtwigg added a commit that referenced this issue Apr 27, 2023
@nedtwigg
Copy link
Member

FYI, the fix above has been incorporated into spotless-plugin-gradle 6.19.0 and spotless-plugin-maven 2.37.0.

benkard pushed a commit to benkard/mulkcms2 that referenced this issue Aug 29, 2023
This MR contains the following updates:

| Package | Type | Update | Change |
|---|---|---|---|
| [com.diffplug.spotless:spotless-maven-plugin](https://github.com/diffplug/spotless) | build | minor | `2.38.0` -> `2.39.0` |
| [io.quarkus:quarkus-maven-plugin](https://github.com/quarkusio/quarkus) | build | patch | `3.3.0` -> `3.3.1` |
| [io.quarkus:quarkus-universe-bom](https://github.com/quarkusio/quarkus-platform) | import | patch | `3.3.0` -> `3.3.1` |

---

### Release Notes

<details>
<summary>diffplug/spotless</summary>

### [`v2.39.0`](https://github.com/diffplug/spotless/blob/HEAD/CHANGES.md#&#8203;2390---2023-05-24)

##### Added

-   `Jvm.Support` now accepts `-SNAPSHOT` versions, treated as the non`-SNAPSHOT`. ([#&#8203;1583](diffplug/spotless#1583))
-   Support Rome as a formatter for JavaScript and TypeScript code. Adds a new `rome` step to `javascript` and `typescript` formatter configurations. ([#&#8203;1663](diffplug/spotless#1663))
-   Add semantics-aware Java import ordering (i.e. sort by package, then class, then member). ([#&#8203;522](diffplug/spotless#522))

##### Fixed

-   Fixed a regression which changed the import sorting order in `googleJavaFormat` introduced in `2.38.0`. ([#&#8203;1680](diffplug/spotless#1680))
-   Equo-based formatters now work on platforms unsupported by Eclipse such as PowerPC (fixes [durian-swt#&#8203;20](diffplug/durian-swt#20))
-   When P2 download fails, indicate the responsible formatter. ([#&#8203;1698](diffplug/spotless#1698))

##### Changes

-   Equo-based formatters now download metadata to `~/.m2/repository/dev/equo/p2-data` rather than `~/.equo`, and for CI machines without a home directory the p2 data goes to `$GRADLE_USER_HOME/caches/p2-data`. ([#&#8203;1714](diffplug/spotless#1714))
-   Bump default `googleJavaFormat` version to latest `1.16.0` -> `1.17.0`. ([#&#8203;1710](diffplug/spotless#1710))
-   Bump default `ktfmt` version to latest `0.43` -> `0.44`. ([#&#8203;1691](diffplug/spotless#1691))
-   Bump default `ktlint` version to latest `0.48.2` -> `0.49.1`. ([#&#8203;1696](diffplug/spotless#1696))
    -   Dropped support for `ktlint 0.46.x` following our policy of supporting two breaking changes at a time.
-   Bump default `sortpom` version to latest `3.0.0` -> `3.2.1`. ([#&#8203;1675](diffplug/spotless#1675))

</details>

<details>
<summary>quarkusio/quarkus</summary>

### [`v3.3.1`](quarkusio/quarkus@3.3.0...3.3.1)

[Compare Source](quarkusio/quarkus@3.3.0...3.3.1)

</details>

<details>
<summary>quarkusio/quarkus-platform</summary>

### [`v3.3.1`](quarkusio/quarkus-platform@3.3.0...3.3.1)

[Compare Source](quarkusio/quarkus-platform@3.3.0...3.3.1)

</details>

---

### Configuration

📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined).

🚦 **Automerge**: Enabled.

♻ **Rebasing**: Whenever MR is behind base branch, or you tick the rebase/retry checkbox.

👻 **Immortal**: This MR will be recreated if closed unmerged. Get [config help](https://github.com/renovatebot/renovate/discussions) if that's undesired.

---

 - [ ] <!-- rebase-check -->If you want to rebase/retry this MR, check this box

---

This MR has been generated by [Renovate Bot](https://github.com/renovatebot/renovate).
<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzNC4yNC4wIiwidXBkYXRlZEluVmVyIjoiMzQuMjQuMCJ9-->
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants