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

Issue building graalvm-native-image #1288

Closed
pascals-ager opened this issue Dec 6, 2019 · 4 comments
Closed

Issue building graalvm-native-image #1288

pascals-ager opened this issue Dec 6, 2019 · 4 comments
Labels
graalvm GraalVM releated issues

Comments

@pascals-ager
Copy link

Information

  • What sbt-native-packager are you using: --> 1.5.1
  • What sbt version: --> 1.2.8
  • What is your build system (e.g. Ubuntu, MacOS, Windows, Debian ): --> Ubuntu
  • What package are you building (e.g. docker, rpm, ...): --> Docker
  • What version has your build tool (find out with e.g. rpm --version): --> Docker version 19.03.3, build a872fc2
  • What is your target system (e.g. Ubuntu 16.04, CentOS 7): --> Ubuntu 16.04

Expected behaviour

"sbt 'show graalvm-native-image:packageBin generates the native image'"

Actual behaviour

sbt 'show graalvm-native-image:packageBin'
[info] Loading settings for project global-plugins from idea.sbt ...
[info] Loading global plugins from ${HOME}/.sbt/1.0/plugins
[info] Loading settings for project graal-test-build from plugins.sbt ...
[info] Loading project definition from ${HOME}/graal-test-app/project
[info] Loading settings for project root from build.sbt ...
[info] Set current project to graal-test (in build file:${HOME}/graal-test-app/)
[info] Updating ...
[info] Packaging ${HOME}/graal-test-app/target/scala-2.12/graal-test_2.12-0.1.0-SNAPSHOT-sources.jar ...
[info] Done packaging.
[info] Done updating.
[warn] There may be incompatibilities among your library dependencies; run 'evicted' to see detailed eviction warnings.
[info] Wrote ${HOME}/graal-test-app/target/scala-2.12/graal-test_2.12-0.1.0-SNAPSHOT.pom
[info] Main Scala API documentation to ${HOME}/graal-test-app/target/scala-2.12/api...
[info] Compiling 16 Scala sources to ${HOME}/graal-test-app/target/scala-2.12/classes ...
model contains 40 documentable templates
[info] Main Scala API documentation successful.
[info] Packaging ${HOME}/graal-test-app/target/scala-2.12/graal-test_2.12-0.1.0-SNAPSHOT-javadoc.jar ...
[info] Done packaging.
[info] Done compiling.
[info] Packaging ${HOME}/graal-test-app/target/scala-2.12/graal-test_2.12-0.1.0-SNAPSHOT.jar ...
[info] Done packaging.
[error] java.io.IOException: Cannot run program "native-image" (in directory "${HOME}/graal-test-app/target/graalvm-native-image"): error=2, No such file or directory
[error]         at java.lang.ProcessBuilder.start(ProcessBuilder.java:1048)
[error]         at scala.sys.process.ProcessBuilderImpl$Simple.run(ProcessBuilderImpl.scala:71)
[error]         at scala.sys.process.ProcessBuilderImpl$AbstractBuilder.run(ProcessBuilderImpl.scala:102)
[error]         at scala.sys.process.ProcessBuilderImpl$AbstractBuilder.$anonfun$runBuffered$1(ProcessBuilderImpl.scala:150)
[error]         at scala.runtime.java8.JFunction0$mcI$sp.apply(JFunction0$mcI$sp.java:12)
[error]         at sbt.internal.util.BufferedLogger.buffer(BufferedLogger.scala:101)
[error]         at scala.sys.process.ProcessBuilderImpl$AbstractBuilder.runBuffered(ProcessBuilderImpl.scala:150)
[error]         at scala.sys.process.ProcessBuilderImpl$AbstractBuilder.$bang(ProcessBuilderImpl.scala:116)
[error]         at com.typesafe.sbt.packager.graalvmnativeimage.GraalVMNativeImagePlugin$.buildLocal(GraalVMNativeImagePlugin.scala:102)
[error]         at com.typesafe.sbt.packager.graalvmnativeimage.GraalVMNativeImagePlugin$.$anonfun$scopedSettings$7(GraalVMNativeImagePlugin.scala:68)
[error]         at scala.Function1.$anonfun$compose$1(Function1.scala:44)
[error]         at sbt.internal.util.$tilde$greater.$anonfun$$u2219$1(TypeFunctions.scala:40)
[error]         at sbt.std.Transform$$anon$4.work(System.scala:67)
[error]         at sbt.Execute.$anonfun$submit$2(Execute.scala:269)
[error]         at sbt.internal.util.ErrorHandling$.wideConvert(ErrorHandling.scala:16)
[error]         at sbt.Execute.work(Execute.scala:278)
[error]         at sbt.Execute.$anonfun$submit$1(Execute.scala:269)
[error]         at sbt.ConcurrentRestrictions$$anon$4.$anonfun$submitValid$1(ConcurrentRestrictions.scala:178)
[error]         at sbt.CompletionService$$anon$2.call(CompletionService.scala:37)
[error]         at java.util.concurrent.FutureTask.run(FutureTask.java:266)
[error]         at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
[error]         at java.util.concurrent.FutureTask.run(FutureTask.java:266)
[error]         at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
[error]         at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
[error]         at java.lang.Thread.run(Thread.java:748)
[error] Caused by: java.io.IOException: error=2, No such file or directory
[error]         at java.lang.UNIXProcess.forkAndExec(Native Method)
[error]         at java.lang.UNIXProcess.<init>(UNIXProcess.java:247)
[error]         at java.lang.ProcessImpl.start(ProcessImpl.java:134)
[error]         at java.lang.ProcessBuilder.start(ProcessBuilder.java:1029)
[error]         at scala.sys.process.ProcessBuilderImpl$Simple.run(ProcessBuilderImpl.scala:71)
[error]         at scala.sys.process.ProcessBuilderImpl$AbstractBuilder.run(ProcessBuilderImpl.scala:102)
[error]         at scala.sys.process.ProcessBuilderImpl$AbstractBuilder.$anonfun$runBuffered$1(ProcessBuilderImpl.scala:150)
[error]         at scala.runtime.java8.JFunction0$mcI$sp.apply(JFunction0$mcI$sp.java:12)
[error]         at sbt.internal.util.BufferedLogger.buffer(BufferedLogger.scala:101)
[error]         at scala.sys.process.ProcessBuilderImpl$AbstractBuilder.runBuffered(ProcessBuilderImpl.scala:150)
[error]         at scala.sys.process.ProcessBuilderImpl$AbstractBuilder.$bang(ProcessBuilderImpl.scala:116)
[error]         at com.typesafe.sbt.packager.graalvmnativeimage.GraalVMNativeImagePlugin$.buildLocal(GraalVMNativeImagePlugin.scala:102)
[error]         at com.typesafe.sbt.packager.graalvmnativeimage.GraalVMNativeImagePlugin$.$anonfun$scopedSettings$7(GraalVMNativeImagePlugin.scala:68)
[error]         at scala.Function1.$anonfun$compose$1(Function1.scala:44)
[error]         at sbt.internal.util.$tilde$greater.$anonfun$$u2219$1(TypeFunctions.scala:40)
[error]         at sbt.std.Transform$$anon$4.work(System.scala:67)
[error]         at sbt.Execute.$anonfun$submit$2(Execute.scala:269)
[error]         at sbt.internal.util.ErrorHandling$.wideConvert(ErrorHandling.scala:16)
[error]         at sbt.Execute.work(Execute.scala:278)
[error]         at sbt.Execute.$anonfun$submit$1(Execute.scala:269)
[error]         at sbt.ConcurrentRestrictions$$anon$4.$anonfun$submitValid$1(ConcurrentRestrictions.scala:178)
[error]         at sbt.CompletionService$$anon$2.call(CompletionService.scala:37)
[error]         at java.util.concurrent.FutureTask.run(FutureTask.java:266)
[error]         at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
[error]         at java.util.concurrent.FutureTask.run(FutureTask.java:266)
[error]         at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
[error]         at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
[error]         at java.lang.Thread.run(Thread.java:748)
[error] (Graalvm-native-image / packageBin) java.io.IOException: Cannot run program "native-image" (in directory "${HOME}/graal-test-app/target/graalvm-native-image"): error=2, No such file or directory
[error] Total time: 53 s, completed Dec 6, 2019 11:28:53 AM

