public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
* [Patch 1/1] BaseTools/PlatformAutoGen: MAKE_FLAGS and MAKE_PATH fixes
@ 2021-04-09 21:48 Michael D Kinney
  2021-04-12  1:48 ` Yuwei Chen
  2021-04-13  1:31 ` 回复: [edk2-devel] " gaoliming
  0 siblings, 2 replies; 5+ messages in thread
From: Michael D Kinney @ 2021-04-09 21:48 UTC (permalink / raw)
  To: devel; +Cc: Bob Feng, Liming Gao, Yuwei Chen

REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3312

Update parsing of MAKE_FLAGS in DSC [BuildOptions] sections
to split the flags into a list to be compatible with
running the make command using Popen().  Parsing MAKE_FLAGS
from tools_def.txt already uses _SplitOption().  This change
uses the same _SplitOption() method for MAKE_FLAGS from a
DSC [BuildOptions] section.

Also update the parsing of MAKE_PATH to support MAKE_PATH
from tools_def.txt or the DSC [BuildOptions] section.  MAKE_PATH
in DSC [BuildOptions] section is higher priority than MAKE_PATH
in tools_def.txt.

Cc: Bob Feng <bob.c.feng@intel.com>
Cc: Liming Gao <gaoliming@byosoft.com.cn>
Cc: Yuwei Chen <yuwei.chen@intel.com>
Signed-off-by: Michael D Kinney <michael.d.kinney@intel.com>
---
 .../Source/Python/AutoGen/PlatformAutoGen.py  | 36 +++++++++++--------
 1 file changed, 21 insertions(+), 15 deletions(-)

diff --git a/BaseTools/Source/Python/AutoGen/PlatformAutoGen.py b/BaseTools/Source/Python/AutoGen/PlatformAutoGen.py
index 7d8e7b3c7cc1..c16f2e4cd8b7 100644
--- a/BaseTools/Source/Python/AutoGen/PlatformAutoGen.py
+++ b/BaseTools/Source/Python/AutoGen/PlatformAutoGen.py
@@ -1,7 +1,7 @@
 ## @file
 # Create makefile for MS nmake and GNU make
 #
-# Copyright (c) 2019, Intel Corporation. All rights reserved.<BR>
+# Copyright (c) 2019 - 2021, Intel Corporation. All rights reserved.<BR>
 #  Copyright (c) 2020, ARM Limited. All rights reserved.<BR>
 # SPDX-License-Identifier: BSD-2-Clause-Patent
 #
@@ -805,20 +805,26 @@ class PlatformAutoGen(AutoGen):
     #
     @cached_property
     def BuildCommand(self):
-        RetVal = []
-        if "MAKE" in self.ToolDefinition and "PATH" in self.ToolDefinition["MAKE"]:
-            RetVal += _SplitOption(self.ToolDefinition["MAKE"]["PATH"])
-            if "FLAGS" in self.ToolDefinition["MAKE"]:
-                NewOption = self.ToolDefinition["MAKE"]["FLAGS"].strip()
-                if NewOption != '':
-                    RetVal += _SplitOption(NewOption)
-            if "MAKE" in self.EdkIIBuildOption:
-                if "FLAGS" in self.EdkIIBuildOption["MAKE"]:
-                    Flags = self.EdkIIBuildOption["MAKE"]["FLAGS"]
-                    if Flags.startswith('='):
-                        RetVal = [RetVal[0]] + [Flags[1:]]
-                    else:
-                        RetVal.append(Flags)
+        if "MAKE" in self.EdkIIBuildOption and "PATH" in self.EdkIIBuildOption["MAKE"]:
+            # MAKE_PATH in DSC [BuildOptions] section is higher priority
+            Path = self.EdkIIBuildOption["MAKE"]["PATH"]
+            if Path.startswith('='):
+                Path = Path[1:].strip()
+            RetVal = _SplitOption(Path)
+        elif "MAKE" in self.ToolDefinition and "PATH" in self.ToolDefinition["MAKE"]:
+            RetVal = _SplitOption(self.ToolDefinition["MAKE"]["PATH"])
+        else:
+            return []
+        if "MAKE" in self.ToolDefinition and "FLAGS" in self.ToolDefinition["MAKE"]:
+            NewOption = self.ToolDefinition["MAKE"]["FLAGS"].strip()
+            if NewOption != '':
+                RetVal += _SplitOption(NewOption)
+        if "MAKE" in self.EdkIIBuildOption and "FLAGS" in self.EdkIIBuildOption["MAKE"]:
+            Flags = self.EdkIIBuildOption["MAKE"]["FLAGS"]
+            if Flags.startswith('='):
+                RetVal = [RetVal[0]] + _SplitOption(Flags[1:].strip())
+            else:
+                RetVal = RetVal + _SplitOption(Flags.strip())
         return RetVal
 
     ## Get tool chain definition
