Skip to content

feat(architecture): support arm64 based on JDK17 #6327

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

Open
wants to merge 21 commits into
base: release_v4.8.1
Choose a base branch
from

Conversation

halibobo1205
Copy link
Contributor

Closes #5954

@halibobo1205 halibobo1205 marked this pull request as draft May 13, 2025 07:25
@halibobo1205 halibobo1205 changed the title feat(architecture): support arm64 feat(architecture): support arm64 based on JDK17 May 13, 2025
@troncommons
Copy link

The release_v4.8.1 branch has been created. Please make sure to update the target branch of your PRs if they are intended for the next release.

@halibobo1205 halibobo1205 changed the base branch from develop to release_v4.8.1 June 13, 2025 11:28
@halibobo1205 halibobo1205 marked this pull request as ready for review June 27, 2025 09:51
@kuny0707 kuny0707 moved this to In Review in java-tron Jun 30, 2025
@@ -16,6 +19,17 @@

public class ApiUtilTest {


@BeforeClass
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there any benefit that add init and clear methods ? It seems no component used in this case.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Using the correct configuration instead of reusing the configuration from the previous unit test resulted in an error.

addPowData("3ff00033d5ab51c8", POW, "3ff0000006a279c8"); // 6240974
addPowData("3ff0000046d74585", POW, "3ff0000000091150"); // 6279093
addPowData("3ff0010403f34767", POW, "3ff0000021472146"); // 6428736
addPowData("3ff00496fe59bc98", POW, "3ff000009650a4ca"); // 6432355,6493373
Copy link
Contributor

@317787106 317787106 Jul 2, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What's the meaning of 6432355,6493373? Two blocks ?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes

/**
* copy from org.bouncycastle.util.Arrays.compareUnsigned
*/
private static int compareUnsigned(byte[] a, byte[] b) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why not use org.bouncycastle.util.Arrays.compareUnsigned directly ? StrictMath.min don't affect this.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The platform is an architecture-related module, whereas BouncyCastle is architecture-independent; therefore, it has not been introduced.

} else if (isArm64()) {
ext {
leveldbGroup = "com.halibobor"
leveldbName = "leveldbjni-all"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why does the arm environment need leveldbjni? Is it for running test cases? Can the test cases that depend on leveldbjni be excluded from execution?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's a great suggestion. I'll give it a try.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

After trying it out, the changes were significant, and the results could not be verified in a short period, so no action was taken for the time being.

if (!isAlive()) {
logger.warn("DB {} is not alive.", dataBaseName);
throw new org.iq80.leveldb.DBException("DB " + this.getDBName() + " is closed.");

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is there any problem here? throw leveldb DBException in RocksDb?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No, there are no issues. To unify database exceptions.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ok

    - update condition to check for NullPointerException instances
    - maintain compatibility with both pre-Java 14 and Java 14+ versions
    - address JEP 358 changes to NullPointerException behavior
    - ensure correct handling of non-empty NPE messages in Java 14+

    Refs: JEP 358, JDK-8220715
  - use `java.specification.version` instead of parsing `java.version`
  - ensure consistent version reporting across different Java releases(jdk10+)
   add javax.jws-api:1.1 and javax.annotation-api:1.3.2, refs:JDK-8190378, JEP 320
   remove com.carrotsearch:java-sizeof:0.0.5
   bump lombok from 1.18.12 to 1.18.34, refs: [Lombok Changelog](https://projectlombok.org/changelog)
   bump aspectjrt from 1.18.13 to 1.9.8, refs: [AspectJ Java version compatibility](https://eclipse.dev/aspectj/doc/latest/release/JavaVersionCompatibility.html)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: In Review
Development

Successfully merging this pull request may close these issues.

Expand ARM Architecture Compatibility
7 participants