<< Back to previous view

[CLJS-2345] File paths emitted as args to cljs.core.load_file without escaping fails on Windows Created: 31/Aug/17  Updated: 09/Sep/17  Resolved: 09/Sep/17

Status: Closed
Project: ClojureScript
Component/s: None
Affects Version/s: 1.9.908
Fix Version/s: Next

Type: Defect Priority: Major
Reporter: Chas Emerick Assignee: David Nolen
Resolution: Completed Votes: 1
Labels: windows

Attachments: Text File CLJS-2345.patch    
Patch: Code
Approval: Accepted

 Description   

(Context: https://github.com/funcool/promesa/issues/52)

The compiler currently doesn't escape file paths when emitting calls to cljs.core.load_file. This is bad in cases where a library has a JS dependency with a path segment whose first character corresponds to an ASCII control code (a, b, t, n, v, f, r, e); this can result in a control code being where a backslash and letter should be, e.g.:

// Compiled by ClojureScript 1.9.908 {:target :nodejs}
goog.provide('promesa.impl');
goog.require('cljs.core');
goog.require('promesa.protocols');
cljs.core.load_file(".cljs_node_repl\bluebird\bluebird.js");

(Note the unescaped backslashes, and thus the backspace char.)

Patch incoming.



 Comments   
Comment by David Nolen [ 09/Sep/17 9:46 AM ]

fixed https://github.com/clojure/clojurescript/commit/b74538b4e9947973175cf197704c18b10a5ce6bf





[CLJS-2177] NPM deps & JS modules fixes for Windows Created: 05/Jul/17  Updated: 05/Jul/17  Resolved: 05/Jul/17

Status: Closed
Project: ClojureScript
Component/s: None
Affects Version/s: 1.9.854
Fix Version/s: 1.9.854

Type: Defect Priority: Minor
Reporter: António Nuno Monteiro Assignee: David Nolen
Resolution: Completed Votes: 0
Labels: windows

Attachments: Text File CLJS-2177.patch    
Patch: Code
Approval: Vetted

 Comments   
Comment by David Nolen [ 05/Jul/17 7:53 PM ]

Most of the changes look obvious, correcting system specific directory representation. But what is URLDecoder doing here?

Comment by António Nuno Monteiro [ 05/Jul/17 7:53 PM ]

Sometimes paths on Windows will have spaces and URLs will show with `%20`

Comment by David Nolen [ 05/Jul/17 7:56 PM ]

And the processed-file bit is because internally Closure wants forward slashes?

Comment by António Nuno Monteiro [ 05/Jul/17 7:57 PM ]

It looks like `.getSourceFileName` on a Closure source Node returns a path with forward slashes. That's why we need to replace backslashes.

Comment by David Nolen [ 05/Jul/17 8:25 PM ]

fixed https://github.com/clojure/clojurescript/commit/faed651bc6334dc008953215e242ceea96652e5b





[CLJS-2176] module_deps.js: fix regexes for Windows paths Created: 05/Jul/17  Updated: 05/Jul/17  Resolved: 05/Jul/17

Status: Closed
Project: ClojureScript
Component/s: None
Affects Version/s: 1.9.854
Fix Version/s: 1.9.854

Type: Defect Priority: Minor
Reporter: António Nuno Monteiro Assignee: David Nolen
Resolution: Completed Votes: 0
Labels: windows

Attachments: Text File CLJS-2176.patch    
Patch: Code
Approval: Accepted

 Comments   
Comment by David Nolen [ 05/Jul/17 4:25 PM ]

fixed https://github.com/clojure/clojurescript/commit/9b967ee3157747dd401b1ea2f27efb8476dc3c52





[CLJS-2174] Follow-up fixes to :npm-deps on Windows Created: 05/Jul/17  Updated: 05/Jul/17  Resolved: 05/Jul/17

Status: Closed
Project: ClojureScript
Component/s: None
Affects Version/s: 1.9.671, 1.9.854
Fix Version/s: 1.9.854

Type: Defect Priority: Minor
Reporter: António Nuno Monteiro Assignee: David Nolen
Resolution: Completed Votes: 0
Labels: windows

Attachments: Text File CLJS-2174.patch    
Patch: Code
Approval: Accepted

 Comments   
Comment by David Nolen [ 05/Jul/17 12:48 PM ]

fixed https://github.com/clojure/clojurescript/commit/6db8f0cce7c3768020ccd9d82e0f2c50caaceabb





[CLJS-2173] Fix `npm install` when `:npm-deps` in Windows Created: 05/Jul/17  Updated: 05/Jul/17  Resolved: 05/Jul/17

Status: Closed
Project: ClojureScript
Component/s: None
Affects Version/s: 1.9.671
Fix Version/s: 1.9.854

Type: Defect Priority: Minor
Reporter: António Nuno Monteiro Assignee: David Nolen
Resolution: Completed Votes: 0
Labels: windows

Attachments: Text File CLJS-2173.patch    
Patch: Code
Approval: Accepted

 Comments   
Comment by David Nolen [ 05/Jul/17 12:05 PM ]

fixed https://github.com/clojure/clojurescript/commit/440ac29f2d08ed22c945c4b145a57b819abdf38b





[CLJS-1797] Update aot_core to support build with MINGW on Windows Created: 30/Sep/16  Updated: 08/Jul/17  Resolved: 08/Jul/17

Status: Closed
Project: ClojureScript
Component/s: None
Affects Version/s: 1.9.76
Fix Version/s: 1.9.854

Type: Enhancement Priority: Minor
Reporter: Thomas Kidd Assignee: David Nolen
Resolution: Completed Votes: 0
Labels: windows
Environment:

Windows 10


Attachments: Text File CLJS-1797.patch    
Patch: Code
Approval: Accepted

 Description   

When using Git Bash (which uses MINGW), ./script/build can get nearly all the way through it's work. However, it dies in aot_core because of the way that the classpath is generated by the Maven dependency:build-classpath plugin.



 Comments   
Comment by Thomas Kidd [ 30/Sep/16 7:40 AM ]

I was able to get this working locally, and will submit a patch when I am sure things are working

Comment by Thomas Kidd [ 30/Sep/16 8:45 AM ]

Updates aot_core to set the classpath correctly. More comments in patch.

Comment by Thomas Kidd [ 30/Sep/16 8:49 AM ]

Tested that patched version of master works on Windows 10 and OSX

Comment by Thomas Kidd [ 30/Sep/16 8:54 AM ]

Needs review

Comment by David Nolen [ 30/Sep/16 10:49 AM ]

Issues don't get closed until the issue is actually resolved

Comment by David Nolen [ 08/Jul/17 10:44 AM ]

fixed https://github.com/clojure/clojurescript/commit/c2746c0270bf74ad667750d0f1e781866549221c





[CLJS-159] Suggest removing UNIX shell executable permissions from bin/cljsc.bat Created: 06/Mar/12  Updated: 27/Jul/13  Resolved: 14/Mar/12

Status: Closed
Project: ClojureScript
Component/s: None
Affects Version/s: None
Fix Version/s: None

Type: Defect Priority: Major
Reporter: Yesudeep Mangalapilly Assignee: Unassigned
Resolution: Completed Votes: 0
Labels: command, executable, linux, permissions, script, shell, unix, windows
Environment:

Any UNIX platform.



 Description   

Bash completion shows `bin/cljsc.bat` as an executable on UNIX systems
making it very easy to accidentally execute it. However, since
Windows command scripts do not work with UNIX shells, it is not
advisable to allow executable permissions to Windows batch scripts
as accidentally executing them may cause undefined behavior on such
systems.

I strongly suggest stripping UNIX shell executable permissions from
`bin/cljsc.bat`.

Thank you.

Cheers,
Yesudeep.



 Comments   
Comment by Yesudeep Mangalapilly [ 07/Mar/12 12:39 AM ]

The issue also affects:

bin/cljsc.bat
script/repljs.bat
script/repl.bat

Comment by Craig Andera [ 12/Mar/12 1:34 PM ]

I've verified (on both Ubuntu Linux and Windows 7) that stripping the x bit from those files has the desired effect.

The patch is almost too trivial to bother with listing here, but here it is regardless:

diff --git a/bin/cljsc.bat b/bin/cljsc.bat
old mode 100755
new mode 100644
diff --git a/script/repl.bat b/script/repl.bat
old mode 100755
new mode 100644
diff --git a/script/repljs.bat b/script/repljs.bat
old mode 100755
new mode 100644
Comment by David Nolen [ 14/Mar/12 7:22 PM ]

Fixed, https://github.com/clojure/clojurescript/commit/aa51a01141131736871e791918df63f185155421





Generated at Wed Oct 18 22:38:06 CDT 2017 using JIRA 4.4#649-r158309.