@@ -248,7 +248,12 @@ func compileFileWithRecipe(ctx *types.Context, sourcePath *paths.Path, source *p
248
248
return nil , errors .WithStack (err )
249
249
}
250
250
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 */ )
252
257
if err != nil {
253
258
return nil , errors .WithStack (err )
254
259
}
@@ -479,23 +484,18 @@ func ArchiveCompiledFiles(ctx *types.Context, buildPath *paths.Path, archiveFile
479
484
properties .SetPath (constants .BUILD_PROPERTIES_ARCHIVE_FILE_PATH , archiveFilePath )
480
485
properties .SetPath (constants .BUILD_PROPERTIES_OBJECT_FILE , objectFile )
481
486
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 {
483
489
return nil , errors .WithStack (err )
484
490
}
485
- }
486
491
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
+ }
495
496
}
496
497
497
- outbytes , errbytes , err := utils .ExecCommand (ctx , command , stdout , stderr )
498
- return command , outbytes , errbytes , err
498
+ return archiveFilePath , nil
499
499
}
500
500
501
501
const COMMANDLINE_LIMIT = 30000
@@ -511,7 +511,11 @@ func PrepareCommandForRecipe(buildProperties *properties.Map, recipe string, rem
511
511
commandLine = properties .DeleteUnexpandedPropsFromString (commandLine )
512
512
}
513
513
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 :]... )
515
519
516
520
// if the overall commandline is too long for the platform
517
521
// try reducing the length by making the filenames relative
@@ -530,9 +534,5 @@ func PrepareCommandForRecipe(buildProperties *properties.Map, recipe string, rem
530
534
command .Dir = relativePath
531
535
}
532
536
533
- if err != nil {
534
- return nil , errors .WithStack (err )
535
- }
536
-
537
537
return command , nil
538
538
}
0 commit comments