@@ -240,7 +240,6 @@ func buildLocal2(ctx context.Context, bParams *buildParams, clean bool) (err err
240
240
241
241
var errs error
242
242
for k , v := range map [string ]string {
243
- "MGOS_PATH" : dockerMgosPath ,
244
243
"PLATFORM" : manifest .Platform ,
245
244
"BUILD_DIR" : objsDirDocker ,
246
245
"FW_DIR" : fwDirDocker ,
@@ -278,9 +277,9 @@ func buildLocal2(ctx context.Context, bParams *buildParams, clean bool) (err err
278
277
return errors .Trace (err )
279
278
}
280
279
280
+ makeFilePath := moscommon .GetPlatformMakefilePath (fp .MosDirEffective , manifest .Platform )
281
281
makeVarsFileSupported := false
282
- if data , err := ioutil .ReadFile (
283
- moscommon .GetPlatformMakefilePath (fp .MosDirEffective , manifest .Platform )); err == nil {
282
+ if data , err := ioutil .ReadFile (makeFilePath ); err == nil {
284
283
makeVarsFileSupported = bytes .Contains (data , []byte ("MGOS_VARS_FILE" ))
285
284
}
286
285
@@ -317,6 +316,8 @@ func buildLocal2(ctx context.Context, bParams *buildParams, clean bool) (err err
317
316
mp .addMountPoint (fp .MosDirEffective , dockerMgosPath )
318
317
mp .addMountPoint (fp .MosDirEffective , ourutil .GetPathForDocker (fp .MosDirEffective ))
319
318
319
+ manifest .BuildVars ["MGOS_PATH" ] = ourutil .GetPathForDocker (fp .MosDirEffective )
320
+
320
321
// Mount build dir
321
322
mp .addMountPoint (buildDirAbs , ourutil .GetPathForDocker (buildDirAbs ))
322
323
@@ -396,6 +397,7 @@ func buildLocal2(ctx context.Context, bParams *buildParams, clean bool) (err err
396
397
397
398
makeArgs , err := getMakeArgs (
398
399
filepath .ToSlash (fmt .Sprintf ("%s%s" , dockerAppPath , appSubdir )),
400
+ makeFilePath ,
399
401
bParams .BuildTarget ,
400
402
buildDirAbs ,
401
403
manifest ,
@@ -420,7 +422,14 @@ func buildLocal2(ctx context.Context, bParams *buildParams, clean bool) (err err
420
422
421
423
manifest .BuildVars ["MGOS_PATH" ] = fp .MosDirEffective
422
424
423
- makeArgs , err := getMakeArgs (appPath , bParams .BuildTarget , buildDirAbs , manifest , makeVarsFileSupported )
425
+ makeArgs , err := getMakeArgs (
426
+ appPath ,
427
+ makeFilePath ,
428
+ bParams .BuildTarget ,
429
+ buildDirAbs ,
430
+ manifest ,
431
+ makeVarsFileSupported ,
432
+ )
424
433
if err != nil {
425
434
return errors .Trace (err )
426
435
}
@@ -468,7 +477,7 @@ func isInDockerToolbox() bool {
468
477
return os .Getenv ("DOCKER_HOST" ) != ""
469
478
}
470
479
471
- func getMakeArgs (dir , target , buildDirAbs string , manifest * build.FWAppManifest , makeVarsFileSupported bool ) ([]string , error ) {
480
+ func getMakeArgs (dir , makeFilePath , target , buildDirAbs string , manifest * build.FWAppManifest , makeVarsFileSupported bool ) ([]string , error ) {
472
481
j := * buildParalellism
473
482
if j == 0 {
474
483
j = runtime .NumCPU ()
@@ -489,10 +498,7 @@ func getMakeArgs(dir, target, buildDirAbs string, manifest *build.FWAppManifest,
489
498
makeArgs := []string {
490
499
"-j" , fmt .Sprintf ("%d" , j ),
491
500
"-C" , dir ,
492
- // NOTE that we use path instead of filepath, because it'll run in a docker
493
- // container, and thus will use Linux path separator
494
- "-f" , ourutil .GetPathForDocker (moscommon .GetPlatformMakefilePath (
495
- manifest .BuildVars ["MGOS_PATH" ], manifest .BuildVars ["PLATFORM" ])),
501
+ "-f" , ourutil .GetPathForDocker (makeFilePath ),
496
502
target ,
497
503
}
498
504
0 commit comments