-- 
2.31.1.windows.1


^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [Patch 1/1] BaseTools/PlatformAutoGen: MAKE_FLAGS and MAKE_PATH fixes
  2021-04-09 21:48 [Patch 1/1] BaseTools/PlatformAutoGen: MAKE_FLAGS and MAKE_PATH fixes Michael D Kinney
@ 2021-04-12  1:48 ` Yuwei Chen
  2021-04-13  1:31 ` 回复: [edk2-devel] " gaoliming
  1 sibling, 0 replies; 5+ messages in thread
From: Yuwei Chen @ 2021-04-12  1:48 UTC (permalink / raw)
  To: Kinney, Michael D, devel@edk2.groups.io; +Cc: Feng, Bob C, Liming Gao

Reviewed-by: Yuwei Chen<yuwei.chen@intel.com>

> -----Original Message-----
> From: Kinney, Michael D <michael.d.kinney@intel.com>
> Sent: Saturday, April 10, 2021 5:49 AM
> To: devel@edk2.groups.io
> Cc: Feng, Bob C <bob.c.feng@intel.com>; Liming Gao
> <gaoliming@byosoft.com.cn>; Chen, Christine <yuwei.chen@intel.com>
> Subject: [Patch 1/1] BaseTools/PlatformAutoGen: MAKE_FLAGS and
> MAKE_PATH fixes
> 
> REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3312
> 
> Update parsing of MAKE_FLAGS in DSC [BuildOptions] sections to split the
> flags into a list to be compatible with running the make command using
> Popen().  Parsing MAKE_FLAGS from tools_def.txt already uses _SplitOption().
> This change uses the same _SplitOption() method for MAKE_FLAGS from a
> DSC [BuildOptions] section.
> 
> Also update the parsing of MAKE_PATH to support MAKE_PATH from
> tools_def.txt or the DSC [BuildOptions] section.  MAKE_PATH in DSC
> [BuildOptions] section is higher priority than MAKE_PATH in tools_def.txt.
> 
> Cc: Bob Feng <bob.c.feng@intel.com>
> Cc: Liming Gao <gaoliming@byosoft.com.cn>
> Cc: Yuwei Chen <yuwei.chen@intel.com>
> Signed-off-by: Michael D Kinney <michael.d.kinney@intel.com>
> ---
>  .../Source/Python/AutoGen/PlatformAutoGen.py  | 36 +++++++++++--------
>  1 file changed, 21 insertions(+), 15 deletions(-)
> 
> diff --git a/BaseTools/Source/Python/AutoGen/PlatformAutoGen.py
> b/BaseTools/Source/Python/AutoGen/PlatformAutoGen.py
> index 7d8e7b3c7cc1..c16f2e4cd8b7 100644
> --- a/BaseTools/Source/Python/AutoGen/PlatformAutoGen.py
> +++ b/BaseTools/Source/Python/AutoGen/PlatformAutoGen.py
> @@ -1,7 +1,7 @@
>  ## @file
>  # Create makefile for MS nmake and GNU make  # -# Copyright (c) 2019, Intel
> Corporation. All rights reserved.<BR>
> +# Copyright (c) 2019 - 2021, Intel Corporation. All rights
> +reserved.<BR>
>  #  Copyright (c) 2020, ARM Limited. All rights reserved.<BR>  # SPDX-License-
> Identifier: BSD-2-Clause-Patent  # @@ -805,20 +805,26 @@ class
> PlatformAutoGen(AutoGen):
>      #
>      @cached_property
>      def BuildCommand(self):
> -        RetVal = []
> -        if "MAKE" in self.ToolDefinition and "PATH" in
> self.ToolDefinition["MAKE"]:
> -            RetVal += _SplitOption(self.ToolDefinition["MAKE"]["PATH"])
> -            if "FLAGS" in self.ToolDefinition["MAKE"]:
> -                NewOption = self.ToolDefinition["MAKE"]["FLAGS"].strip()
> -                if NewOption != '':
> -                    RetVal += _SplitOption(NewOption)
> -            if "MAKE" in self.EdkIIBuildOption:
> -                if "FLAGS" in self.EdkIIBuildOption["MAKE"]:
> -                    Flags = self.EdkIIBuildOption["MAKE"]["FLAGS"]
> -                    if Flags.startswith('='):
> -                        RetVal = [RetVal[0]] + [Flags[1:]]
> -                    else:
> -                        RetVal.append(Flags)
> +        if "MAKE" in self.EdkIIBuildOption and "PATH" in
> self.EdkIIBuildOption["MAKE"]:
> +            # MAKE_PATH in DSC [BuildOptions] section is higher priority
> +            Path = self.EdkIIBuildOption["MAKE"]["PATH"]
> +            if Path.startswith('='):
> +                Path = Path[1:].strip()
> +            RetVal = _SplitOption(Path)
> +        elif "MAKE" in self.ToolDefinition and "PATH" in
> self.ToolDefinition["MAKE"]:
> +            RetVal = _SplitOption(self.ToolDefinition["MAKE"]["PATH"])
> +        else:
> +            return []
> +        if "MAKE" in self.ToolDefinition and "FLAGS" in
> self.ToolDefinition["MAKE"]:
> +            NewOption = self.ToolDefinition["MAKE"]["FLAGS"].strip()
> +            if NewOption != '':
> +                RetVal += _SplitOption(NewOption)
> +        if "MAKE" in self.EdkIIBuildOption and "FLAGS" in
> self.EdkIIBuildOption["MAKE"]:
> +            Flags = self.EdkIIBuildOption["MAKE"]["FLAGS"]
> +            if Flags.startswith('='):
> +                RetVal = [RetVal[0]] + _SplitOption(Flags[1:].strip())
> +            else:
> +                RetVal = RetVal + _SplitOption(Flags.strip())
>          return RetVal
> 
>      ## Get tool chain definition
> --
> 2.31.1.windows.1


