Skip to content

Compiler handles some URIs incorrectly on Windows (shows in SettingsTests.jarOutput) #5155

@melekhove

Description

@melekhove

Steps to reproduce from command line:

sbt:dotty> dotc -d out\jaredFoo.jar tests\pos\Foo.scala
[warn] Multiple main classes detected.  Run 'show discoveredMainClasses' to see the list
[info] Running (fork) dotty.tools.dotc.Main -classpath C:\Users\mev\.sbt\boot\scala-2.12.6\lib\scala-library.jar;D:\home
\projects\Scala\Dotty\git\library\..\out\bootstrap\dotty-library-bootstrapped\scala-0.10\dotty-library_0.10-0.10.0-bin-S
NAPSHOT.jar -d out\jaredFoo.jar tests\pos\Foo.scala
Exception in thread "main" java.lang.IllegalArgumentException: Illegal character in opaque part at index 11: jar:file:D:
\home\projects\Scala\Dotty\git\out\jaredFoo.jar
        at java.net.URI.create(URI.java:852)
        at dotty.tools.io.JarArchive$.open(JarArchive.scala:30)
        at dotty.tools.io.JarArchive$.create(JarArchive.scala:20)
        at dotty.tools.dotc.config.Settings$Setting.doSet$1(Settings.scala:150)
        at dotty.tools.dotc.config.Settings$Setting.tryToSet(Settings.scala:180)
        at dotty.tools.dotc.config.Settings$SettingGroup.loop$1(Settings.scala:242)
        at dotty.tools.dotc.config.Settings$SettingGroup.processArguments(Settings.scala:248)
        at dotty.tools.dotc.config.Settings$SettingGroup.loop$1(Settings.scala:243)
        at dotty.tools.dotc.config.Settings$SettingGroup.processArguments(Settings.scala:248)
        at dotty.tools.dotc.config.Settings$SettingGroup.processArguments(Settings.scala:256)
        at dotty.tools.dotc.config.CompilerCommand$.distill(CompilerCommand.scala:61)
        at dotty.tools.dotc.Driver.setup(Driver.scala:47)
        at dotty.tools.dotc.Driver.process(Driver.scala:133)
        at dotty.tools.dotc.Driver.process(Driver.scala:103)
        at dotty.tools.dotc.Driver.process(Driver.scala:115)
        at dotty.tools.dotc.Driver.main(Driver.scala:142)
        at dotty.tools.dotc.Main.main(Main.scala)
Caused by: java.net.URISyntaxException: Illegal character in opaque part at index 11: jar:file:D:\home\projects\Scala\Do
tty\git\out\jaredFoo.jar
        at java.net.URI$Parser.fail(URI.java:2848)
        at java.net.URI$Parser.checkChars(URI.java:3021)
        at java.net.URI$Parser.parse(URI.java:3058)
        at java.net.URI.<init>(URI.java:588)
        at java.net.URI.create(URI.java:850)
        ... 16 more
[error] Nonzero exit code returned from runner: 1
[error] (dotty-compiler / Compile / runMain) Nonzero exit code returned from runner: 1
[error] Total time: 4 s, completed 25.09.2018 7:00:41

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions