edk 环境配置
1,进入到/Users/limuhuazhi/edkII/BaseTools目录,执行make命令
2,FAIL: test_FMMT_FMMT (CheckPythonSyntax.Tests)
----------------------------------------------------------------------
Traceback (most recent call last):
File "/Users/limuhuazhi/edkII/BaseTools/Tests/CheckPythonSyntax.py", line 49, in <lambda>
newmethod = lambda self: self.SingleFileTest(filename)
File "/Users/limuhuazhi/edkII/BaseTools/Tests/CheckPythonSyntax.py", line 27, in SingleFileTest
self.fail('syntax error: %s, Error is %s' % (filename, str(e)))
AssertionError: syntax error: /Users/limuhuazhi/edkII/BaseTools/Source/Python/FMMT/FMMT.py, Error is File "/Users/limuhuazhi/edkII/BaseTools/Source/Python/FMMT/FMMT.py", line 48
def __init__(self) -> None:
^
SyntaxError: invalid syntax
======================================================================
FAIL: test_FMMT_core_BinaryFactoryProduct (CheckPythonSyntax.Tests)
----------------------------------------------------------------------
Traceback (most recent call last):
File "/Users/limuhuazhi/edkII/BaseTools/Tests/CheckPythonSyntax.py", line 49, in <lambda>
newmethod = lambda self: self.SingleFileTest(filename)
File "/Users/limuhuazhi/edkII/BaseTools/Tests/CheckPythonSyntax.py", line 27, in SingleFileTest
self.fail('syntax error: %s, Error is %s' % (filename, str(e)))
AssertionError: syntax error: /Users/limuhuazhi/edkII/BaseTools/Source/Python/FMMT/core/BinaryFactoryProduct.py, Error is File "/Users/limuhuazhi/edkII/BaseTools/Source/Python/FMMT/core/BinaryFactoryProduct.py", line 34
type:list = []
^
SyntaxError: invalid syntax
python 语法报错
原因是python 版本不对 ,应该使用python3,但使用设备里python指向了python2,重定向软连接到python3,然后工程根目录执行source ./edksetup.sh 将正确的python版本设置到工作环境变量
到BaseTools目录
先清理掉之前的编译 执行make clean
执行make,编译就好了
到根目录下运行
source edksetup.sh 时发现EDK_TOOLS_PATH 变量和之前的一样,如果是工程移动的话,工程会有问题,检查环境构建脚本是在/Users/limuhuazhi/edkII/BaseTools中的BuildEnv文件中的标红的这几行,这几行会检查设备的环境变量是否存在$EDK_TOOLS_PATH,如果存在就不更新了,我们注掉这几行,每次构建环境的时候都进行重新配置,就没有问题了
注意:edksetup.sh 可以有—reconfig 选择,这个是工程配置,不是环境配置
SetEdkToolsPath() {
94 echo set EDK_TOOLS_PATH
95 #
96 # If EDK_TOOLS_PATH is already set, then we can return right now
97 #
98 # if [ -n "$EDK_TOOLS_PATH" ]
99 # then
100 # return 0
101 #fi
102
103 #
104 # Try $CONF_PATH/EdkTools
105 #
106 if [ -e $CONF_PATH/EdkTools ]
107 then
108 export EDK_TOOLS_PATH=$CONF_PATH/EdkTools
109 return 0
110 fi
111
112 #
113 # Try $CONF_PATH/BaseToolsSource
114 #
115 if [ -e $CONF_PATH/BaseToolsSource ]
116 then
117 export EDK_TOOLS_PATH=$CONF_PATH/BaseToolsSource
118 return 0
119 fi
120
121 #
122 # Try $WORKSPACE/BaseTools
123 #
124 if [ -e $WORKSPACE/BaseTools ]
125 then
126 export EDK_TOOLS_PATH=$WORKSPACE/BaseTools
127 return 0
128 fi
129