BUG REPORT: ClojureScript : Portable Path Support

100 views
Skip to first unread message

pmbauer

unread,
Jul 20, 2011, 10:12:32 PM7/20/11
to clo...@googlegroups.com
Per instructions from redinger and jgehtland (patch addressing one issue attached).

Three separate issues so far re: path support on windows

* compiler path regex is not portable, cljs/compiler.clj:1096 (see attached patch, thanks amalloy for the assist)

* generated JS has path problems on windows
goog.addDependency("..\..\..\..\..\..\..\/C:/tmp/clojurescript/samples/twitterbuzz/out/cljs/core.js", ['cljs.core'], ['goog.string', 'goog.string.StringBuffer', 'goog.object', 'goog.array']);

* helper launch scripts on windows (under cygwin), more a feature than bug
portable-path-regex.diff

pmbauer

unread,
Jul 21, 2011, 12:34:16 AM7/21/11
to clo...@googlegroups.com
PS
re: 3rd point (portable helper scripts) Even better would be ClojureScript with maven support - much bigger effort, sure.

I'd be willing to help work on that and submit some patches/plugins if that was an authorized direction.

Sean Corfield

unread,
Jul 21, 2011, 12:40:16 AM7/21/11
to clo...@googlegroups.com
On Wed, Jul 20, 2011 at 9:34 PM, pmbauer <paul.mich...@gmail.com> wrote:
> Even better would be ClojureScript with maven support

Didn't Rich say he hopes Maven doesn't come anywhere near ClojureScript? :)
--
Sean A Corfield -- (904) 302-SEAN
An Architect's View -- http://corfield.org/
World Singles, LLC. -- http://worldsingles.com/
Railo Technologies, Inc. -- http://www.getrailo.com/

"Perfection is the enemy of the good."
-- Gustave Flaubert, French realist novelist (1821-1880)

pmbauer

unread,
Jul 21, 2011, 2:25:30 AM7/21/11
to clo...@googlegroups.com
I know.
But the sorts of (presently non-portable) scripts in "scripts" (see bootstrap, repl) ad-hoc test strategy, etc in ClojureScript are begging for dependency management and a build tool.

pmbauer

unread,
Jul 21, 2011, 2:26:40 AM7/21/11
to clo...@googlegroups.com
If ClojureScript isn't "mavenified", how else do you easily make it a dependency in a web application?

Stuart Halloway

unread,
Jul 21, 2011, 11:09:26 AM7/21/11
to clo...@googlegroups.com
If ClojureScript isn't "mavenified", how else do you easily make it a dependency in a web application?

Maven doesn't any problems that we have, and would add complexity to the development process and slow us down. Also, we don't want to unthinkingly drag Java presumptions into ClojureScript.

Let's wait and collect feedback from the community before pouring any cement on deployment approaches.

Stu


Stuart Halloway
Clojure/core
http://clojure.com

Brenton

unread,
Jul 21, 2011, 12:30:17 PM7/21/11
to Clojure
> generated JS has path problems on windows

Until this gets fixed you can work around this particular problem by
using one of the available optimizations.

cljsc src {:optimizations :simple} > twitterbuzz.js

You may also use :whitespace or :advanced in place of :simple above.

This will produce one JavaScript file with no goog.addDependency
calls.

In the index.html file, remove all of the script tags except for the
one that pulls in twitterbuzz.js

On Jul 20, 10:12 pm, pmbauer <paul.michael.ba...@gmail.com> wrote:
> Per instructions from redinger and jgehtland (patch addressing one issue
> attached).
>
> Three separate issues so far re: path support on windows
>
> * compiler path regex is not portable, cljs/compiler.clj:1096 (see attached
> patch, thanks amalloy for the assist)
>
> * generated JS has path problems on windows
> goog.addDependency(*
> "..\..\..\..\..\..\..\/C:/tmp/clojurescript/samples/twitterbuzz/out/cljs/core.js"
> *, ['cljs.core'], ['goog.string', 'goog.string.StringBuffer', 'goog.object',
> 'goog.array']);
>
> * helper launch scripts on windows (under cygwin), more a feature than bug
>
>  portable-path-regex.diff
> < 1KViewDownload

pmbauer

unread,
Jul 21, 2011, 12:41:05 PM7/21/11
to clo...@googlegroups.com
Fair enough.

But, it would be nice to eventually have a ClojureScript jar available in a public maven repo someplace.
Not having one would needlessly complicate projects that already use a maven-based build tool (mvn, lein, cake) and want to depend on it as part of their build.

Chas Emerick

unread,
Jul 21, 2011, 9:14:09 AM7/21/11
to clo...@googlegroups.com

On Jul 21, 2011, at 12:40 AM, Sean Corfield wrote:

> On Wed, Jul 20, 2011 at 9:34 PM, pmbauer <paul.mich...@gmail.com> wrote:
>> Even better would be ClojureScript with maven support
>
> Didn't Rich say he hopes Maven doesn't come anywhere near ClojureScript? :)

>> I know.


>> But the sorts of (presently non-portable) scripts in "scripts" (see bootstrap, repl) ad-hoc test strategy, etc in ClojureScript are begging for dependency management and a build tool.

>> If ClojureScript isn't "mavenified", how else do you easily make it a dependency in a web application?

ClojureScript should have scripts or other "low level" methods for doing everything it needs, so that, if one is so inclined, those methods can be applied by "higher level" tools. It would be a disaster if the main entry point for a ClojureScript REPL or compilation process were via Maven.

That is all separate from the provide-ClojureScript-as-a-dependency issue (having a pom file off in the corner so that releases can be pushed out to central will resolve that).

- Chas

pmbauer

unread,
Jul 21, 2011, 2:53:26 PM7/21/11
to clo...@googlegroups.com
Fair enough.  That addresses my concern.

Mark Derricutt

unread,
Jul 22, 2011, 4:38:10 AM7/22/11
to clo...@googlegroups.com
Oh don't say that!  That was going to be my weekend project - looking at adding ClojureScript support to clojure-maven-plugin.

I made a coffee-maven-plugin for our web guys the other week and now we've got a chance to sway them over to clojure ( well, I don't think that'll happen easily tho ).

Troy Clevenger

unread,
Jul 21, 2011, 4:23:40 PM7/21/11
to Clojure
This patch here fixes the path issues on windows for me. I haven't
tested it on a non-windows system though. Thought I'd post it here in
case it helps anyone.

http://content.wuala.com/contents/Daedalus/DropBox/Fixed-unoptimized-compile-in-windows.diff?dl=1

Regards,

Troy

On Jul 20, 10:12 pm, pmbauer <paul.michael.ba...@gmail.com> wrote:
> Per instructions from redinger and jgehtland (patch addressing one issue
> attached).
>
> Three separate issues so far re: path support on windows
>
> * compiler path regex is not portable, cljs/compiler.clj:1096 (see attached
> patch, thanks amalloy for the assist)
>
> * generated JS has path problems on windows
> goog.addDependency(*
> "..\..\..\..\..\..\..\/C:/tmp/clojurescript/samples/twitterbuzz/out/cljs/co re.js"
> *, ['cljs.core'], ['goog.string', 'goog.string.StringBuffer', 'goog.object',
> 'goog.array']);
>
> * helper launch scripts on windows (under cygwin), more a feature than bug
>
>  portable-path-regex.diff
> < 1KViewDownload
Reply all
Reply to author
Forward
0 new messages