Open
Description
On ppc64le or aarch64:
...
!! 31 - jvm/natives.scala
...
Other tests are ok.
reproduction steps
// ensure jdk8 is your jdk, with jdk11 the tesr may pass
wget https://piccolo.link/sbt-1.3.4.tgz
wget https://github.com/scala/scala/archive/v2.12.12.tar.gz
tar -xf sbt-1.3.4.tgz
tar -xf v2.12.12.tar.gz
pushd scala-2.12.12
bash ../sbt/bin/sbt partest
popd
problem
When partest is run by jdk8 on non intels, it download intel binaries.
I run scala on ppc64le and aarch64.
I'm not sure why the issue is not observable when run by jdk11, nor was lookng on what sbt is doing here.
Thanx for any hint!
Metadata
Metadata
Assignees
Type
Projects
Milestone
Relationships
Development
No branches or pull requests
Activity
eed3si9n commentedon Jul 28, 2020
I'm not sure if this is much of a hint, but scala/test/files/jvm/natives.scala tests Java Native - https://github.com/scala/scala/blob/v2.12.12/test/files/jvm/natives.scala
That means your build needs to build
libnatives-64.so
- https://github.com/scala/scala/blob/v2.12.12/test/files/jvm/mkLibNatives.sh. Make sure that part works.judovana commentedon Jul 28, 2020
Ok, that part clearly do not work.
There is clearly downlaoded file:
.../scala-partest/scala-2.12.12/test/files/jvm/libnatives-64.so: ELF 64-bit LSB shared object, x86-64, version 1 (SYSV), dynamically linked, not stripped
Thanx for pointer. Will lookm ore to that mkLibNatives.sh
judovana commentedon Jul 28, 2020
Seeing the cygwin/darwin resolution and seeing the
CC_OPTIONS="-c -arch ppc -arch i386 -arch x86_64"
makes me a bit worried...I will try to re-dust my rotting.. no rusting:) ... C knowledge.
eed3si9n commentedon Jul 28, 2020
Yes. There's
libnatives-64.so
pre-built and checked in to scala/scala, but it's x86-64. So I guess the test currently assumes you're on Intel. I have no idea why it would work on JDK 11 for you.judovana commentedon Jul 28, 2020
I see. Well using intel prebuild binary on non intell really sounds like a bug.
I also cinsider passing on jdk11 as bug. Very likely the jdk11 is failing to open the library, but the error is somehow surpassed.
lrytz commentedon Jul 29, 2020
I really think this test is not worth the trouble it causes. On macOS you get
So I think we should remove it, and possibly replace it by a bytecode test in https://github.com/scala/scala/blob/2.13.x/test/junit/scala/tools/nsc/backend/jvm/BytecodeTest.scala
judovana commentedon Jul 29, 2020
Oh gosh:)
judovana commentedon Jul 29, 2020
I belive such a test should be around, although it is more Java test then scala test.
However this test should be skipped if there is no gcc/msvc.
And if there is, the native hsould be compiled. I dont know, but hope, that self compiled library would be ok on Mac.
judovana commentedon Jul 29, 2020
Can I somehow run only the jvm/natives.scala or at least only jvm group?
lrytz commentedon Jul 29, 2020
But again, I really think asserting the bytecode structure would be the better way forward for testing this feature. Running native code is going to cause maintenance burden again and again, and I wouldn't like the team to spend time on this.
judovana commentedon Jul 29, 2020
Eh.. that do not work... Not even files/jvm/natives.scala or jvm/natives.scala or natives.scala. Those I tried first. I addition the partest --help, as documented on readme.md is not working (or I'm misinterpreting it)
Any other dealing with this issue is up to scala team. I can fix the partest natives so it passes on nonintels (where running it alone would help) but I'm unable to write test asserting bytecode for you, You have gave me most of what I needed, and provided great support. Thank you. Crossing fingers to move on whatever you feel best for sacala. The issue can be closed now as wont fix, or wait until the test is removed/replaced/fixed.
lrytz commentedon Jul 29, 2020
That's weird.. did you make sure to run it within the sbt console? If you pass it to sbt you'd need to add quotes
otherwise sbt takes it as two commands.
I'll try to do the bytecode test soon. Having
natives.scala
fail is confusing contributors too many times.judovana commentedon Jul 29, 2020
Oh, the quotes did the job. Sorry for confusion. Readme.md is really not clear about it and sbt is not exactly wide-known tool.
Also the "partest --help" works, only it is longest wait for help ever:)
Tyvm, good luck with bytecode check.