Scala-native: Build failures cont'd

Created on 12 May 2016  Â·  6Comments  Â·  Source: scala-native/scala-native

Ubuntu 14.04
java version "1.8.0_91"
sbt-0.13.11

[debug] :: resolution report :: resolve 5217ms :: artifacts dl 24395ms
[warn] ::::::::::::::::::::::::::::::::::::::::::::::
[warn] :: UNRESOLVED DEPENDENCIES ::
[warn] ::::::::::::::::::::::::::::::::::::::::::::::
[warn] :: org.scala-native#rtlib_2.11;0.1-SNAPSHOT: not found
[warn] :: org.scala-native#nscplugin_2.11;0.1-SNAPSHOT: not found
[warn] ::::::::::::::::::::::::::::::::::::::::::::::

All 6 comments

running publishLocal on both projects fixed it for me

➜  scala-native git:(master) ✗ ./sbt test
[error] (nativelib/*:update) sbt.ResolveException: unresolved dependency: org.scala-native#rtlib_2.11;0.1-SNAPSHOT: not found
[error] unresolved dependency: org.scala-native#nscplugin_2.11;0.1-SNAPSHOT: not found
[error] Total time: 4 s, completed 12/05/2016 12:34:10 PM
➜  scala-native git:(master) ✗ ./sbt
> rtlib/publishLocal
[info] Wrote /home/ashleyis/Development/repos/scala-native/rtlib/target/scala-2.11/rtlib_2.11-0.1-SNAPSHOT.pom
....
[success] Total time: 1 s, completed 12/05/2016 12:36:17 PM
> nscplugin/publishLocal
[info] Packaging /home/ashleyis/Development/repos/scala-native/nscplugin/target/scala-2.11/nscplugin_2.11-0.1-SNAPSHOT-sources.jar ...
[success] Total time: 0 s, completed 12/05/2016 12:36:29 PM
> test
...
[success] Total time: 144 s, completed 12/05/2016 12:38:55 PM

next problem you'll probably hit is missing symbol __stderrp because its a bsdim as far as i can tell (stdio.h macro's stdout/stderr to __stdoutp and __stderrp) on linux its just stderr and stdout. i'm not sure if there's any machinery to do per platform compilation to use just the one var, but a quick fix to run the native demo on linux

diff --git a/demo-native/smallpt.scala b/demo-native/smallpt.scala
index a8f5372..69a57b3 100644
--- a/demo-native/smallpt.scala
+++ b/demo-native/smallpt.scala
@@ -163,7 +163,7 @@ object Main {
     val Xi = malloc(sizeof[Short] * 3).cast[Ptr[Short]]
     var y = 0
     while (y < H) {
-      fprintf(__stderrp, c"\rRendering (%d spp) %5.2f%%", SAMPLES * 4, 100.0 * y/(H-1))
+      fprintf(stderr, c"\rRendering (%d spp) %5.2f%%", SAMPLES * 4, 100.0 * y/(H-1))
       Xi(0) = 0.toShort
       Xi(1) = 0.toShort
       Xi(2) = (y * y * y).toShort
diff --git a/nativelib/src/main/scala/scala/scalanative/native/stdlib.scala b/nativelib/src/main/scala/scala/scalanative/native/stdlib.scala
index a5b8763..2836bfb 100644
--- a/nativelib/src/main/scala/scala/scalanative/native/stdlib.scala
+++ b/nativelib/src/main/scala/scala/scalanative/native/stdlib.scala
@@ -2,8 +2,8 @@ package scala.scalanative
 package native

 @extern object stdlib {
-  var __stderrp: Ptr[_] = extern
-  var __stdoutp: Ptr[_] = extern
+  var stderr: Ptr[_] = extern
+  var stdout: Ptr[_] = extern
   def fopen(filename: CString, mode: CString): Ptr[_] = extern
   def fprintf(stream: Ptr[_], format: CString, args: Any*): CInt = extern
   def malloc(size: Word): Ptr[_] = extern

I am facing the same issue:

 sbt package
[info] Loading global plugins from /home/saleem/.sbt/0.13/plugins
[info] Loading project definition from /home/saleem/work/scala-native/project
[info] Set current project to scala-native (in build file:/home/saleem/work/scala-native/)
[info] Updating {file:/home/saleem/work/scala-native/}nativelib...
[info] Resolving org.scala-native#rtlib_2.11;0.1-SNAPSHOT ...
[warn]  module not found: org.scala-native#rtlib_2.11;0.1-SNAPSHOT
[warn] ==== local: tried
[warn]   /home/saleem/.ivy2/local/org.scala-native/rtlib_2.11/0.1-SNAPSHOT/ivys/ivy.xml
[warn] ==== jcenter: tried
[warn]   https://jcenter.bintray.com/org/scala-native/rtlib_2.11/0.1-SNAPSHOT/rtlib_2.11-0.1-SNAPSHOT.pom
[warn] ==== public: tried
[warn]   https://repo1.maven.org/maven2/org/scala-native/rtlib_2.11/0.1-SNAPSHOT/rtlib_2.11-0.1-SNAPSHOT.pom
[info] Resolving org.scala-native#nscplugin_2.11;0.1-SNAPSHOT ...
[warn]  module not found: org.scala-native#nscplugin_2.11;0.1-SNAPSHOT
[warn] ==== local: tried
[warn]   /home/saleem/.ivy2/local/org.scala-native/nscplugin_2.11/0.1-SNAPSHOT/ivys/ivy.xml
[warn] ==== jcenter: tried
[warn]   https://jcenter.bintray.com/org/scala-native/nscplugin_2.11/0.1-SNAPSHOT/nscplugin_2.11-0.1-SNAPSHOT.pom
[warn] ==== public: tried
[warn]   https://repo1.maven.org/maven2/org/scala-native/nscplugin_2.11/0.1-SNAPSHOT/nscplugin_2.11-0.1-SNAPSHOT.pom
[info] Resolving com.github.scopt#scopt_2.11;3.3.0 ...
[warn]  ::::::::::::::::::::::::::::::::::::::::::::::
[warn]  ::          UNRESOLVED DEPENDENCIES         ::
[warn]  ::::::::::::::::::::::::::::::::::::::::::::::
[warn]  :: org.scala-native#rtlib_2.11;0.1-SNAPSHOT: not found
[warn]  :: org.scala-native#nscplugin_2.11;0.1-SNAPSHOT: not found
[warn]  ::::::::::::::::::::::::::::::::::::::::::::::
[warn] 
[warn]  Note: Unresolved dependencies path:
[warn]      org.scala-native:rtlib_2.11:0.1-SNAPSHOT ((scala.scalanative.sbtplugin.ScalaNativePluginInternal) ScalaNativePluginInternal.scala#L57)
[warn]        +- org.scala-native:nativelib_2.11:0.1-SNAPSHOT
[warn]      org.scala-native:nscplugin_2.11:0.1-SNAPSHOT ((sbt.BuildExtra) Defaults.scala#L1850)
[warn]        +- org.scala-native:nativelib_2.11:0.1-SNAPSHOT
[info] Packaging /home/saleem/work/scala-native/sbtplugin/target/scala-2.10/sbt-0.13/sbtplugin-0.1-SNAPSHOT.jar ...
[info] Done packaging.
sbt.ResolveException: unresolved dependency: org.scala-native#rtlib_2.11;0.1-SNAPSHOT: not found
unresolved dependency: org.scala-native#nscplugin_2.11;0.1-SNAPSHOT: not found
    at sbt.IvyActions$.sbt$IvyActions$$resolve(IvyActions.scala:294)
    at sbt.IvyActions$$anonfun$updateEither$1.apply(IvyActions.scala:191)
    at sbt.IvyActions$$anonfun$updateEither$1.apply(IvyActions.scala:168)
    at sbt.IvySbt$Module$$anonfun$withModule$1.apply(Ivy.scala:155)
    at sbt.IvySbt$Module$$anonfun$withModule$1.apply(Ivy.scala:155)
    at sbt.IvySbt$$anonfun$withIvy$1.apply(Ivy.scala:132)
    at sbt.IvySbt.sbt$IvySbt$$action$1(Ivy.scala:57)
    at sbt.IvySbt$$anon$4.call(Ivy.scala:65)

Did you try

> rtlib/publishLocal
> nscplugin/publishLocal

Added a PR for what you suggested:

Getting things build on Linux a bit complicated at the moment, @andreaTP's docker script is the easiest way to do it semi-automatically right now. We're currently working on making it easier. I've gathered all the common issues people are hitting in https://github.com/scala-native/scala-native/issues/102 , follow that ticket for updates.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

LeeTibbert picture LeeTibbert  Â·  4Comments

valencik picture valencik  Â·  3Comments

david-bouyssie picture david-bouyssie  Â·  5Comments

mkotsbak picture mkotsbak  Â·  4Comments

phdoerfler picture phdoerfler  Â·  3Comments