jnr / jnr-posix

Java Posix layer
Other
241 stars 91 forks source link

Support for LoongArch64 #179

Closed Panxuefeng-loongson closed 1 year ago

Panxuefeng-loongson commented 2 years ago

I tested as you suggested, I found that LoongArch support should be added in this repo. I ran tests on the changes and one test failed, I don't know how to fix this failure, can you give me some advice?@headius

Tests run: 32, Failures: 1, Errors: 0, Skipped: 0, Time elapsed: 5.481 sec <<< FAILURE! - in jnr.posix.FileTest
readlinkPointerTest(jnr.posix.FileTest)  Time elapsed: 0.022 sec  <<< FAILURE!
org.junit.ComparisonFailure: expected:</tmp/jnr-p[?six-r??dl?nk-t?]st175907513659061277...> but was:</tmp/jnr-p[?six-r??dl?nk-t?]st175907513659061277...>
        at org.junit.Assert.assertEquals(Assert.java:117)
        at org.junit.Assert.assertEquals(Assert.java:146)
        at jnr.posix.FileTest.readlinkPointerTest(FileTest.java:590)
headius commented 1 year ago

Back to this again... I have enabled the actions to run on this PR. I'm not sure what is up with that failure but it doesn't seem to be critical right now. I can merge this and get a release out soon and we'll look into that failure separately.

Panxuefeng-loongson commented 1 year ago

Good news! Thanks

Panxuefeng-loongson commented 1 year ago

The jruby pre-dependencies seem to have been resolved. Is it true that after the new version of jnr is released, I can submit a PR to jruby that supports LoongArch? @headius

headius commented 1 year ago

@Panxuefeng-loongson Yes we will make a new release of the entire jnr stack soon. I am waiting on some Debian compatibility PRs to land and some updated binaries based on those patches. Once that's done I'll release everything from jffi up and incorporate the new versions into JRuby.

Panxuefeng-loongson commented 1 year ago

@headius I just looked at it, and if LoongArch is supported, the jruby code doesn't seem to need a lot of changes. When I have time recently, I may commit LoongArch's changes to jruby first, and then verify the functionality when the new version of jnr is released.

headius commented 1 year ago

@Panxuefeng-loongson Sure, we can do this in parallel with PRs. I'm still working with @jcharaoui on getting some Debian patches merged into jffi so we can do a better release, but hopefully we'll get through that soon.

zunley commented 1 year ago

@Panxuefeng-loongson There is a more obvious error is the conversion of integers to Boolean values. It is generally considered that the number less than or equal to 0 is false, but in this test, the sign is determined by the parity of the numbers.

Failed tests: 
  FileTest.accessTest:509 access /tmp/jnr-posix-access-test141337766811127662tmp for write:  expected:<-1> but was:<0>
  FileTest.readlinkPointerTest:581 expected:</tmp/jnr-p[?six-r??dl?nk-t?]st897561797034758869...> but was:</tmp/jnr-p[?six-r??dl?nk-t?]st897561797034758869...>
  ProcessTest.testGetRLimit:49 Bad soft limit for number of processes
  ProcessTest.testGetRLimitPointer:83 Bad soft limit for number of processes
  ProcessTest.testGetRLimitPreallocatedRlimit:66 Bad soft limit for number of processes

Tests run: 101, Failures: 5, Errors: 0, Skipped: 0
Panxuefeng-loongson commented 1 year ago

@merore Thank you for the validation. I will take the time to fix this issue