Re: [edk2] [Patch] BaseTools: Remove the step to freeze python tool

2018-10-17 Thread Zhu, Yonghong
Reviewed-by: Yonghong Zhu  

Best Regards,
Zhu Yonghong

-Original Message-
From: Gao, Liming 
Sent: Tuesday, October 16, 2018 11:09 PM
To: edk2-devel@lists.01.org
Cc: Zhu, Yonghong 
Subject: [Patch] BaseTools: Remove the step to freeze python tool

https://bugzilla.tianocore.org/show_bug.cgi?id=1257
Binary python tool is not supported anymore. So, the freeze python tool step is 
not required.

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Liming Gao 
Cc: Yonghong Zhu 
---
 BaseTools/BuildNotes.txt  |   3 +-
 BaseTools/Makefile|   4 +-
 BaseTools/ReadMe.txt  |   1 -
 BaseTools/Scripts/ShowEnvironment.bat |   1 -
 BaseTools/Source/Python/Makefile  | 315 --
 BaseTools/Source/Python/UPT/Makefile  |  41 -
 BaseTools/toolsetup.bat   |  36 +---
 7 files changed, 4 insertions(+), 397 deletions(-)  delete mode 100644 
BaseTools/Source/Python/UPT/Makefile

diff --git a/BaseTools/BuildNotes.txt b/BaseTools/BuildNotes.txt index 
0d77df0..e2b10fd 100644
--- a/BaseTools/BuildNotes.txt
+++ b/BaseTools/BuildNotes.txt
@@ -13,8 +13,7 @@ Quick Start
 ---
 
 Windows:
-  a) Set the PYTHON_FREEZER_PATH to the cx_Freeze installation directory
-  b) Go to the /BaseTools and run "toolsetup" script
+  a) Go to the /BaseTools and run "toolsetup" 
+ script
 
 Unix-like:
   a) make -C /BaseTools diff --git a/BaseTools/Makefile 
b/BaseTools/Makefile index b98cd85..e6932c7 100644
--- a/BaseTools/Makefile
+++ b/BaseTools/Makefile
@@ -17,13 +17,11 @@
 
 SUBDIRS = $(BASE_TOOLS_PATH)\Source\C $(BASE_TOOLS_PATH)\Source\Python
 
-all: c python
+all: c
 
 c :
   @$(PYTHON_HOME)\python.exe 
$(BASE_TOOLS_PATH)\Source\C\Makefiles\NmakeSubdirs.py  all 
$(BASE_TOOLS_PATH)\Source\C
 
-python:
-  @$(PYTHON_HOME)\python.exe 
$(BASE_TOOLS_PATH)\Source\C\Makefiles\NmakeSubdirs.py  all 
$(BASE_TOOLS_PATH)\Source\Python
 
 subdirs: $(SUBDIRS)
   @$(PYTHON_HOME)\python.exe 
$(BASE_TOOLS_PATH)\Source\C\Makefiles\NmakeSubdirs.py  all $** diff --git 
a/BaseTools/ReadMe.txt b/BaseTools/ReadMe.txt index db632f7..7d0486b 100644
--- a/BaseTools/ReadMe.txt
+++ b/BaseTools/ReadMe.txt
@@ -16,7 +16,6 @@ In addition to this, you should set the following environment 
variables:
  * EDK_TOOLS_PATH - Path to the BaseTools sub directory under the edk2 tree
  * BASE_TOOLS_PATH - The directory where the BaseTools source is located.
(It is the same directory where this README.txt is located.)
- * PYTHON_FREEZER_PATH - Path to where the python freezer tool is installed
 
 After this, you can run the toolsetup.bat file, which is in the same  
directory as this file.  It should setup the remainder of the environment, diff 
--git a/BaseTools/Scripts/ShowEnvironment.bat 
b/BaseTools/Scripts/ShowEnvironment.bat
index 5dd30b4..759a74d 100755
--- a/BaseTools/Scripts/ShowEnvironment.bat
+++ b/BaseTools/Scripts/ShowEnvironment.bat
@@ -52,7 +52,6 @@ if defined SRC_CONF @goto SetEnv
 @if not defined EDK_TOOLS_PATH @echo EDK_TOOLS_PATH   = Not Set
 @if defined BASE_TOOLS_PATH @echo BASE_TOOLS_PATH  = %BASE_TOOLS_PATH%
 @if defined EDK_TOOLS_BIN @echo EDK_TOOLS_BIN= %EDK_TOOLS_BIN%
