public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
* [Patch 1/1] BaseTools: Fix a bug of genffs command generation
@ 2019-09-27  2:30 Bob Feng
  2019-09-27 10:02 ` [edk2-devel] " Philippe Mathieu-Daudé
                   ` (2 more replies)
  0 siblings, 3 replies; 5+ messages in thread
From: Bob Feng @ 2019-09-27  2:30 UTC (permalink / raw)
  To: devel; +Cc: Liming Gao, Bob Feng

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

The command used by multiple thread genffs feature in makefile
for testing if file exist is generated based on the toolchain family.
It should be based on the OS type.

Cc: Liming Gao <liming.gao@intel.com>
Signed-off-by: Bob Feng <bob.c.feng@intel.com>
---
 BaseTools/Source/Python/GenFds/GenFdsGlobalVariable.py | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/BaseTools/Source/Python/GenFds/GenFdsGlobalVariable.py b/BaseTools/Source/Python/GenFds/GenFdsGlobalVariable.py
index 4d8b2bdee299..bd97aa9dd208 100644
--- a/BaseTools/Source/Python/GenFds/GenFdsGlobalVariable.py
+++ b/BaseTools/Source/Python/GenFds/GenFdsGlobalVariable.py
@@ -11,10 +11,11 @@
 #
 from __future__ import print_function
 from __future__ import absolute_import
 
 import Common.LongFilePathOs as os
+import sys
 from sys import stdout
 from subprocess import PIPE,Popen
 from struct import Struct
 from array import array
 
@@ -484,11 +485,11 @@ class GenFdsGlobalVariable:
             Cmd += ("-o", Output)
             Cmd += Input
 
             SaveFileOnChange(CommandFile, ' '.join(Cmd), False)
             if IsMakefile:
-                if GlobalData.gGlobalDefines.get("FAMILY") == "MSFT":
+                if sys.platform == "win32":
                     Cmd = ['if', 'exist', Input[0]] + Cmd
                 else:
                     Cmd = ['-test', '-e', Input[0], "&&"] + Cmd
                 if ' '.join(Cmd).strip() not in GenFdsGlobalVariable.SecCmdList:
                     GenFdsGlobalVariable.SecCmdList.append(' '.join(Cmd).strip())
-- 
2.20.1.windows.1


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

* Re: [edk2-devel] [Patch 1/1] BaseTools: Fix a bug of genffs command generation
  2019-09-27  2:30 [Patch 1/1] BaseTools: Fix a bug of genffs command generation Bob Feng