plugins.sbt

addSbtPlugin("com.typesafe.sbt" % "sbt-native-packager" % "1.5.1")

build.sbt

enablePlugins(GraalVMNativeImagePlugin)
containerBuildImage := Some("graal-test-app/graalvm-ce-native-image:19.1.1")

Am I missing something? Are there some special permissions that need to be set up?

@muuki88
Copy link
Contributor

muuki88 commented Dec 6, 2019

hi @pascals-ager
thanks for your detailed issue. It seems that you configured on the GraalVMNativeImagePlugin. This just a Format plugin, which doesn't configure any application specific build. You should try to add the JavaAppPackaging archetype plugin

enablePlugins(JavaAppPackaging, GraalVMNativeImagePlugin)

hope that helps
Muki

@muuki88 muuki88 closed this as completed Dec 6, 2019
@muuki88 muuki88 added the graalvm GraalVM releated issues label Dec 6, 2019
@pascals-ager
Copy link
Author

Same issue even after this:
enablePlugins(JavaAppPackaging, GraalVMNativeImagePlugin)

@muuki88
Copy link
Contributor

muuki88 commented Dec 6, 2019

Do you have graal installed? There indicates you haven't

[error] java.io.IOException: Cannot run program "native-image" (in directory "${HOME}/graal-test-app/target/graalvm-native-image"): error=2, No such file or directory

@pascals-ager
Copy link
Author

My bad, I assumed that this was going to pull a docker base image with graal installation and run the "native-image" command inside it. I see the err in my assumption now. Thank you. I will try with a local graal installation.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
graalvm GraalVM releated issues
Projects
None yet
Development

No branches or pull requests

2 participants