-@if defined PYTHON_FREEZER_PATH @echo PYTHON_FREEZER_PATH  = 
%PYTHON_FREEZER_PATH%
 @if "%NT32PKG%"=="TRUE" (
 @echo.
 @echo NOTE: Please configure your build to use the following 
TOOL_CHAIN_TAG diff --git a/BaseTools/Source/Python/Makefile 
b/BaseTools/Source/Python/Makefile
index ac99259..b413d23 100644
--- a/BaseTools/Source/Python/Makefile
+++ b/BaseTools/Source/Python/Makefile
@@ -11,324 +11,9 @@
 # WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
 #
 
-!IFNDEF PYTHON_HOME
-!ERROR PYTHON_HOME must be defined!
-!ENDIF
-
-!IFDEF PYTHON_FREEZER_PATH
-!IF EXIST ($(PYTHON_FREEZER_PATH)\cxfreeze) -# Using cx_Freeze 4.2.3 with 
Python 2.7.2 -FREEZE=$(PYTHON_HOME)\python $(PYTHON_FREEZER_PATH)\cxfreeze 
-!ELSE -!ERROR PYTHON_FREEZER_PATH does not exist!
-!ENDIF
-!ENDIF
-
-MODULES=encodings.cp437,encodings.gbk,encodings.utf_16,encodings.utf_8,encodings.utf_16_le,encodings.latin_1,encodings.ascii
-
-# DOS del command doesn't support ":\\" in the file path, such as 
j:\\BaseTools. Convert ":\\" to ":\"
-BASE_TOOLS_PATH = $(BASE_TOOLS_PATH::\\=:\) -EDK_TOOLS_PATH  = 
$(EDK_TOOLS_PATH::\\=:\)
-
-BIN_DIR=$(EDK_TOOLS_PATH)\Bin\Win32
-
-APPLICATIONS=$(BIN_DIR)\build.exe $(BIN_DIR)\GenFds.exe $(BIN_DIR)\Trim.exe 
$(BIN_DIR)\TargetTool.exe $(BIN_DIR)\GenDepex.exe 
$(BIN_DIR)\GenPatchPcdTable.exe $(BIN_DIR)\PatchPcdValue.exe 
$(BIN_DIR)\BPDG.exe $(BIN_DIR)\UPT.exe $(BIN_DIR)\Rsa2048Sha256Sign.exe 
$(BIN_DIR)\Rsa2048Sha256GenerateKeys.exe $(BIN_DIR)\Pkcs7Sign.exe 
$(BIN_DIR)\Ecc.exe
-
-COMMON_PYTHON=$(BASE_TOOLS_PATH)\Source\Python\Common\BuildToolError.py \
-  $(BASE_TOOLS_PATH)\Source\Python\Common\Database.py \
-  $(BASE_TOOLS_PATH)\Source\Python\Common\DataType.py \
-  $(B

[edk2] [Patch] BaseTools: Remove the step to freeze python tool

2018-10-16 Thread Liming Gao
https://bugzilla.tianocore.org/show_bug.cgi?id=1257
Binary python tool is not supported anymore. So, the freeze python tool
step is not required.

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Liming Gao 
Cc: Yonghong Zhu 
---
 BaseTools/BuildNotes.txt  |   3 +-
 BaseTools/Makefile|   4 +-
 BaseTools/ReadMe.txt  |   1 -
 BaseTools/Scripts/ShowEnvironment.bat |   1 -
 BaseTools/Source/Python/Makefile  | 315 --
 BaseTools/Source/Python/UPT/Makefile  |  41 -
 BaseTools/toolsetup.bat   |  36 +---
 7 files changed, 4 insertions(+), 397 deletions(-)
 delete mode 100644 BaseTools/Source/Python/UPT/Makefile

diff --git a/BaseTools/BuildNotes.txt b/BaseTools/BuildNotes.txt
index 0d77df0..e2b10fd 100644
--- a/BaseTools/BuildNotes.txt
+++ b/BaseTools/BuildNotes.txt
@@ -13,8 +13,7 @@ Quick Start
 ---
 
 Windows:
-  a) Set the PYTHON_FREEZER_PATH to the cx_Freeze installation directory
-  b) Go to the /BaseTools and run "toolsetup" script
+  a) Go to the /BaseTools and run "toolsetup" script
 
 Unix-like:
   a) make -C /BaseTools
diff --git a/BaseTools/Makefile b/BaseTools/Makefile
index b98cd85..e6932c7 100644
--- a/BaseTools/Makefile
+++ b/BaseTools/Makefile
@@ -17,13 +17,11 @@
 
 SUBDIRS = $(BASE_TOOLS_PATH)\Source\C $(BASE_TOOLS_PATH)\Source\Python
 
-all: c python
+all: c
 
 c :
   @$(PYTHON_HOME)\python.exe 
$(BASE_TOOLS_PATH)\Source\C\Makefiles\NmakeSubdirs.py  all 
$(BASE_TOOLS_PATH)\Source\C
 
-python:
-  @$(PYTHON_HOME)\python.exe 
$(BASE_TOOLS_PATH)\Source\C\Makefiles\NmakeSubdirs.py  all 
$(BASE_TOOLS_PATH)\Source\Python
 
 subdirs: $(SUBDIRS)
   @$(PYTHON_HOME)\python.exe 
