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

StackTrace normalization does not like spaces in file name #712

Closed
sjrd opened this Issue Jun 5, 2014 · 10 comments

Comments

Projects
None yet
2 participants
@sjrd
Member

sjrd commented Jun 5, 2014

@sjrd sjrd added this to the v0.5.0 milestone Jun 5, 2014

@sjrd sjrd added the bug label Jun 5, 2014

@sjrd sjrd self-assigned this Jun 5, 2014

@sjrd

This comment has been minimized.

Show comment
Hide comment
@sjrd

sjrd Jun 5, 2014

Member

Note that this is moderately severe, as it basically prevents source mapping in the sbt plugin (not in browsers).

Member

sjrd commented Jun 5, 2014

Note that this is moderately severe, as it basically prevents source mapping in the sbt plugin (not in browsers).

@sjrd

This comment has been minimized.

Show comment
Hide comment
@sjrd

sjrd Jun 5, 2014

Member

@lihaoyi I can't reproduce the problem. Could you please push a project where this fails on GitHub, and give step-by-step sbt commands to run to reproduce the issue?

Member

sjrd commented Jun 5, 2014

@lihaoyi I can't reproduce the problem. Could you please push a project where this fails on GitHub, and give step-by-step sbt commands to run to reproduce the issue?

@sjrd

This comment has been minimized.

Show comment
Hide comment
@sjrd

sjrd Jun 5, 2014

Member

Hum it seems this is more related to the presence of () than spaces. Still can't reproduce, though.

Member

sjrd commented Jun 5, 2014

Hum it seems this is more related to the presence of () than spaces. Still can't reproduce, though.

@lihaoyi

This comment has been minimized.

Show comment
Hide comment
@lihaoyi

lihaoyi Jun 5, 2014

Contributor

Hum, for some reason I am now not able to reproduce either, but here's a different problem when I tried to do so:

> cd /Users/haoyi/Dropbox (Personal)/Workspace
> git clone https://github.com/sjrd/scala-js-example-app -b next

Apply this patch

haoyi-mbp:scala-js-example-app haoyi$ git diff
diff --git a/build.sbt b/build.sbt
index bd531bb..172a5e0 100644
--- a/build.sbt
+++ b/build.sbt
@@ -1,4 +1,7 @@
 // Turn this project into a Scala.js project by importing these settings
+import scala.scalajs.sbtplugin.env.nodejs.NodeJSEnv
+import ScalaJSKeys._
+
 scalaJSSettings

 name := "Example"
@@ -15,3 +18,5 @@ libraryDependencies ++= Seq(
     "org.scala-lang.modules.scalajs" %%% "scalajs-dom" % "0.5",
     "org.scala-lang.modules.scalajs" %% "scalajs-jasmine-test-framework" % scalaJSVersion % "test"
 )
+
+(jsEnv in Compile) := new NodeJSEnv
diff --git a/src/main/scala/example/ScalaJSExample.scala b/src/main/scala/example/ScalaJSExample.scala
index 7cf5431..1b0a1b1 100644
--- a/src/main/scala/example/ScalaJSExample.scala
+++ b/src/main/scala/example/ScalaJSExample.scala
@@ -2,13 +2,10 @@ package example

 import scala.scalajs.js
 import js.annotation.JSExport
-import org.scalajs.dom

 object ScalaJSExample extends js.JSApp {
   def main(): Unit = {
-    val paragraph = dom.document.createElement("p")
-    paragraph.innerHTML = "<strong>It works!</strong>"
-    dom.document.getElementById("playground").appendChild(paragraph)
+    throw new Exception("omg")
   }

   /** Computes the square of an integer.

Then try to run it:

haoyi-mbp:scala-js-example-app haoyi$ sbt run
[info] Loading global plugins from /Users/haoyi/.sbt/0.13/plugins
[info] Loading project definition from /Users/haoyi/Dropbox (Personal)/Workspace/scala-js-example-app/project
[info] Set current project to Example (in build file:/Users/haoyi/Dropbox%20(Personal)/Workspace/scala-js-example-app/)
[info] Updating {file:/Users/haoyi/Dropbox%20(Personal)/Workspace/scala-js-example-app/}scala-js-example-app...
[info] Resolving jline#jline;2.11 ...
[info] Done updating.
[info] Running example.ScalaJSExample
[error]
[error] [stdin]:89719
[error]   throw ScalaJS.unwrapJavaScriptException(new ScalaJS.c.jl_Exception().init___
[error]                 ^
[error] java.lang.Exception: omg
java.lang.RuntimeException: node.js exited with code 8
    at scala.sys.package$.error(package.scala:27)
    at scala.scalajs.sbtplugin.env.ExternalJSEnv.runJS(ExternalJSEnv.scala:61)
    at scala.scalajs.sbtplugin.ScalaJSPlugin$.scala$scalajs$sbtplugin$ScalaJSPlugin$$jsRun(ScalaJSPlugin.scala:443)
package example
    at scala.scalajs.sbtplugin.ScalaJSPlugin$$anonfun$49$$anonfun$apply$17$$anonfun$apply$18.apply(ScalaJSPlugin.scala:499)
    at scala.scalajs.sbtplugin.ScalaJSPlugin$$anonfun$49$$anonfun$apply$17$$anonfun$apply$18.apply(ScalaJSPlugin.scala:493)
    at scala.Function1$$anonfun$compose$1.apply(Function1.scala:47)
[trace] Stack trace suppressed: run last compile:run for the full output.
[error] (compile:run) node.js exited with code 8
[error] Total time: 7 s, completed Jun 5, 2014 9:37:45 AM

Will poke around and see if I can repro the original. This is on OSX 10.9/Java 6

Contributor

lihaoyi commented Jun 5, 2014

Hum, for some reason I am now not able to reproduce either, but here's a different problem when I tried to do so:

> cd /Users/haoyi/Dropbox (Personal)/Workspace
> git clone https://github.com/sjrd/scala-js-example-app -b next

Apply this patch

haoyi-mbp:scala-js-example-app haoyi$ git diff
diff --git a/build.sbt b/build.sbt
index bd531bb..172a5e0 100644
--- a/build.sbt
+++ b/build.sbt
@@ -1,4 +1,7 @@
 // Turn this project into a Scala.js project by importing these settings
+import scala.scalajs.sbtplugin.env.nodejs.NodeJSEnv
+import ScalaJSKeys._
+
 scalaJSSettings

 name := "Example"
@@ -15,3 +18,5 @@ libraryDependencies ++= Seq(
     "org.scala-lang.modules.scalajs" %%% "scalajs-dom" % "0.5",
     "org.scala-lang.modules.scalajs" %% "scalajs-jasmine-test-framework" % scalaJSVersion % "test"
 )
+
+(jsEnv in Compile) := new NodeJSEnv
diff --git a/src/main/scala/example/ScalaJSExample.scala b/src/main/scala/example/ScalaJSExample.scala
index 7cf5431..1b0a1b1 100644
--- a/src/main/scala/example/ScalaJSExample.scala
+++ b/src/main/scala/example/ScalaJSExample.scala
@@ -2,13 +2,10 @@ package example

 import scala.scalajs.js
 import js.annotation.JSExport
-import org.scalajs.dom

 object ScalaJSExample extends js.JSApp {
   def main(): Unit = {
-    val paragraph = dom.document.createElement("p")
-    paragraph.innerHTML = "<strong>It works!</strong>"
-    dom.document.getElementById("playground").appendChild(paragraph)
+    throw new Exception("omg")
   }

   /** Computes the square of an integer.

Then try to run it:

haoyi-mbp:scala-js-example-app haoyi$ sbt run
[info] Loading global plugins from /Users/haoyi/.sbt/0.13/plugins
[info] Loading project definition from /Users/haoyi/Dropbox (Personal)/Workspace/scala-js-example-app/project
[info] Set current project to Example (in build file:/Users/haoyi/Dropbox%20(Personal)/Workspace/scala-js-example-app/)
[info] Updating {file:/Users/haoyi/Dropbox%20(Personal)/Workspace/scala-js-example-app/}scala-js-example-app...
[info] Resolving jline#jline;2.11 ...
[info] Done updating.
[info] Running example.ScalaJSExample
[error]
[error] [stdin]:89719
[error]   throw ScalaJS.unwrapJavaScriptException(new ScalaJS.c.jl_Exception().init___
[error]                 ^
[error] java.lang.Exception: omg
java.lang.RuntimeException: node.js exited with code 8
    at scala.sys.package$.error(package.scala:27)
    at scala.scalajs.sbtplugin.env.ExternalJSEnv.runJS(ExternalJSEnv.scala:61)
    at scala.scalajs.sbtplugin.ScalaJSPlugin$.scala$scalajs$sbtplugin$ScalaJSPlugin$$jsRun(ScalaJSPlugin.scala:443)
package example
    at scala.scalajs.sbtplugin.ScalaJSPlugin$$anonfun$49$$anonfun$apply$17$$anonfun$apply$18.apply(ScalaJSPlugin.scala:499)
    at scala.scalajs.sbtplugin.ScalaJSPlugin$$anonfun$49$$anonfun$apply$17$$anonfun$apply$18.apply(ScalaJSPlugin.scala:493)
    at scala.Function1$$anonfun$compose$1.apply(Function1.scala:47)
[trace] Stack trace suppressed: run last compile:run for the full output.
[error] (compile:run) node.js exited with code 8
[error] Total time: 7 s, completed Jun 5, 2014 9:37:45 AM

Will poke around and see if I can repro the original. This is on OSX 10.9/Java 6

@lihaoyi

This comment has been minimized.

Show comment
Hide comment
@lihaoyi

lihaoyi Jun 5, 2014

Contributor

For some reason, even if I set it to use PhantomJS

haoyi-mbp:scala-js-example-app haoyi$ git diff
diff --git a/build.sbt b/build.sbt
index bd531bb..d9681d4 100644
--- a/build.sbt
+++ b/build.sbt
@@ -1,4 +1,7 @@
 // Turn this project into a Scala.js project by importing these settings
+import scala.scalajs.sbtplugin.env.phantomjs.PhantomJSEnv
+import ScalaJSKeys._
+
 scalaJSSettings

 name := "Example"
@@ -15,3 +18,5 @@ libraryDependencies ++= Seq(
     "org.scala-lang.modules.scalajs" %%% "scalajs-dom" % "0.5",
     "org.scala-lang.modules.scalajs" %% "scalajs-jasmine-test-framework" % scalaJSVersion % "test"
 )
+
+jsEnv := new PhantomJSEnv
diff --git a/src/main/scala/example/ScalaJSExample.scala b/src/main/scala/example/ScalaJSExample.scala
index 7cf5431..1b0a1b1 100644
--- a/src/main/scala/example/ScalaJSExample.scala
+++ b/src/main/scala/example/ScalaJSExample.scala
@@ -2,13 +2,10 @@ package example

 import scala.scalajs.js
 import js.annotation.JSExport
-import org.scalajs.dom

 object ScalaJSExample extends js.JSApp {
   def main(): Unit = {
-    val paragraph = dom.document.createElement("p")
-    paragraph.innerHTML = "<strong>It works!</strong>"
-    dom.document.getElementById("playground").appendChild(paragraph)
+    throw new Exception("omg")
   }

   /** Computes the square of an integer.

It still says node.js crashed (???)

haoyi-mbp:scala-js-example-app haoyi$ sbt fastOptStage::run
[info] Loading global plugins from /Users/haoyi/.sbt/0.13/plugins
[info] Loading project definition from /Users/haoyi/Dropbox (Personal)/Workspace/scala-js-example-app/project
[info] Set current project to Example (in build file:/Users/haoyi/Dropbox%20(Personal)/Workspace/scala-js-example-app/)
[info] Running example.ScalaJSExample
[error]
[error] /Users/haoyi/Dropbox (Personal)/Workspace/scala-js-example-app/target/scala-2.11/example-fastopt.js:1433
[error]   throw ScalaJS.unwrapJavaScriptException(new ScalaJS.c.jl_Exception().init___
[error]                 ^
[error] java.lang.Exception: omg
java.lang.RuntimeException: node.js exited with code 8
    at scala.sys.package$.error(package.scala:27)
    at scala.scalajs.sbtplugin.env.ExternalJSEnv.runJS(ExternalJSEnv.scala:61)
    at scala.scalajs.sbtplugin.ScalaJSPlugin$.scala$scalajs$sbtplugin$ScalaJSPlugin$$jsRun(ScalaJSPlugin.scala:443)
    at scala.scalajs.sbtplugin.ScalaJSPlugin$$anonfun$49$$anonfun$apply$17$$anonfun$apply$18.apply(ScalaJSPlugin.scala:499)
    at scala.scalajs.sbtplugin.ScalaJSPlugin$$anonfun$49$$anonfun$apply$17$$anonfun$apply$18.apply(ScalaJSPlugin.scala:493)
    at scala.Function1$$anonfun$compose$1.apply(Function1.scala:47)
    at sbt.$tilde$greater$$anonfun$$u2219$1.apply(TypeFunctions.scala:42)
    at sbt.std.Transform$$anon$4.work(System.scala:64)
    at sbt.Execute$$anonfun$submit$1$$anonfun$apply$1.apply(Execute.scala:237)
    at sbt.Execute$$anonfun$submit$1$$anonfun$apply$1.apply(Execute.scala:237)
    at sbt.ErrorHandling$.wideConvert(ErrorHandling.scala:18)
    at sbt.Execute.work(Execute.scala:244)
    at sbt.Execute$$anonfun$submit$1.apply(Execute.scala:237)
    at sbt.Execute$$anonfun$submit$1.apply(Execute.scala:237)
    at sbt.ConcurrentRestrictions$$anon$4$$anonfun$1.apply(ConcurrentRestrictions.scala:160)
    at sbt.CompletionService$$anon$2.call(CompletionService.scala:30)
    at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)
    at java.util.concurrent.FutureTask.run(FutureTask.java:138)
    at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:439)
    at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)
    at java.util.concurrent.FutureTask.run(FutureTask.java:138)
    at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:895)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:918)
    at java.lang.Thread.run(Thread.java:695)
[error] (compile:fastOptStage::run) node.js exited with code 8
[error] Total time: 1 s, completed Jun 5, 2014 9:44:02 AM
Contributor

lihaoyi commented Jun 5, 2014

For some reason, even if I set it to use PhantomJS

haoyi-mbp:scala-js-example-app haoyi$ git diff
diff --git a/build.sbt b/build.sbt
index bd531bb..d9681d4 100644
--- a/build.sbt
+++ b/build.sbt
@@ -1,4 +1,7 @@
 // Turn this project into a Scala.js project by importing these settings
+import scala.scalajs.sbtplugin.env.phantomjs.PhantomJSEnv
+import ScalaJSKeys._
+
 scalaJSSettings

 name := "Example"
@@ -15,3 +18,5 @@ libraryDependencies ++= Seq(
     "org.scala-lang.modules.scalajs" %%% "scalajs-dom" % "0.5",
     "org.scala-lang.modules.scalajs" %% "scalajs-jasmine-test-framework" % scalaJSVersion % "test"
 )
+
+jsEnv := new PhantomJSEnv
diff --git a/src/main/scala/example/ScalaJSExample.scala b/src/main/scala/example/ScalaJSExample.scala
index 7cf5431..1b0a1b1 100644
--- a/src/main/scala/example/ScalaJSExample.scala
+++ b/src/main/scala/example/ScalaJSExample.scala
@@ -2,13 +2,10 @@ package example

 import scala.scalajs.js
 import js.annotation.JSExport
-import org.scalajs.dom

 object ScalaJSExample extends js.JSApp {
   def main(): Unit = {
-    val paragraph = dom.document.createElement("p")
-    paragraph.innerHTML = "<strong>It works!</strong>"
-    dom.document.getElementById("playground").appendChild(paragraph)
+    throw new Exception("omg")
   }

   /** Computes the square of an integer.

It still says node.js crashed (???)

haoyi-mbp:scala-js-example-app haoyi$ sbt fastOptStage::run
[info] Loading global plugins from /Users/haoyi/.sbt/0.13/plugins
[info] Loading project definition from /Users/haoyi/Dropbox (Personal)/Workspace/scala-js-example-app/project
[info] Set current project to Example (in build file:/Users/haoyi/Dropbox%20(Personal)/Workspace/scala-js-example-app/)
[info] Running example.ScalaJSExample
[error]
[error] /Users/haoyi/Dropbox (Personal)/Workspace/scala-js-example-app/target/scala-2.11/example-fastopt.js:1433
[error]   throw ScalaJS.unwrapJavaScriptException(new ScalaJS.c.jl_Exception().init___
[error]                 ^
[error] java.lang.Exception: omg
java.lang.RuntimeException: node.js exited with code 8
    at scala.sys.package$.error(package.scala:27)
    at scala.scalajs.sbtplugin.env.ExternalJSEnv.runJS(ExternalJSEnv.scala:61)
    at scala.scalajs.sbtplugin.ScalaJSPlugin$.scala$scalajs$sbtplugin$ScalaJSPlugin$$jsRun(ScalaJSPlugin.scala:443)
    at scala.scalajs.sbtplugin.ScalaJSPlugin$$anonfun$49$$anonfun$apply$17$$anonfun$apply$18.apply(ScalaJSPlugin.scala:499)
    at scala.scalajs.sbtplugin.ScalaJSPlugin$$anonfun$49$$anonfun$apply$17$$anonfun$apply$18.apply(ScalaJSPlugin.scala:493)
    at scala.Function1$$anonfun$compose$1.apply(Function1.scala:47)
    at sbt.$tilde$greater$$anonfun$$u2219$1.apply(TypeFunctions.scala:42)
    at sbt.std.Transform$$anon$4.work(System.scala:64)
    at sbt.Execute$$anonfun$submit$1$$anonfun$apply$1.apply(Execute.scala:237)
    at sbt.Execute$$anonfun$submit$1$$anonfun$apply$1.apply(Execute.scala:237)
    at sbt.ErrorHandling$.wideConvert(ErrorHandling.scala:18)
    at sbt.Execute.work(Execute.scala:244)
    at sbt.Execute$$anonfun$submit$1.apply(Execute.scala:237)
    at sbt.Execute$$anonfun$submit$1.apply(Execute.scala:237)
    at sbt.ConcurrentRestrictions$$anon$4$$anonfun$1.apply(ConcurrentRestrictions.scala:160)
    at sbt.CompletionService$$anon$2.call(CompletionService.scala:30)
    at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)
    at java.util.concurrent.FutureTask.run(FutureTask.java:138)
    at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:439)
    at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)
    at java.util.concurrent.FutureTask.run(FutureTask.java:138)
    at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:895)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:918)
    at java.lang.Thread.run(Thread.java:695)
[error] (compile:fastOptStage::run) node.js exited with code 8
[error] Total time: 1 s, completed Jun 5, 2014 9:44:02 AM
@sjrd

This comment has been minimized.

Show comment
Hide comment
@sjrd

sjrd Jun 6, 2014

Member

Hum, for some reason I am now not able to reproduce either, but here's a different problem when I tried to do so:

This is expected. What did you expect?

It still says node.js crashed (???)

That's because you did not specify in Compile. It has to be

jsEnv in Compile := new PhantomJSEnv
Member

sjrd commented Jun 6, 2014

Hum, for some reason I am now not able to reproduce either, but here's a different problem when I tried to do so:

This is expected. What did you expect?

It still says node.js crashed (???)

That's because you did not specify in Compile. It has to be

jsEnv in Compile := new PhantomJSEnv
@sjrd

This comment has been minimized.

Show comment
Hide comment
@sjrd

sjrd Jun 6, 2014

Member

Also, again, I recommend against using nodejs/phantomjs with the bare run/test. Use fastOptStage or fullOptStage (or packageStage if you must) to run with nodejs/phantomjs. We don't really guarantee that using these interpreters with the preLinkStage work as well as with the other stages.

Member

sjrd commented Jun 6, 2014

Also, again, I recommend against using nodejs/phantomjs with the bare run/test. Use fastOptStage or fullOptStage (or packageStage if you must) to run with nodejs/phantomjs. We don't really guarantee that using these interpreters with the preLinkStage work as well as with the other stages.

@lihaoyi

This comment has been minimized.

Show comment
Hide comment
@lihaoyi

lihaoyi Jun 6, 2014

Contributor

That's because you did not specify in Compile. It has to be

Ohhh ok that's probably part of my confusion. I expected setting it unqualified would set it everywhere, but I guess SBT disagrees. Will continue trying to repro this, I could have sworn it was happening...

Contributor

lihaoyi commented Jun 6, 2014

That's because you did not specify in Compile. It has to be

Ohhh ok that's probably part of my confusion. I expected setting it unqualified would set it everywhere, but I guess SBT disagrees. Will continue trying to repro this, I could have sworn it was happening...

sjrd added a commit to sjrd/scala-js that referenced this issue Jun 8, 2014

@sjrd

This comment has been minimized.

Show comment
Hide comment
@sjrd

sjrd Jun 8, 2014

Member

It turns out it was neither ' ' nor '(', but the sequence ' (' ^^ That was badly handled by the regular expressions that normalize stack trace format across all interpreters.

Member

sjrd commented Jun 8, 2014

It turns out it was neither ' ' nor '(', but the sequence ' (' ^^ That was badly handled by the regular expressions that normalize stack trace format across all interpreters.

@lihaoyi

This comment has been minimized.

Show comment
Hide comment
@lihaoyi

lihaoyi Jun 8, 2014

Contributor

Woohoo I'm not crazy!

On Sun, Jun 8, 2014 at 11:10 PM, Sébastien Doeraene <
notifications@github.com> wrote:

It turns out it was neither ' ' nor '(', but the sequence ' (' ^^ That
was badly handled by the regular expressions that normalize stack trace
format across all interpreters.


Reply to this email directly or view it on GitHub
#712 (comment).

Contributor

lihaoyi commented Jun 8, 2014

Woohoo I'm not crazy!

On Sun, Jun 8, 2014 at 11:10 PM, Sébastien Doeraene <
notifications@github.com> wrote:

It turns out it was neither ' ' nor '(', but the sequence ' (' ^^ That
was badly handled by the regular expressions that normalize stack trace
format across all interpreters.


Reply to this email directly or view it on GitHub
#712 (comment).

@sjrd sjrd closed this in 5eab1f6 Jun 9, 2014

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment