今天在Windows平台 如下用MinGW(5.2.0)编译openssl的时候
$ conan install openssl/1.1.1m@ -s compiler=gcc -s compiler.version=5.2 --build missing
报错了:
pkgconf/1.7.4: Applying build-requirement: ninja/1.10.2
Downloading conan_sources.tgz
pkgconf/1.7.4: Configuring sources in C:\Users\10km\.conan\data\pkgconf\1.7.4\_\_\source
pkgconf/1.7.4: Copying sources to build folder
pkgconf/1.7.4: Building your package in C:\Users\10km\.conan\data\pkgconf\1.7.4\_\_\build\fe620a9df344885a61c065d47599eec0b8b41c32
pkgconf/1.7.4: Generator txt created conanbuildinfo.txt
pkgconf/1.7.4: Aggregating env generators
pkgconf/1.7.4: Calling build()
Traceback (most recent call last):
File "C:\Users\10km\.conan\data\meson\0.60.2\_\_\package\5ab84d6acfe1f23c4fae0ab88f26e3a396351ac9\bin\/meson.py", line 26, in <module>
from mesonbuild import mesonmain
File "D:\Users\10km\.conan\data\meson\0.60.2\_\_\package\5ab84d6acfe1f23c4fae0ab88f26e3a396351ac9\bin\mesonbuild\mesonmain.py", line 174
mlog.error(f'Error in {script_name} helper script:')
^
SyntaxError: invalid syntax
pkgconf/1.7.4:
openssl/1.1.1m: WARN: Package binary is corrupted, removing: fe620a9df344885a61c065d47599eec0b8b41c32
openssl/1.1.1m: WARN: Build folder is dirty, removing it: C:\Users\10km\.conan\data\openssl\1.1.1m\_\_\build\fe620a9df344885a61c065d47599eec0b8b41c32
pkgconf/1.7.4: ERROR: Package 'fe620a9df344885a61c065d47599eec0b8b41c32' build failed
pkgconf/1.7.4: WARN: Build folder C:\Users\10km\.conan\data\pkgconf\1.7.4\_\_\build\fe620a9df344885a61c065d47599eec0b8b41c32
ERROR: pkgconf/1.7.4: Error in build() method, line 90
meson = self._configure_meson()
while calling '_configure_meson', line 74
self._meson.configure(source_folder=self._source_subfolder, build_folder=self._build_subfolder)
ConanException: Error 1 while executing meson "C:\Users\10km\.conan\data\pkgconf\1.7.4\_\_\build\fe620a9df344885a61c065d47599eec0b8b41c32\source_subfolder" "C:\Users\10km\.conan\data\pkgconf\1.7.4\_\_\build\fe620a9df344885a61c065d47599eec0b8b41c32\build_subfolder" --backend=ninja -Dprefix="C:\Users\10km\.conan\data\pkgconf\1.7.4\_\_\package\fe620a9df344885a61c065d47599eec0b8b41c32" -Dlibdir="lib" -Dbindir="bin" -Dsbindir="bin" -Dlibexecdir="bin" -Dincludedir="include" -Ddefault_library="static" -Dtests="False" -Dsharedstatedir="C:\Users\10km\.conan\data\pkgconf\1.7.4\_\_\package\fe620a9df344885a61c065d47599eec0b8b41c32\bin\share" --buildtype=release
显然,在meson的pythone脚本mesonmain.py中这一行有语法错误
mlog.error(f'Error in {script_name} helper script:')
怎么会有语法错误呢?我对python并不精通,问了熟悉python的同事,才知道上面这个语法,在python3.7以后才支持,而我当前的python版本是3.4,果然升级python到最新版本再试,问题解决。