@ 2019-09-27 10:02 ` Philippe Mathieu-Daudé
  2019-09-29  1:16 ` Liming Gao
  2019-10-12  6:03 ` Liming Gao
  2 siblings, 0 replies; 5+ messages in thread
From: Philippe Mathieu-Daudé @ 2019-09-27 10:02 UTC (permalink / raw)
  To: devel, bob.c.feng; +Cc: Liming Gao

On 9/27/19 4:30 AM, Bob Feng wrote:
> REF: https://bugzilla.tianocore.org/show_bug.cgi?id=2221
> 
> The command used by multiple thread genffs feature in makefile
> for testing if file exist is generated based on the toolchain family.
> It should be based on the OS type.
> 
> Cc: Liming Gao <liming.gao@intel.com>
> Signed-off-by: Bob Feng <bob.c.feng@intel.com>
> ---
>  BaseTools/Source/Python/GenFds/GenFdsGlobalVariable.py | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/BaseTools/Source/Python/GenFds/GenFdsGlobalVariable.py b/BaseTools/Source/Python/GenFds/GenFdsGlobalVariable.py
> index 4d8b2bdee299..bd97aa9dd208 100644
> --- a/BaseTools/Source/Python/GenFds/GenFdsGlobalVariable.py
> +++ b/BaseTools/Source/Python/GenFds/GenFdsGlobalVariable.py
> @@ -11,10 +11,11 @@
>  #
>  from __future__ import print_function
>  from __future__ import absolute_import
>  
>  import Common.LongFilePathOs as os
> +import sys
>  from sys import stdout
>  from subprocess import PIPE,Popen
>  from struct import Struct
>  from array import array
>  
> @@ -484,11 +485,11 @@ class GenFdsGlobalVariable:
>              Cmd += ("-o", Output)
>              Cmd += Input
>  
>              SaveFileOnChange(CommandFile, ' '.join(Cmd), False)
>              if IsMakefile:
> -                if GlobalData.gGlobalDefines.get("FAMILY") == "MSFT":
> +                if sys.platform == "win32":
>                      Cmd = ['if', 'exist', Input[0]] + Cmd
>                  else:
>                      Cmd = ['-test', '-e', Input[0], "&&"] + Cmd
>                  if ' '.join(Cmd).strip() not in GenFdsGlobalVariable.SecCmdList:
>                      GenFdsGlobalVariable.SecCmdList.append(' '.join(Cmd).strip())
> 

Reviewed-by: Philippe Mathieu-Daude <philmd@redhat.com>


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

* Re: [Patch 1/1] BaseTools: Fix a bug of genffs command generation
  2019-09-27  2:30 [Patch 1/1] BaseTools: Fix a bug of genffs command generation Bob Feng
  2019-09-27 10:02 ` [edk2-devel] " Philippe Mathieu-Daudé
@ 2019-09-29  1:16 ` Liming Gao
  2019-10-12  6:03 ` Liming Gao
  2 siblings, 0 replies; 5+ messages in thread
From: Liming Gao @ 2019-09-29  1:16 UTC (permalink / raw)
  To: Feng, Bob C, devel@edk2.groups.io; +Cc: Gao, Liming

Bob:
  Can BaseTools base on make command to generate Makefile? The different make command will use the different Makefile type. 

Thanks
Liming
>-----Original Message-----
>From: Feng, Bob C
>Sent: Friday, September 27, 2019 10:30 AM
>To: devel@edk2.groups.io
>Cc: Gao, Liming <liming.gao@intel.com>; Feng, Bob C <bob.c.feng@intel.com>
>Subject: [Patch 1/1] BaseTools: Fix a bug of genffs command generation
>
>REF: https://bugzilla.tianocore.org/show_bug.cgi?id=2221
>
>The command used by multiple thread genffs feature in makefile
>for testing if file exist is generated based on the toolchain family.
>It should be based on the OS type.
>
>Cc: Liming Gao <liming.gao@intel.com>
>Signed-off-by: Bob Feng <bob.c.feng@intel.com>
>---
> BaseTools/Source/Python/GenFds/GenFdsGlobalVariable.py | 3 ++-
> 1 file changed, 2 insertions(+), 1 deletion(-)
>
>diff --git a/BaseTools/Source/Python/GenFds/GenFdsGlobalVariable.py
>b/BaseTools/Source/Python/GenFds/GenFdsGlobalVariable.py
>index 4d8b2bdee299..bd97aa9dd208 100644
>--- a/BaseTools/Source/Python/GenFds/GenFdsGlobalVariable.py
>+++ b/BaseTools/Source/Python/GenFds/GenFdsGlobalVariable.py
>@@ -11,10 +11,11 @@
> #
> from __future__ import print_function
> from __future__ import absolute_import
>
> import Common.LongFilePathOs as os
>+import sys
> from sys import stdout
> from subprocess import PIPE,Popen
> from struct import Struct
> from array import array
>
>@@ -484,11 +485,11 @@ class GenFdsGlobalVariable:
>             Cmd += ("-o", Output)
>             Cmd += Input
>
>             SaveFileOnChange(CommandFile, ' '.join(Cmd), False)
>             if IsMakefile:
>-                if GlobalData.gGlobalDefines.get("FAMILY") == "MSFT":
>+                if sys.platform == "win32":
>                     Cmd = ['if', 'exist', Input[0]] + Cmd
>                 else:
>                     Cmd = ['-test', '-e', Input[0], "&&"] + Cmd
>                 if ' '.join(Cmd).strip() not in GenFdsGlobalVariable.SecCmdList:
>                     GenFdsGlobalVariable.SecCmdList.append(' '.join(Cmd).strip())
>--
>2.20.1.windows.1


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

