Skip to content
This repository has been archived by the owner on Mar 16, 2022. It is now read-only.

Graal support in the backend-platform #18

Closed
viktorklang opened this issue Apr 2, 2019 · 6 comments
Closed

Graal support in the backend-platform #18

viktorklang opened this issue Apr 2, 2019 · 6 comments
Labels
backend platform Issues related to the backend platform

Comments

@viktorklang
Copy link
Contributor

It would be extremely interesting to be able to make the sidecar application a Graal Native Image.

@viktorklang viktorklang added the backend platform Issues related to the backend platform label Apr 2, 2019
@viktorklang
Copy link
Contributor Author

Useful links:

https://github.com/vmencik/akka-graal-native/blob/master/README.md
https://www.graalvm.org/docs/getting-started/
https://github.com/oracle/graal/blob/master/substratevm/CONFIGURE.md

One possible solution is to have the AKKA backend Reference Implementation launched in a Graal Docker Image with the Assisted Configuration agentlib enabled, then running a simulation to exercise all the code paths needed to generate a configuration, which can then be fed into the native image builder to generate a native image of the RI.

@raboof
Copy link
Contributor

raboof commented Jul 23, 2019

👍 . Also see https://github.com/vmencik/akka-graal-config

@viktorklang
Copy link
Contributor Author

viktorklang commented Jul 29, 2019

Currently hit oracle/graal#1306

