Opened 8 years ago

Closed 8 years ago

#14975 closed defect (wontfix)

Building fails when profileFile path contains spaces

Reported by: zimnyx Owned by: Rawld Gill
Priority: low Milestone: 1.8
Component: BuildSystem Version: 1.7.2
Keywords: Cc:
Blocked By: Blocking:

Description

How to trigger error

Profile file without spaces in path wotks fine:

/tmp/laal/1.7.2/util/buildscripts$ ./build.sh --release profile=/tmp/laal/dir_witout_spaces/base.profile.js 
+ java -Xms256m -Xmx256m -cp ./../shrinksafe/js.jar:./../closureCompiler/compiler.jar:./../shrinksafe/shrinksafe.jar org.mozilla.javascript.tools.shell.Main ./../../dojo/dojo.js baseUrl=./../../dojo load=build --release profile=/tmp/laal/dir_witout_spaces/base.profile.js
processing profile resource /tmp/laal/dir_witout_spaces/base.profile.js
info(107) Package Version: package: dojo; version: 1.7.2
processing profile resource /tmp/laal/1.7.2/dojo/dojo.profile.js
discovering resources...
starting reading resources...
starting processing raw resource content...
starting tokenizing resource...
starting processing resource tokens...
starting parsing resource...
starting processing resource AST...
warn(216) dojo/has plugin resource could not be resolved during build-time. plugin resource id: dojo-firebug?./_firebug/firebug; reference module id: dojo/main
warn(216) dojo/has plugin resource could not be resolved during build-time. plugin resource id: dom-addeventlistener?:./aspect; reference module id: dojo/on
starting executing global optimizations...
starting writing resources...
starting cleaning up...
starting reporting...
Report written to /tmp/laal/1.7.2/release/dojo/build-report.txt
Process finished normally.
	errors: 0
	warnings: 2
	build time: 3.839 seconds

..but if path contains spaces:

/tmp/laal/1.7.2/util/buildscripts$ ./build.sh --release profile=/tmp/laal/dir\ with\ spaces/base.profile.js 
+ java -Xms256m -Xmx256m -cp ./../shrinksafe/js.jar:./../closureCompiler/compiler.jar:./../shrinksafe/shrinksafe.jar org.mozilla.javascript.tools.shell.Main ./../../dojo/dojo.js baseUrl=./../../dojo load=build --release profile=/tmp/laal/dir with spaces/base.profile.js
error(343) Illegal command line argument. switch: with; position: 4
error(343) Illegal command line argument. switch: spaces/base.profile.js; position: 5
error(344) File does not exist. filename: /tmp/laal/dir.profile.js
errors on command line; terminating application.

Error reason

Script build.sh iterates over its parameters using

while [ -n "$1" ]
do
    arg="$1" # Here param profile=path becomes simple string (end every other param)
    # ...
    ba="$ba $arg"    
    shift
done    


$cmd $cmdflags load=build $ba # Paths in params listed in $ba are not protected with "" so spaces virtualy creates new params.

Change History (1)

comment:1 Changed 8 years ago by Rawld Gill

Milestone: tbd1.8
Priority: undecidedlow
Resolution: wontfix
Status: newclosed

This is a limitation in the build.sh script that we're not planning on fixing.

If you must use paths with spaces, you can invoke node directly and put quotes around the path. Your example should work if you use the command line:

node ./../../dojo/dojo.js load=build --release --profile "/tmp/laal/dir with spaces/base.profile.js"
Note: See TracTickets for help on using tickets.