$(BASE_TOOLS_PATH)\Source\C\Makefiles\NmakeSubdirs.py  all $**
diff --git a/BaseTools/ReadMe.txt b/BaseTools/ReadMe.txt
index db632f7..7d0486b 100644
--- a/BaseTools/ReadMe.txt
+++ b/BaseTools/ReadMe.txt
@@ -16,7 +16,6 @@ In addition to this, you should set the following environment 
variables:
  * EDK_TOOLS_PATH - Path to the BaseTools sub directory under the edk2 tree
  * BASE_TOOLS_PATH - The directory where the BaseTools source is located.
(It is the same directory where this README.txt is located.)
- * PYTHON_FREEZER_PATH - Path to where the python freezer tool is installed
 
 After this, you can run the toolsetup.bat file, which is in the same
 directory as this file.  It should setup the remainder of the environment,
diff --git a/BaseTools/Scripts/ShowEnvironment.bat 
b/BaseTools/Scripts/ShowEnvironment.bat
index 5dd30b4..759a74d 100755
--- a/BaseTools/Scripts/ShowEnvironment.bat
+++ b/BaseTools/Scripts/ShowEnvironment.bat
@@ -52,7 +52,6 @@ if defined SRC_CONF @goto SetEnv
 @if not defined EDK_TOOLS_PATH @echo EDK_TOOLS_PATH   = Not Set
 @if defined BASE_TOOLS_PATH @echo BASE_TOOLS_PATH  = %BASE_TOOLS_PATH%
 @if defined EDK_TOOLS_BIN @echo EDK_TOOLS_BIN= %EDK_TOOLS_BIN%
-@if defined PYTHON_FREEZER_PATH @echo PYTHON_FREEZER_PATH  = 
%PYTHON_FREEZER_PATH%
 @if "%NT32PKG%"=="TRUE" (
 @echo.
 @echo NOTE: Please configure your build to use the following TOOL_CHAIN_TAG
diff --git a/BaseTools/Source/Python/Makefile b/BaseTools/Source/Python/Makefile
index ac99259..b413d23 100644
--- a/BaseTools/Source/Python/Makefile
+++ b/BaseTools/Source/Python/Makefile
@@ -11,324 +11,9 @@
 # WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
 #
 
-!IFNDEF PYTHON_HOME
-!ERROR PYTHON_HOME must be defined!
-!ENDIF
-
-!IFDEF PYTHON_FREEZER_PATH
-!IF EXIST ($(PYTHON_FREEZER_PATH)\cxfreeze)
-# Using cx_Freeze 4.2.3 with Python 2.7.2
-FREEZE=$(PYTHON_HOME)\python $(PYTHON_FREEZER_PATH)\cxfreeze
-!ELSE
-!ERROR PYTHON_FREEZER_PATH does not exist!
-!ENDIF
-!ENDIF
-
-MODULES=encodings.cp437,encodings.gbk,encodings.utf_16,encodings.utf_8,encodings.utf_16_le,encodings.latin_1,encodings.ascii
-
-# DOS del command doesn't support ":\\" in the file path, such as 
j:\\BaseTools. Convert ":\\" to ":\"
-BASE_TOOLS_PATH = $(BASE_TOOLS_PATH::\\=:\)
-EDK_TOOLS_PATH  = $(EDK_TOOLS_PATH::\\=:\)
-
-BIN_DIR=$(EDK_TOOLS_PATH)\Bin\Win32
-
-APPLICATIONS=$(BIN_DIR)\build.exe $(BIN_DIR)\GenFds.exe $(BIN_DIR)\Trim.exe 
$(BIN_DIR)\TargetTool.exe $(BIN_DIR)\GenDepex.exe 
$(BIN_DIR)\GenPatchPcdTable.exe $(BIN_DIR)\PatchPcdValue.exe 
$(BIN_DIR)\BPDG.exe $(BIN_DIR)\UPT.exe $(BIN_DIR)\Rsa2048Sha256Sign.exe 
$(BIN_DIR)\Rsa2048Sha256GenerateKeys.exe $(BIN_DIR)\Pkcs7Sign.exe 
$(BIN_DIR)\Ecc.exe
-
-COMMON_PYTHON=$(BASE_TOOLS_PATH)\Source\Python\Common\BuildToolError.py \
-  $(BASE_TOOLS_PATH)\Source\Python\Common\Database.py \
-  $(BASE_TOOLS_PATH)\Source\Python\Common\DataType.py \
-  $(BASE_TOOLS_PATH)\Source\Python\Common\EdkLogger.py \
-  $(BASE_TOOLS_PATH)\Source\Python\Common\Expression.py \
-  $(BASE_TOOLS_PATH)\Source\Python\Common\GlobalData.py \
-  $(BASE_TOOLS_PATH)\Source\Python\Common\Identification.py \
-