^ permalink raw reply	[flat|nested] 5+ messages in thread

* 回复: [edk2-devel] [Patch 1/1] BaseTools/PlatformAutoGen: MAKE_FLAGS and MAKE_PATH fixes
  2021-04-09 21:48 [Patch 1/1] BaseTools/PlatformAutoGen: MAKE_FLAGS and MAKE_PATH fixes Michael D Kinney
  2021-04-12  1:48 ` Yuwei Chen
@ 2021-04-13  1:31 ` gaoliming
  2021-04-13  2:40   ` Michael D Kinney
  1 sibling, 1 reply; 5+ messages in thread
From: gaoliming @ 2021-04-13  1:31 UTC (permalink / raw)
  To: devel, michael.d.kinney; +Cc: 'Bob Feng', 'Yuwei Chen'

Mike:
  I don't see the issue in the code change. I want to know what unit test
has been done for this change. 

Thanks
Liming
> -----邮件原件-----
> 发件人: devel@edk2.groups.io <devel@edk2.groups.io> 代表 Michael D
> Kinney
> 发送时间: 2021年4月10日 5:49
> 收件人: devel@edk2.groups.io
> 抄送: Bob Feng <bob.c.feng@intel.com>; Liming Gao
> <gaoliming@byosoft.com.cn>; Yuwei Chen <yuwei.chen@intel.com>
> 主题: [edk2-devel] [Patch 1/1] BaseTools/PlatformAutoGen: MAKE_FLAGS
> and MAKE_PATH fixes
> 
> REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3312
> 
> Update parsing of MAKE_FLAGS in DSC [BuildOptions] sections
> to split the flags into a list to be compatible with
> running the make command using Popen().  Parsing MAKE_FLAGS
> from tools_def.txt already uses _SplitOption().  This change
> uses the same _SplitOption() method for MAKE_FLAGS from a
> DSC [BuildOptions] section.
> 
> Also update the parsing of MAKE_PATH to support MAKE_PATH
> from tools_def.txt or the DSC [BuildOptions] section.  MAKE_PATH
> in DSC [BuildOptions] section is higher priority than MAKE_PATH
> in tools_def.txt.
> 
> Cc: Bob Feng <bob.c.feng@intel.com>
> Cc: Liming Gao <gaoliming@byosoft.com.cn>
> Cc: Yuwei Chen <yuwei.chen@intel.com>
> Signed-off-by: Michael D Kinney <michael.d.kinney@intel.com>
> ---
>  .../Source/Python/AutoGen/PlatformAutoGen.py  | 36 +++++++++++--------
>  1 file changed, 21 insertions(+), 15 deletions(-)
> 
> diff --git a/BaseTools/Source/Python/AutoGen/PlatformAutoGen.py
> b/BaseTools/Source/Python/AutoGen/PlatformAutoGen.py
> index 7d8e7b3c7cc1..c16f2e4cd8b7 100644
> --- a/BaseTools/Source/Python/AutoGen/PlatformAutoGen.py
> +++ b/BaseTools/Source/Python/AutoGen/PlatformAutoGen.py
> @@ -1,7 +1,7 @@
>  ## @file
>  # Create makefile for MS nmake and GNU make
>  #
> -# Copyright (c) 2019, Intel Corporation. All rights reserved.<BR>
> +# Copyright (c) 2019 - 2021, Intel Corporation. All rights reserved.<BR>
>  #  Copyright (c) 2020, ARM Limited. All rights reserved.<BR>
>  # SPDX-License-Identifier: BSD-2-Clause-Patent
>  #
> @@ -805,20 +805,26 @@ class PlatformAutoGen(AutoGen):
>      #
>      @cached_property
>      def BuildCommand(self):
> -        RetVal = []
> -        if "MAKE" in self.ToolDefinition and "PATH" in
> self.ToolDefinition["MAKE"]:
> -            RetVal += _SplitOption(self.ToolDefinition["MAKE"]["PATH"])
> -            if "FLAGS" in self.ToolDefinition["MAKE"]:
> -                NewOption =
> self.ToolDefinition["MAKE"]["FLAGS"].strip()
> -                if NewOption != '':
> -                    RetVal += _SplitOption(NewOption)
> -            if "MAKE" in self.EdkIIBuildOption:
> -                if "FLAGS" in self.EdkIIBuildOption["MAKE"]:
> -                    Flags = self.EdkIIBuildOption["MAKE"]["FLAGS"]
> -                    if Flags.startswith('='):
> -                        RetVal = [RetVal[0]] + [Flags[1:]]
> -                    else:
> -                        RetVal.append(Flags)
> +        if "MAKE" in self.EdkIIBuildOption and "PATH" in
> self.EdkIIBuildOption["MAKE"]:
> +            # MAKE_PATH in DSC [BuildOptions] section is higher priority
> +            Path = self.EdkIIBuildOption["MAKE"]["PATH"]
> +            if Path.startswith('='):
> +                Path = Path[1:].strip()
> +            RetVal = _SplitOption(Path)
> +        elif "MAKE" in self.ToolDefinition and "PATH" in
> self.ToolDefinition["MAKE"]:
> +            RetVal = _SplitOption(self.ToolDefinition["MAKE"]["PATH"])
> +        else:
> +            return []
> +        if "MAKE" in self.ToolDefinition and "FLAGS" in
> self.ToolDefinition["MAKE"]:
> +            NewOption = self.ToolDefinition["MAKE"]["FLAGS"].strip()
> +            if NewOption != '':
> +                RetVal += _SplitOption(NewOption)
> +        if "MAKE" in self.EdkIIBuildOption and "FLAGS" in
> self.EdkIIBuildOption["MAKE"]:
> +            Flags = self.EdkIIBuildOption["MAKE"]["FLAGS"]
> +            if Flags.startswith('='):
> +                RetVal = [RetVal[0]] + _SplitOption(Flags[1:].strip())
> +            else:
> +                RetVal = RetVal + _SplitOption(Flags.strip())
>          return RetVal
> 
>      ## Get tool chain definition
> --
> 2.31.1.windows.1
> 
> 
> 
> 
> 




^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [edk2-devel] [Patch 1/1] BaseTools/PlatformAutoGen: MAKE_FLAGS and MAKE_PATH fixes
  2021-04-13  1:31 ` 回复: [edk2-devel] " gaoliming
@ 2021-04-13  2:40   ` Michael D Kinney
  2021-04-13  7:36     ` Bob Feng
  0 siblings, 1 reply; 5+ messages in thread
From: Michael D Kinney @ 2021-04-13  2:40 UTC (permalink / raw)
  To: gaoliming, devel@edk2.groups.io, Kinney, Michael D
  Cc: Feng, Bob C, Chen, Christine

Liming,

The BZ contains an example of MAKE_FLAGS in DSC that breaks the build.  With this change,
that example passes and shows the additional make tool output.

Mike

> -----Original Message-----
> From: gaoliming <gaoliming@byosoft.com.cn>
> Sent: Monday, April 12, 2021 6:31 PM
> To: devel@edk2.groups.io; Kinney, Michael D <michael.d.kinney@intel.com>
> Cc: Feng, Bob C <bob.c.feng@intel.com>; Chen, Christine <yuwei.chen@intel.com>
> Subject: 回复: [edk2-devel] [Patch 1/1] BaseTools/PlatformAutoGen: MAKE_FLAGS and MAKE_PATH fixes
> 
> Mike:
>   I don't see the issue in the code change. I want to know what unit test
> has been done for this change.
> 
> Thanks
> Liming
> > -----邮件原件-----
> > 发件人: devel@edk2.groups.io <devel@edk2.groups.io> 代表 Michael D
> > Kinney
> > 发送时间: 2021年4月10日 5:49
> > 收件人: devel@edk2.groups.io
> > 抄送: Bob Feng <bob.c.feng@intel.com>; Liming Gao
> > <gaoliming@byosoft.com.cn>; Yuwei Chen <yuwei.chen@intel.com>
> > 主题: [edk2-devel] [Patch 1/1] BaseTools/PlatformAutoGen: MAKE_FLAGS
> > and MAKE_PATH fixes
> >
> > REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3312
> >
> > Update parsing of MAKE_FLAGS in DSC [BuildOptions] sections
> > to split the flags into a list to be compatible with
> > running the make command using Popen().  Parsing MAKE_FLAGS
> > from tools_def.txt already uses _SplitOption().  This change
> > uses the same _SplitOption() method for MAKE_FLAGS from a
> > DSC [BuildOptions] section.
> >
> > Also update the parsing of MAKE_PATH to support MAKE_PATH
> > from tools_def.txt or the DSC [BuildOptions] section.  MAKE_PATH
> > in DSC [BuildOptions] section is higher priority than MAKE_PATH
> > in tools_def.txt.
> >
> > Cc: Bob Feng <bob.c.feng@intel.com>
> > Cc: Liming Gao <gaoliming@byosoft.com.cn>
> > Cc: Yuwei Chen <yuwei.chen@intel.com>
> > Signed-off-by: Michael D Kinney <michael.d.kinney@intel.com>
> > ---
> >  .../Source/Python/AutoGen/PlatformAutoGen.py  | 36 +++++++++++--------
> >  1 file changed, 21 insertions(+), 15 deletions(-)
> >
> > diff --git a/BaseTools/Source/Python/AutoGen/PlatformAutoGen.py
> > b/BaseTools/Source/Python/AutoGen/PlatformAutoGen.py
> > index 7d8e7b3c7cc1..c16f2e4cd8b7 100644
> > --- a/BaseTools/Source/Python/AutoGen/PlatformAutoGen.py
> > +++ b/BaseTools/Source/Python/AutoGen/PlatformAutoGen.py
> > @@ -1,7 +1,7 @@
> >  ## @file
> >  # Create makefile for MS nmake and GNU make
> >  #
> > -# Copyright (c) 2019, Intel Corporation. All rights reserved.<BR>
> > +# Copyright (c) 2019 - 2021, Intel Corporation. All rights reserved.<BR>
> >  #  Copyright (c) 2020, ARM Limited. All rights reserved.<BR>
> >  # SPDX-License-Identifier: BSD-2-Clause-Patent
> >  #
> > @@ -805,20 +805,26 @@ class PlatformAutoGen(AutoGen):
> >      #
> >      @cached_property
> >      def BuildCommand(self):
> > -        RetVal = []
> > -        if "MAKE" in self.ToolDefinition and "PATH" in
> > self.ToolDefinition["MAKE"]:
> > -            RetVal += _SplitOption(self.ToolDefinition["MAKE"]["PATH"])
> > -            if "FLAGS" in self.ToolDefinition["MAKE"]:
> > -                NewOption =
> > self.ToolDefinition["MAKE"]["FLAGS"].strip()
> > -                if NewOption != '':
> > -                    RetVal += _SplitOption(NewOption)
> > -            if "MAKE" in self.EdkIIBuildOption:
> > -                if "FLAGS" in self.EdkIIBuildOption["MAKE"]:
> > -                    Flags = self.EdkIIBuildOption["MAKE"]["FLAGS"]
> > -                    if Flags.startswith('='):
> > -                        RetVal = [RetVal[0]] + [Flags[1:]]
> > -                    else:
> > -                        RetVal.append(Flags)
> > +        if "MAKE" in self.EdkIIBuildOption and "PATH" in
> > self.EdkIIBuildOption["MAKE"]:
> > +            # MAKE_PATH in DSC [BuildOptions] section is higher priority
> > +            Path = self.EdkIIBuildOption["MAKE"]["PATH"]
> > +            if Path.startswith('='):
> > +                Path = Path[1:].strip()
> > +            RetVal = _SplitOption(Path)
> > +        elif "MAKE" in self.ToolDefinition and "PATH" in
> > self.ToolDefinition["MAKE"]:
> > +            RetVal = _SplitOption(self.ToolDefinition["MAKE"]["PATH"])
> > +        else:
> > +            return []
> > +        if "MAKE" in self.ToolDefinition and "FLAGS" in
> > self.ToolDefinition["MAKE"]:
> > +            NewOption = self.ToolDefinition["MAKE"]["FLAGS"].strip()
> > +            if NewOption != '':
> > +                RetVal += _SplitOption(NewOption)
> > +        if "MAKE" in self.EdkIIBuildOption and "FLAGS" in
> > self.EdkIIBuildOption["MAKE"]:
> > +            Flags = self.EdkIIBuildOption["MAKE"]["FLAGS"]
> > +            if Flags.startswith('='):
> > +                RetVal = [RetVal[0]] + _SplitOption(Flags[1:].strip())
> > +            else:
> > +                RetVal = RetVal + _SplitOption(Flags.strip())
> >          return RetVal
> >
> >      ## Get tool chain definition
> > --
> > 2.31.1.windows.1
> >
> >
> >
> > 
> >
> 
> 


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [edk2-devel] [Patch 1/1] BaseTools/PlatformAutoGen: MAKE_FLAGS and MAKE_PATH fixes
  2021-04-13  2:40   ` Michael D Kinney
@ 2021-04-13  7:36     ` Bob Feng
  0 siblings, 0 replies; 5+ messages in thread
From: Bob Feng @ 2021-04-13  7:36 UTC (permalink / raw)
  To: Kinney, Michael D, gaoliming, devel@edk2.groups.io; +Cc: Chen, Christine

This patch looks good to me.

Reviewed-by: Bob Feng <bob.c.feng@intel.com>

Thanks,
Bob

-----Original Message-----
From: Kinney, Michael D <michael.d.kinney@intel.com> 
Sent: Tuesday, April 13, 2021 10:40 AM
To: gaoliming <gaoliming@byosoft.com.cn>; devel@edk2.groups.io; Kinney, Michael D <michael.d.kinney@intel.com>
Cc: Feng, Bob C <bob.c.feng@intel.com>; Chen, Christine <yuwei.chen@intel.com>
Subject: RE: [edk2-devel] [Patch 1/1] BaseTools/PlatformAutoGen: MAKE_FLAGS and MAKE_PATH fixes

Liming,

The BZ contains an example of MAKE_FLAGS in DSC that breaks the build.  With this change, that example passes and shows the additional make tool output.

Mike

> -----Original Message-----
> From: gaoliming <gaoliming@byosoft.com.cn>
> Sent: Monday, April 12, 2021 6:31 PM
> To: devel@edk2.groups.io; Kinney, Michael D 
> <michael.d.kinney@intel.com>
> Cc: Feng, Bob C <bob.c.feng@intel.com>; Chen, Christine 
> <yuwei.chen@intel.com>
> Subject: 回复: [edk2-devel] [Patch 1/1] BaseTools/PlatformAutoGen: 
> MAKE_FLAGS and MAKE_PATH fixes
> 
> Mike:
>   I don't see the issue in the code change. I want to know what unit 
> test has been done for this change.
> 
> Thanks
> Liming
> > -----邮件原件-----
> > 发件人: devel@edk2.groups.io <devel@edk2.groups.io> 代表 Michael D Kinney
> > 发送时间: 2021年4月10日 5:49
> > 收件人: devel@edk2.groups.io
> > 抄送: Bob Feng <bob.c.feng@intel.com>; Liming Gao 
> > <gaoliming@byosoft.com.cn>; Yuwei Chen <yuwei.chen@intel.com>
> > 主题: [edk2-devel] [Patch 1/1] BaseTools/PlatformAutoGen: MAKE_FLAGS 
> > and MAKE_PATH fixes
> >
> > REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3312
> >
> > Update parsing of MAKE_FLAGS in DSC [BuildOptions] sections to split 
> > the flags into a list to be compatible with running the make command 
> > using Popen().  Parsing MAKE_FLAGS from tools_def.txt already uses 
> > _SplitOption().  This change uses the same _SplitOption() method for 
> > MAKE_FLAGS from a DSC [BuildOptions] section.
> >
> > Also update the parsing of MAKE_PATH to support MAKE_PATH from 
> > tools_def.txt or the DSC [BuildOptions] section.  MAKE_PATH in DSC 
> > [BuildOptions] section is higher priority than MAKE_PATH in 
> > tools_def.txt.
> >
> > Cc: Bob Feng <bob.c.feng@intel.com>
> > Cc: Liming Gao <gaoliming@byosoft.com.cn>
> > Cc: Yuwei Chen <yuwei.chen@intel.com>
> > Signed-off-by: Michael D Kinney <michael.d.kinney@intel.com>
> > ---
> >  .../Source/Python/AutoGen/PlatformAutoGen.py  | 36 
> > +++++++++++--------
> >  1 file changed, 21 insertions(+), 15 deletions(-)
> >
> > diff --git a/BaseTools/Source/Python/AutoGen/PlatformAutoGen.py
> > b/BaseTools/Source/Python/AutoGen/PlatformAutoGen.py
> > index 7d8e7b3c7cc1..c16f2e4cd8b7 100644
> > --- a/BaseTools/Source/Python/AutoGen/PlatformAutoGen.py
> > +++ b/BaseTools/Source/Python/AutoGen/PlatformAutoGen.py
> > @@ -1,7 +1,7 @@
> >  ## @file
> >  # Create makefile for MS nmake and GNU make  # -# Copyright (c) 
> > 2019, Intel Corporation. All rights reserved.<BR>
> > +# Copyright (c) 2019 - 2021, Intel Corporation. All rights 
> > +reserved.<BR>
> >  #  Copyright (c) 2020, ARM Limited. All rights reserved.<BR>  # 
> > SPDX-License-Identifier: BSD-2-Clause-Patent  # @@ -805,20 +805,26 
> > @@ class PlatformAutoGen(AutoGen):
> >      #
> >      @cached_property
> >      def BuildCommand(self):
> > -        RetVal = []
> > -        if "MAKE" in self.ToolDefinition and "PATH" in
> > self.ToolDefinition["MAKE"]:
> > -            RetVal += _SplitOption(self.ToolDefinition["MAKE"]["PATH"])
> > -            if "FLAGS" in self.ToolDefinition["MAKE"]:
> > -                NewOption =
> > self.ToolDefinition["MAKE"]["FLAGS"].strip()
> > -                if NewOption != '':
> > -                    RetVal += _SplitOption(NewOption)
> > -            if "MAKE" in self.EdkIIBuildOption:
> > -                if "FLAGS" in self.EdkIIBuildOption["MAKE"]:
> > -                    Flags = self.EdkIIBuildOption["MAKE"]["FLAGS"]
> > -                    if Flags.startswith('='):
> > -                        RetVal = [RetVal[0]] + [Flags[1:]]
> > -                    else:
> > -                        RetVal.append(Flags)
> > +        if "MAKE" in self.EdkIIBuildOption and "PATH" in
> > self.EdkIIBuildOption["MAKE"]:
> > +            # MAKE_PATH in DSC [BuildOptions] section is higher priority
> > +            Path = self.EdkIIBuildOption["MAKE"]["PATH"]
> > +            if Path.startswith('='):
> > +                Path = Path[1:].strip()
> > +            RetVal = _SplitOption(Path)
> > +        elif "MAKE" in self.ToolDefinition and "PATH" in
> > self.ToolDefinition["MAKE"]:
> > +            RetVal = _SplitOption(self.ToolDefinition["MAKE"]["PATH"])
> > +        else:
> > +            return []
> > +        if "MAKE" in self.ToolDefinition and "FLAGS" in
> > self.ToolDefinition["MAKE"]:
> > +            NewOption = self.ToolDefinition["MAKE"]["FLAGS"].strip()
> > +            if NewOption != '':
> > +                RetVal += _SplitOption(NewOption)
> > +        if "MAKE" in self.EdkIIBuildOption and "FLAGS" in
> > self.EdkIIBuildOption["MAKE"]:
> > +            Flags = self.EdkIIBuildOption["MAKE"]["FLAGS"]
> > +            if Flags.startswith('='):
> > +                RetVal = [RetVal[0]] + _SplitOption(Flags[1:].strip())
> > +            else:
> > +                RetVal = RetVal + _SplitOption(Flags.strip())
> >          return RetVal
> >
> >      ## Get tool chain definition
> > --
> > 2.31.1.windows.1
> >
> >
> >
> > 
> >
> 
> 


^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2021-04-13  7:37 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-04-09 21:48 [Patch 1/1] BaseTools/PlatformAutoGen: MAKE_FLAGS and MAKE_PATH fixes Michael D Kinney
2021-04-12  1:48 ` Yuwei Chen
2021-04-13  1:31 ` 回复: [edk2-devel] " gaoliming
2021-04-13  2:40   ` Michael D Kinney
2021-04-13  7:36     ` Bob Feng

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox