History | Log In     View a printable version of the current page.  
Issue Details (XML | Word | Printable)

Key: LPP-1636
Type: Bug Bug
Status: Closed Closed
Resolution: Fixed
Priority: P0 P0
Assignee: Unassigned
Reporter: Dan Stowell
Votes: 1
Watchers: 1
Operations

If you were logged in you would be able to see more operations.
OpenLaszlo

Scripts do not handle spaces in path names

Created: 24/Feb/06 12:42 PM   Updated: 15/Nov/07 11:12 AM
Component/s: Compiler
Affects Version/s: 4.0.2
Fix Version/s: Cranberry

Time Tracking:
Not Specified

Severity: Minor
Fixed in Change#: 6,994
Platform: x86 - Windows XP
Runtime: N/A
Fix in hand: False


 Description  « Hide
When JAVA_HOME is set to a path with a space in it, such as C:\Program Files\Java\jdk1.5.0_06, lzc fails. Wrapping quotes around paths that use environment variables would solve the problem.

I suspect there are several other scripts that suffer from the same problem. There are 95 instances of JAVA_HOME in the lps.

I'd like to blame Windows for using spaces in path names. I'd like to blame Sun for making an installer for the JDK that uses C:\Program Files. I'd also like to blame Unix culture for choosing the string as the data format of choice for communicating between programs. Or, rather, I blame them for not formatting their strings using s-expressions or XML tags. Peace.

 All   Comments   Work Log   Change History      Sort Order: Ascending order - Click to sort in descending order
Trebor Fenstermaker - 21/Jun/07 05:23 AM
Using a script that relies on JAVA_HOME, where the JAVA_HOME as a space in it (such as the default location of the Sun SDK installer, "C:\Program Files...") will cause the scripts to fail in ways that are not at all obvious to the user. LZC will fail, for example, with a "path not found" error, with no explanation that the path that isn't found is that of the Java runtime. Debugging this requires going into each batch file that is fired as part of the LZC process and turning "Echo on" to see what, exactly, is failing.

As Dan mentioned, a very simple fix is for %JAVA_HOME% to be wrapped in quotes. In fact, all environment variables should be, to avoid this problem.

Jim Grandy - 21/Jun/07 07:19 AM
We should fix this since it affects folks installing the SDK. (Our source build instructions already require installation of JDK into a directory with no spaces in the name.)

Amy Muntz - 04/Oct/07 01:22 PM
Phil - please put this at the top of your list and fix in trunk - the issue of spaces in path names. Thanks.

Philip Romanik - 05/Oct/07 12:54 PM
Also see: LPP-4843 for a more recent change that affects this issue.

Change 20071005-Philip-8 by Philip@Philip-DC on 2007-10-05 10:11:50 EDT
     in /cygdrive/f/laszlo/svn/src/svn/openlaszlo/trunk
     for http://svn.openlaszlo.org/openlaszlo/trunk

Summary: Modify .bat files to handle spaces in JAVA_HOME

New Features:

Bugs Fixed: LPP-1636 (partial)

Technical Reviewer: ptw
QA Reviewer: hqm
Doc Reviewer: (pending)

Documentation:

Release Notes:

Details:
I quoted the JAVA_HOME settings in batch files so they will run properly when sp aces are in the path where java is installed.

Tests:
- In my setup, JAVA_HOME is c:\Java.
   I made a copy of these files to c:\Java Installation.
- Reset the JAVA_HOME variable: set JAVA_HOME=c:\Java Installation
- Verify the programs start:
     lzc -h
     lzdc -h
     lzmc -h
- Run lzc on a test file, lzc foo.lzx
- Verify foo.lzr=swf7.swf runs correctly.

No errors should be generated. Without the change the batch files will generate a "no such file" error.

Files:
M WEB-INF/lps/server/bin/lzc.bat
M WEB-INF/lps/server/bin/lzdc.bat
M WEB-INF/lps/server/bin/lzmc.bat

Changeset: http://svn.openlaszlo.org/openlaszlo/patches/20071005-Philip-8.tar

Trebor Fenstermaker - 05/Oct/07 01:00 PM
Would it make sense to quote all environment variables, in case source directorys and other path names contain spaces?

Philip Romanik - 24/Oct/07 01:24 PM
Change 20071024-Philip-4 by Philip@Philip-DC on 2007-10-24 14:28:49 EDT
     in /cygdrive/f/laszlo/svn/src/svn/openlaszlo/branches/wafflecone
     for http://svn.openlaszlo.org/openlaszlo/branches/wafflecone

Summary: Pass arguments intact to Windows scripts

New Features:

Bugs Fixed: LPP-4142, LPP-2593, LPP-1636

Technical Reviewer: ptw
QA Reviewer: (pending)
Doc Reviewer: (pending)

Documentation:

Release Notes:

Details:
Merge r6736 from trunk to wafflecone.

Arguments were not being transferred intact to java. The old scripts used %1,%2,... to refer to arguments. However, Windows thinks that
--runtime=swf7 is two argument, "--runtime" and "swf7". The only fix I found is to pass the arguments intact using %*.

I verified that these files are identical between trunk and wafflecone.


Tests:
   lzc,lzdc,lzmc pass arguments the same way. Tested on lzc. From the windows command prompt:

   - lzc --runtime=swf8 testfile.lzx

This command should product a file testfile.lzr=swf8.swf

   - lzc "--runtime=swf8" testfile.lzx

This should work the same as the first case. This makes sure that people that are already escaping the argument can continue to do so.

Files:
M WEB-INF/lps/server/bin/lzc.bat
M WEB-INF/lps/server/bin/lzdc.bat
M WEB-INF/lps/server/bin/lzmc.bat

Changeset: http://svn.openlaszlo.org/openlaszlo/patches/20071024-Philip-4.tar

Mamye Kratt - 15/Nov/07 11:12 AM
(wafflecone build r7249 - cranberry RC)
close