@@ -248,7 +248,12 @@ func compileFileWithRecipe(ctx *types.Context, sourcePath *paths.Path, source *p
248248 return nil , errors .WithStack (err )
249249 }
250250 if ! objIsUpToDate {
251- _ , _ , _ , err := ExecRecipe (ctx , properties , recipe , utils .ShowIfVerbose /* stdout */ , utils .Show /* stderr */ )
251+ command , err := PrepareCommandForRecipe (properties , recipe , false )
252+ if err != nil {
253+ return nil , errors .WithStack (err )
254+ }
255+
256+ _ , _ , err = utils .ExecCommand (ctx , command , utils .ShowIfVerbose /* stdout */ , utils .Show /* stderr */ )
252257 if err != nil {
253258 return nil , errors .WithStack (err )
254259 }
@@ -479,23 +484,18 @@ func ArchiveCompiledFiles(ctx *types.Context, buildPath *paths.Path, archiveFile
479484 properties .SetPath (constants .BUILD_PROPERTIES_ARCHIVE_FILE_PATH , archiveFilePath )
480485 properties .SetPath (constants .BUILD_PROPERTIES_OBJECT_FILE , objectFile )
481486
482- if _ , _ , _ , err := ExecRecipe (ctx , properties , constants .RECIPE_AR_PATTERN , utils .ShowIfVerbose /* stdout */ , utils .Show /* stderr */ ); err != nil {
487+ command , err := PrepareCommandForRecipe (properties , constants .RECIPE_AR_PATTERN , false )
488+ if err != nil {
483489 return nil , errors .WithStack (err )
484490 }
485- }
486491
487- return archiveFilePath , nil
488- }
489-
490- func ExecRecipe (ctx * types.Context , buildProperties * properties.Map , recipe string , stdout int , stderr int ) (* exec.Cmd , []byte , []byte , error ) {
491- // See util.ExecCommand for stdout/stderr arguments
492- command , err := PrepareCommandForRecipe (buildProperties , recipe , false )
493- if err != nil {
494- return nil , nil , nil , errors .WithStack (err )
492+ _ , _ , err = utils .ExecCommand (ctx , command , utils .ShowIfVerbose /* stdout */ , utils .Show /* stderr */ )
493+ if err != nil {
494+ return nil , errors .WithStack (err )
495+ }
495496 }
496497
497- outbytes , errbytes , err := utils .ExecCommand (ctx , command , stdout , stderr )
498- return command , outbytes , errbytes , err
498+ return archiveFilePath , nil
499499}
500500
501501const COMMANDLINE_LIMIT = 30000
@@ -511,7 +511,11 @@ func PrepareCommandForRecipe(buildProperties *properties.Map, recipe string, rem
511511 commandLine = properties .DeleteUnexpandedPropsFromString (commandLine )
512512 }
513513
514- command , err := utils .PrepareCommand (commandLine )
514+ parts , err := properties .SplitQuotedString (commandLine , `"'` , false )
515+ if err != nil {
516+ return nil , errors .WithStack (err )
517+ }
518+ command := exec .Command (parts [0 ], parts [1 :]... )
515519
516520 // if the overall commandline is too long for the platform
517521 // try reducing the length by making the filenames relative
@@ -530,9 +534,5 @@ func PrepareCommandForRecipe(buildProperties *properties.Map, recipe string, rem
530534 command .Dir = relativePath
531535 }
532536
533- if err != nil {
534- return nil , errors .WithStack (err )
535- }
536-
537537 return command , nil
538538}
0 commit comments