conan 编译 openssl要求python 3.7以上版本
今天在Windows平台 如下用MinGW(5.2.0)编译openssl的时候
代码语言:javascript复制$ conan install openssl/1.1.1m@ -s compiler=gcc -s compiler.version=5.2 --build missing
报错了:
代码语言:javascript复制pkgconf/1.7.4: Applying build-requirement: ninja/1.10.2
Downloading conan_sources.tgz
pkgconf/1.7.4: Configuring sources in C:Users10km.conandatapkgconf1.7.4__source
pkgconf/1.7.4: Copying sources to build folder
pkgconf/1.7.4: Building your package in C:Users10km.conandatapkgconf1.7.4__buildfe620a9df344885a61c065d47599eec0b8b41c32
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:Users10km.conandatameson .60.2__package5ab84d6acfe1f23c4fae0ab88f26e3a396351ac9bin/meson.py", line 26, in <module>
from mesonbuild import mesonmain
File "D:Users10km.conandatameson .60.2__package5ab84d6acfe1f23c4fae0ab88f26e3a396351ac9binmesonbuildmesonmain.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:Users10km.conandataopenssl1.1.1m__buildfe620a9df344885a61c065d47599eec0b8b41c32
pkgconf/1.7.4: ERROR: Package 'fe620a9df344885a61c065d47599eec0b8b41c32' build failed
pkgconf/1.7.4: WARN: Build folder C:Users10km.conandatapkgconf1.7.4__buildfe620a9df344885a61c065d47599eec0b8b41c32
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:Users10km.conandatapkgconf1.7.4__buildfe620a9df344885a61c065d47599eec0b8b41c32source_subfolder" "C:Users10km.conandatapkgconf1.7.4__buildfe620a9df344885a61c065d47599eec0b8b41c32build_subfolder" --backend=ninja -Dprefix="C:Users10km.conandatapkgconf1.7.4__packagefe620a9df344885a61c065d47599eec0b8b41c32" -Dlibdir="lib" -Dbindir="bin" -Dsbindir="bin" -Dlibexecdir="bin" -Dincludedir="include" -Ddefault_library="static" -Dtests="False" -Dsharedstatedir="C:Users10km.conandatapkgconf1.7.4__packagefe620a9df344885a61c065d47599eec0b8b41c32binshare" --buildtype=release
显然,在meson的pythone脚本mesonmain.py中这一行有语法错误
代码语言:javascript复制mlog.error(f'Error in {script_name} helper script:')
怎么会有语法错误呢?我对python并不精通,问了熟悉python的同事,才知道上面这个语法,在python3.7以后才支持,而我当前的python版本是3.4,果然升级python到最新版本再试,问题解决。