Scala Programming Language
  1. Scala Programming Language
  2. SI-3047

Internal compiler error on Windows due to whitespace in path

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: Misc Compiler
    • Labels:
      None
    • Environment:

      compiler path name windows

      Description

      Related ticket: https://lampsvn.epfl.ch/trac/scala/ticket/1510 SI-1510 ?

      Release:
      scala-2.8.0.Beta1-prerelease

      Problem:
      Compiler & library will fail with an internal compiler error if path contains whitespace.

      I have not experienced this error for the latest stable release (2.7.7).

      Platform:
      Java 6 Update 18, Windows 7 (32-bit)

      Log:

      Buildfile: build.xml
           [echo] Using ANT_OPTS: -Xms512M -Xmx1024M -Xss1M -XX:MaxPermSize=128M
      
      init:
           [echo] Build number is '${version.major}.${version.minor}.${version.patch}'
      
      
      build-library:
          [mkdir] Created dir: <path-to-project>\bu
      ild\classes\library
          [javac] Compiling 13 source files to <path-to-project>
       Compiler 2.8\build\classes\library
      [scalacfork] Compiling 522 files to <path-to-project>
      iler 2.8\build\classes\library
      [scalacfork] scalac error: don't know what to do with Scala
      [scalacfork]   scalac -help  gives more information
      
      BUILD FAILED
      java.lang.RuntimeException: Compilation failed because of an internal compiler e
      rror; see the error output for details.
              at scala.Predef$.error(Predef.scala:74)
              at scala.tools.ant.sabbus.ScalacFork.execute(ScalacFork.scala:105)
              at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:288)
              at sun.reflect.GeneratedMethodAccessor1.invoke(Unknown Source)
              at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces
      sorImpl.java:25)
              at java.lang.reflect.Method.invoke(Method.java:597)
              at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.jav
      a:106)
              at org.apache.tools.ant.Task.perform(Task.java:348)
              at org.apache.tools.ant.Target.execute(Target.java:357)
              at org.apache.tools.ant.Target.performTasks(Target.java:385)
              at org.apache.tools.ant.Project.executeSortedTargets(Project.java:1337)
              at org.apache.tools.ant.Project.executeTarget(Project.java:1306)
              at org.apache.tools.ant.helper.DefaultExecutor.executeTargets(DefaultExe
      cutor.java:41)
              at org.apache.tools.ant.Project.executeTargets(Project.java:1189)
              at org.apache.tools.ant.Main.runBuild(Main.java:758)
              at org.apache.tools.ant.Main.startAnt(Main.java:217)
              at org.apache.tools.ant.launch.Launcher.run(Launcher.java:257)
              at org.apache.tools.ant.launch.Launcher.main(Launcher.java:104)
      
      Total time: 10 seconds
      
      1. mm-3047-20100321.patch
        1 kB
        Jira Admin
      2. patch0.patch
        8 kB
        Stefan Zeiger

        Activity

        Hide
        Trond Olsen added a comment -

        The related ticket SI-1510 is for an old release, so it can probably be ignored.

        Show
        Trond Olsen added a comment - The related ticket SI-1510 is for an old release, so it can probably be ignored.
        Hide
        Trond Olsen added a comment -

        I replicated this error on the older releases too, so I will need to do more error checking on my part. Closing the ticket as invalid for now.

        Show
        Trond Olsen added a comment - I replicated this error on the older releases too, so I will need to do more error checking on my part. Closing the ticket as invalid for now.
        Hide
        Maciek Makowski added a comment -

        a patch for windows classpath issue

        Show
        Maciek Makowski added a comment - a patch for windows classpath issue
        Hide
        Maciek Makowski added a comment -

        I'm not quite clear why this ticket was closed as invalid if it was confirmed to be an issue. Attached is a patch that fixes this error.

        Show
        Maciek Makowski added a comment - I'm not quite clear why this ticket was closed as invalid if it was confirmed to be an issue. Attached is a patch that fixes this error.
        Hide
        Trond Olsen added a comment -

        Thanks for locating the cause of the bug. I later invalided my ticket because I was unsure if Win7 or the JVM was the issue (both of which had changed from my previous setup).

        Show
        Trond Olsen added a comment - Thanks for locating the cause of the bug. I later invalided my ticket because I was unsure if Win7 or the JVM was the issue (both of which had changed from my previous setup).
        Hide
        Commit Message Bot added a comment -

        (extempore in r25995) More defense against spaces in paths.

        Closes SI-3047.

        Show
        Commit Message Bot added a comment - (extempore in r25995 ) More defense against spaces in paths. Closes SI-3047 .
        Hide
        Stefan Zeiger added a comment -

        Enable the use of spaces in paths for the Scala build on Windows.

        • Revert r25995 which was fixing it only partly and in the wrong place.
        • Properly encode argument files for scalac in scalac ant task.
        • Allow 'compilerarg' elements in scalac ant task (like in ant's built-in
          javac task) to allow passing extra parameters like plugindir path with
          proper encoding of spaces and file names, and use it in the Scala build.
        • Fix space handling in get-scala-revision.bat.
        Show
        Stefan Zeiger added a comment - Enable the use of spaces in paths for the Scala build on Windows. Revert r25995 which was fixing it only partly and in the wrong place. Properly encode argument files for scalac in scalac ant task. Allow 'compilerarg' elements in scalac ant task (like in ant's built-in javac task) to allow passing extra parameters like plugindir path with proper encoding of spaces and file names, and use it in the Scala build. Fix space handling in get-scala-revision.bat.
        Hide
        Stefan Zeiger added a comment -

        The previous fix only addresses part of the problem. See my patch for a better fix that allows a full build to run on Windows with a space character in the path to the Scala build. Partest probably has similar issues but I haven't investigated that pending the switch to sbt. The fixes to the ant tasks should still be useful afterwards.

        Show
        Stefan Zeiger added a comment - The previous fix only addresses part of the problem. See my patch for a better fix that allows a full build to run on Windows with a space character in the path to the Scala build. Partest probably has similar issues but I haven't investigated that pending the switch to sbt. The fixes to the ant tasks should still be useful afterwards.
        Hide
        Commit Message Bot added a comment -

        (extempore in r26026) Enable the use of spaces in paths for the Scala build on Windows.

        Revert r25995 which was fixing it only partly and in the wrong place.
        Properly encode argument files for scalac in scalac ant task.
        Allow 'compilerarg' elements in scalac ant task (like in ant's built-in
        javac task) to allow passing extra parameters like plugindir path with
        proper encoding of spaces and file names, and use it in the Scala build.
        Fix space handling in get-scala-revision.bat.

        (Patch by Stefan Zeiger.) Closes SI-3047.

        Show
        Commit Message Bot added a comment - (extempore in r26026 ) Enable the use of spaces in paths for the Scala build on Windows. Revert r25995 which was fixing it only partly and in the wrong place. Properly encode argument files for scalac in scalac ant task. Allow 'compilerarg' elements in scalac ant task (like in ant's built-in javac task) to allow passing extra parameters like plugindir path with proper encoding of spaces and file names, and use it in the Scala build. Fix space handling in get-scala-revision.bat. (Patch by Stefan Zeiger.) Closes SI-3047 .

          People

          • Assignee:
            Paul Phillips
            Reporter:
            Trond Olsen
            TracCC:
            Caoyuan Deng, Johannes Rudolph, Maciek Makowski
          • Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development