[error] Detailed message:
[error] Error: com.oracle.graal.pointsto.constraints.UnsupportedFeatureException: Invoke with MethodHandle argument could not be reduced to at most a single call: java.lang.invoke.MethodHandle.bindTo(Object)
[error] Trace:
[error] 	at parsing java.lang.invoke.MethodHandleImpl.makePairwiseConvertByEditor(MethodHandleImpl.java:221)
[error] Call path from entry point to java.lang.invoke.MethodHandleImpl.makePairwiseConvertByEditor(MethodHandle, MethodType, boolean, boolean):
[error] 	at java.lang.invoke.MethodHandleImpl.makePairwiseConvertByEditor(MethodHandleImpl.java:207)
[error] 	at java.lang.invoke.MethodHandleImpl.makePairwiseConvert(MethodHandleImpl.java:194)
[error] 	at java.lang.invoke.MethodHandleImpl.makePairwiseConvert(MethodHandleImpl.java:380)
[error] 	at java.lang.invoke.MethodHandle.asTypeUncached(MethodHandle.java:776)
[error] 	at java.lang.invoke.MethodHandle.asType(MethodHandle.java:761)
[error] 	at java.lang.invoke.MethodHandleImpl.makeVarargsCollector(MethodHandleImpl.java:443)
[error] 	at java.lang.invoke.MethodHandle.setVarargs(MethodHandle.java:1325)
[error] 	at java.lang.invoke.MethodHandles$Lookup.getDirectMethodCommon(MethodHandles.java:1670)
[error] 	at java.lang.invoke.MethodHandles$Lookup.getDirectMethod(MethodHandles.java:1605)
[error] 	at java.lang.invoke.MethodHandles$Lookup.findStatic(MethodHandles.java:781)
[error] 	at java.lang.invoke.BoundMethodHandle$Factory.makeCbmhCtor(BoundMethodHandle.java:818)
[error] 	at java.lang.invoke.BoundMethodHandle$Factory.makeCtors(BoundMethodHandle.java:763)
[error] 	at java.lang.invoke.BoundMethodHandle$SpeciesData.<init>(BoundMethodHandle.java:349)
[error] 	at java.lang.invoke.BoundMethodHandle$SpeciesData$1.apply(BoundMethodHandle.java:389)
[error] 	at java.lang.invoke.BoundMethodHandle$SpeciesData$1.apply(BoundMethodHandle.java:383)
[error] 	at akka.management.scaladsl.AkkaManagement.$anonfun$prepareCombinedRoutes$3(AkkaManagement.scala:192)
[error] 	at akka.management.scaladsl.AkkaManagement$$Lambda$95881/65344971.apply(Unknown Source)
[error] 	at scala.collection.Iterator$$anon$10.next(Iterator.scala:459)
[error] 	at scala.collection.convert.Wrappers$SetWrapper$$anon$1.next(Wrappers.scala:119)
[error] 	at java.util.AbstractCollection.containsAll(AbstractCollection.java:317)
[error] 	at java.util.RegularEnumSet.containsAll(RegularEnumSet.java:199)
[error] 	at com.oracle.svm.core.amd64.AMD64CPUFeatureAccess.verifyHostSupportsArchitecture(AMD64CPUFeatureAccess.java:172)
[error] 	at com.oracle.svm.core.JavaMainWrapper.run(JavaMainWrapper.java:125)
[error] 	at com.oracle.svm.core.code.IsolateEnterStub.JavaMainWrapper_run_5087f5482cc9a6abc971913ece43acb471d2631b(generated:0)
[error] Error: com.oracle.graal.pointsto.constraints.UnsupportedFeatureException: Invoke with MethodHandle argument could not be reduced to at most a single call: java.lang.invoke.MethodHandleImpl$BindCaller.prepareForInvoker(MethodHandle)
sbt:cloudstate> [error] Trace:
[error] 	at parsing java.lang.invoke.MethodHandleImpl$BindCaller.makeInjectedInvoker(MethodHandleImpl.java:1166)
[error] Call path from entry point to java.lang.invoke.MethodHandleImpl$BindCaller.makeInjectedInvoker(Class):
[error] 	at java.lang.invoke.MethodHandleImpl$BindCaller.makeInjectedInvoker(MethodHandleImpl.java:1141)
[error] 	at java.lang.invoke.MethodHandleImpl$BindCaller.access$300(MethodHandleImpl.java:1122)
[error] 	at java.lang.invoke.MethodHandleImpl$BindCaller$1.computeValue(MethodHandleImpl.java:1175)
[error] 	at java.lang.invoke.MethodHandleImpl$BindCaller$1.computeValue(MethodHandleImpl.java:1173)
[error] 	at com.oracle.svm.core.jdk.Target_java_lang_ClassValue.get(JavaLangSubstitutions.java:507)
[error] 	at java.lang.invoke.MethodHandleImpl$BindCaller.bindCaller(MethodHandleImpl.java:1136)
[error] 	at java.lang.invoke.MethodHandleImpl.bindCaller(MethodHandleImpl.java:1117)
[error] 	at java.lang.invoke.MethodHandles$Lookup.maybeBindCaller(MethodHandles.java:1681)
[error] 	at java.lang.invoke.MethodHandles$Lookup.getDirectMethodCommon(MethodHandles.java:1669)
[error] 	at java.lang.invoke.MethodHandles$Lookup.getDirectMethod(MethodHandles.java:1605)
[error] 	at java.lang.invoke.MethodHandles$Lookup.findStatic(MethodHandles.java:781)
[error] 	at java.lang.invoke.BoundMethodHandle$Factory.makeCbmhCtor(BoundMethodHandle.java:818)
[error] 	at java.lang.invoke.BoundMethodHandle$Factory.makeCtors(BoundMethodHandle.java:763)
[error] 	at java.lang.invoke.BoundMethodHandle$SpeciesData.<init>(BoundMethodHandle.java:349)
[error] 	at java.lang.invoke.BoundMethodHandle$SpeciesData$1.apply(BoundMethodHandle.java:389)
[error] 	at java.lang.invoke.BoundMethodHandle$SpeciesData$1.apply(BoundMethodHandle.java:383)
[error] 	at akka.management.scaladsl.AkkaManagement.$anonfun$prepareCombinedRoutes$3(AkkaManagement.scala:192)
[error] 	at akka.management.scaladsl.AkkaManagement$$Lambda$95881/65344971.apply(Unknown Source)
[error] 	at scala.collection.Iterator$$anon$10.next(Iterator.scala:459)
[error] 	at scala.collection.convert.Wrappers$SetWrapper$$anon$1.next(Wrappers.scala:119)
[error] 	at java.util.AbstractCollection.containsAll(AbstractCollection.java:317)
[error] 	at java.util.RegularEnumSet.containsAll(RegularEnumSet.java:199)
[error] 	at com.oracle.svm.core.amd64.AMD64CPUFeatureAccess.verifyHostSupportsArchitecture(AMD64CPUFeatureAccess.java:172)
[error] 	at com.oracle.svm.core.JavaMainWrapper.run(JavaMainWrapper.java:125)
[error] 	at com.oracle.svm.core.code.IsolateEnterStub.JavaMainWrapper_run_5087f5482cc9a6abc971913ece43acb471d2631b(generated:0)

@viktorklang
Copy link
Contributor Author

See: oracle/graal#1376
See: oracle/graal#955

@viktorklang
Copy link
Contributor Author

This is also worth keeping an eye on, as it is currently cumbersome to deal with sunec.dylib: oracle/graal#1336

@viktorklang
Copy link
Contributor Author

Implemented in master

raboof added a commit to raboof/cloudstate that referenced this issue Feb 12, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
backend platform Issues related to the backend platform
Projects
None yet
Development

No branches or pull requests

2 participants