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

Internal compiler error on Windows due to whitespace in path #3047

Closed
scabug opened this issue Feb 10, 2010 · 10 comments
Closed

Internal compiler error on Windows due to whitespace in path #3047

scabug opened this issue Feb 10, 2010 · 10 comments
Assignees

Comments

@scabug
Copy link

@scabug scabug commented Feb 10, 2010

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
@scabug

This comment has been minimized.

Copy link
Author

@scabug scabug commented Feb 10, 2010

Imported From: https://issues.scala-lang.org/browse/SI-3047?orig=1
Reporter: Trond Olsen (tolsen77)
Attachments:

@scabug

This comment has been minimized.

Copy link
Author

@scabug scabug commented Feb 10, 2010

Trond Olsen (tolsen77) said:
The related ticket #1510 is for an old release, so it can probably be ignored.

@scabug

This comment has been minimized.

Copy link
Author

@scabug scabug commented Feb 14, 2010

Trond Olsen (tolsen77) said:
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.

@scabug

This comment has been minimized.

Copy link
Author

@scabug scabug commented Mar 21, 2010

Maciek Makowski (mmakowski) said:
a patch for windows classpath issue

@scabug

This comment has been minimized.

Copy link
Author

@scabug scabug commented Mar 21, 2010

Maciek Makowski (mmakowski) said:
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.

@scabug

This comment has been minimized.

Copy link
Author

@scabug scabug commented Mar 21, 2010

Trond Olsen (tolsen77) said:
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).

@scabug

This comment has been minimized.

Copy link
Author

@scabug scabug commented Nov 13, 2011

Commit Message Bot (anonymous) said:
(extempore in r25995) More defense against spaces in paths.

Closes #3047.

@scabug

This comment has been minimized.

Copy link
Author

@scabug scabug commented Nov 18, 2011

@szeiger said:
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.
@scabug

This comment has been minimized.

Copy link
Author

@scabug scabug commented Nov 18, 2011

@szeiger said:
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.

@scabug

This comment has been minimized.

Copy link
Author

@scabug scabug commented Nov 18, 2011

Commit Message Bot (anonymous) said:
(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 #3047.

@scabug scabug closed this Nov 18, 2011
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
2 participants
You can’t perform that action at this time.