* Re: [Patch 1/1] BaseTools: Fix a bug of genffs command generation
  2019-09-27  2:30 [Patch 1/1] BaseTools: Fix a bug of genffs command generation Bob Feng
  2019-09-27 10:02 ` [edk2-devel] " Philippe Mathieu-Daudé
  2019-09-29  1:16 ` Liming Gao
@ 2019-10-12  6:03 ` Liming Gao
  2019-10-14  1:02   ` Bob Feng
  2 siblings, 1 reply; 5+ messages in thread
From: Liming Gao @ 2019-10-12  6:03 UTC (permalink / raw)
  To: Feng, Bob C, devel@edk2.groups.io

Bob:
  I think this version patch is correct, because this case uses the different command in Makefile instead of the different syntax. 
 The command 'test' depends on batch environment. It is only available in bash, not in ms-dos. So, the check condition should be OS instead of make command.

Reviewed-by: Liming Gao <liming.gao@intel.com>

Thanks
Liming
>-----Original Message-----
>From: Feng, Bob C
>Sent: Friday, September 27, 2019 10:30 AM
>To: devel@edk2.groups.io
>Cc: Gao, Liming <liming.gao@intel.com>; Feng, Bob C <bob.c.feng@intel.com>
>Subject: [Patch 1/1] BaseTools: Fix a bug of genffs command generation
>
>REF: https://bugzilla.tianocore.org/show_bug.cgi?id=2221
>
>The command used by multiple thread genffs feature in makefile
>for testing if file exist is generated based on the toolchain family.
>It should be based on the OS type.
>
>Cc: Liming Gao <liming.gao@intel.com>
>Signed-off-by: Bob Feng <bob.c.feng@intel.com>
>---
> BaseTools/Source/Python/GenFds/GenFdsGlobalVariable.py | 3 ++-
> 1 file changed, 2 insertions(+), 1 deletion(-)
>
>diff --git a/BaseTools/Source/Python/GenFds/GenFdsGlobalVariable.py
>b/BaseTools/Source/Python/GenFds/GenFdsGlobalVariable.py
>index 4d8b2bdee299..bd97aa9dd208 100644
>--- a/BaseTools/Source/Python/GenFds/GenFdsGlobalVariable.py
>+++ b/BaseTools/Source/Python/GenFds/GenFdsGlobalVariable.py
>@@ -11,10 +11,11 @@
> #
> from __future__ import print_function
> from __future__ import absolute_import
>
> import Common.LongFilePathOs as os
>+import sys
> from sys import stdout
> from subprocess import PIPE,Popen
> from struct import Struct
> from array import array
>
>@@ -484,11 +485,11 @@ class GenFdsGlobalVariable:
>             Cmd += ("-o", Output)
>             Cmd += Input
>
>             SaveFileOnChange(CommandFile, ' '.join(Cmd), False)
>             if IsMakefile:
>-                if GlobalData.gGlobalDefines.get("FAMILY") == "MSFT":
>+                if sys.platform == "win32":
>                     Cmd = ['if', 'exist', Input[0]] + Cmd
>                 else:
>                     Cmd = ['-test', '-e', Input[0], "&&"] + Cmd
>                 if ' '.join(Cmd).strip() not in GenFdsGlobalVariable.SecCmdList:
>                     GenFdsGlobalVariable.SecCmdList.append(' '.join(Cmd).strip())
>--
>2.20.1.windows.1


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

* Re: [Patch 1/1] BaseTools: Fix a bug of genffs command generation
  2019-10-12  6:03 ` Liming Gao
@ 2019-10-14  1:02   ` Bob Feng
  0 siblings, 0 replies; 5+ messages in thread
From: Bob Feng @ 2019-10-14  1:02 UTC (permalink / raw)
  To: Gao, Liming, devel@edk2.groups.io

Pushed at a1f94045ffe9218ec438c4d23980de4243d21cd0

-----Original Message-----
From: Gao, Liming 
Sent: Saturday, October 12, 2019 2:04 PM
To: Feng, Bob C <bob.c.feng@intel.com>; devel@edk2.groups.io
Subject: RE: [Patch 1/1] BaseTools: Fix a bug of genffs command generation

Bob:
  I think this version patch is correct, because this case uses the different command in Makefile instead of the different syntax. 
 The command 'test' depends on batch environment. It is only available in bash, not in ms-dos. So, the check condition should be OS instead of make command.

Reviewed-by: Liming Gao <liming.gao@intel.com>

Thanks
Liming
>-----Original Message-----
>From: Feng, Bob C
>Sent: Friday, September 27, 2019 10:30 AM
>To: devel@edk2.groups.io
>Cc: Gao, Liming <liming.gao@intel.com>; Feng, Bob C 
><bob.c.feng@intel.com>
>Subject: [Patch 1/1] BaseTools: Fix a bug of genffs command generation
>
>REF: https://bugzilla.tianocore.org/show_bug.cgi?id=2221
>
>The command used by multiple thread genffs feature in makefile for 
>testing if file exist is generated based on the toolchain family.
>It should be based on the OS type.
>
>Cc: Liming Gao <liming.gao@intel.com>
>Signed-off-by: Bob Feng <bob.c.feng@intel.com>
>---
> BaseTools/Source/Python/GenFds/GenFdsGlobalVariable.py | 3 ++-
> 1 file changed, 2 insertions(+), 1 deletion(-)
>
>diff --git a/BaseTools/Source/Python/GenFds/GenFdsGlobalVariable.py
>b/BaseTools/Source/Python/GenFds/GenFdsGlobalVariable.py
>index 4d8b2bdee299..bd97aa9dd208 100644
>--- a/BaseTools/Source/Python/GenFds/GenFdsGlobalVariable.py
>+++ b/BaseTools/Source/Python/GenFds/GenFdsGlobalVariable.py
>@@ -11,10 +11,11 @@
> #
> from __future__ import print_function
> from __future__ import absolute_import
>
> import Common.LongFilePathOs as os
>+import sys
> from sys import stdout
> from subprocess import PIPE,Popen
> from struct import Struct
> from array import array
>
>@@ -484,11 +485,11 @@ class GenFdsGlobalVariable:
>             Cmd += ("-o", Output)
>             Cmd += Input
>
>             SaveFileOnChange(CommandFile, ' '.join(Cmd), False)
>             if IsMakefile:
>-                if GlobalData.gGlobalDefines.get("FAMILY") == "MSFT":
>+                if sys.platform == "win32":
>                     Cmd = ['if', 'exist', Input[0]] + Cmd
>                 else:
>                     Cmd = ['-test', '-e', Input[0], "&&"] + Cmd
>                 if ' '.join(Cmd).strip() not in GenFdsGlobalVariable.SecCmdList:
>                     GenFdsGlobalVariable.SecCmdList.append(' 
>'.join(Cmd).strip())
>--
>2.20.1.windows.1


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

end of thread, other threads:[~2019-10-14  1:02 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-09-27  2:30 [Patch 1/1] BaseTools: Fix a bug of genffs command generation Bob Feng
2019-09-27 10:02 ` [edk2-devel] " Philippe Mathieu-Daudé
2019-09-29  1:16 ` Liming Gao
2019-10-12  6:03 ` Liming Gao
2019-10-14  1:02   ` Bob Feng

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