I encountered this error while developing a cljs project that included openlayers lib in its deps.
Open layers is a Closure library and I used the latest version 3.15.1.
The error that compiler reports is:
java.io.IOException: The filename, directory name, or volume label syntax is incorrect
I have recreated the minimal scenario, the one like on ClojureScript Quick start guide.
Steps to reproduce the problem (basically like the quick start):
Download standalone cljs jar from the link in the guide
Create the same build.cljs file as defined on the guide
Download openlayers-3.15.1.jar and place it in the root
Add require statement in core.cljs - (ns hello-world.core (:require ol.Map)) for example
Than in cmd run java -cp "cljs.jar;openlayers-3.15.1.jar;src" clojure.main build.clj
I have also tested with cljs master branch (created an uberjar and tested again) and i get the same error.
Attached is the example stacktrace (in that run I added :verbose true to get the 'Copying...' output).
Tested on Windows 10 with java 8 and on windows 7 with java 7 and java 8.
Clojure version is 1.8.0 on both systems.
The suggested fix isn't desirable as far as I can tell since we have a branch specifically for dealing with Closure libs that will be avoided. We need a better explanation.
the problem occurred only for Closure libraries compilation (such as openlayers).
As already commented, it manifested on both Win and Linux, but on Linux it did not
The problem was in the function that produced relative output paths for deps (lib-rel-path).
It tried to remove the first part of the absolute path with clojure.string/replace, but
it tried it with a wrong match (it did not reproduce the actual first part of the path)
so it effectively did nothing.
(str (io/file (System/getProperty "user.dir") lib-path) File/separator)
file:\C:\Users****\Documents\Projects\openlayers-cljs-compile-error-repo\cljsjs\openlayers\development\ instead of
Attached patch produces better paths that work on both OS.
Can someone check if it is an okay solution?
I have tested it of course on both OS, run CLJS tests etc.
This is the correct patch - first one contained an error.
I've tested the newest patch on Windows 10/Java 8 and Mac OSX 10.11.6/Java 8, using the quickstart compile method with both :none and :advanced.
It fixes the compilation issue on Windows and will compile both openlayers and libphonenumber (both are Google Closure libraries, I used the JAR files from CLJSJS to compile them). The folder structure also looks much better and doesn't have the user path embedded anymore.