在windows-latest
上的Github操作中,我使用以下命令调用脚本:
C:\msys64\msys2_shell.cmd -mingw64 -defterm -here -full-path -no-start -shell bash scripts/cibw_before_all_windows.sh
我不明白所有的标志是什么意思,所以可能是其中一个标志错了。cibw_before_all_windows.sh
脚本如下所示:
pacman -S --noconfirm --needed \
bison \
flex \
icu-devel \
swig
export CPPFLAGS="-I/c/msys2/usr/include ${CPPFLAGS}"
export LDFLAGS="-L/c/msys2/usr/lib ${LDFLAGS}"
export PATH="/c/msys2/usr/bin/:${PATH}"
export PKG_CONFIG_PATH="/c/msys2/usr/lib/pkgconfig:${PKG_CONFIG_PATH}"
cd hfst_src/
autoreconf -fvi
./configure --with-unicode-handler=icu
make
make check V=1 VERBOSE=1
make install
cd ..
python setup.py build_ext
该脚本在./configure --with-unicode-handler=icu
上失败,并显示以下输出:
...
checking for ld used by g++... C:/msys64/mingw64/x86_64-w64-mingw32/bin/ld.exe
checking if the linker (C:/msys64/mingw64/x86_64-w64-mingw32/bin/ld.exe) is GNU ld... yes
checking whether the g++ linker (C:/msys64/mingw64/x86_64-w64-mingw32/bin/ld.exe) supports shared libraries... yes
checking for g++ option to produce PIC... -DDLL_EXPORT -DPIC
checking if g++ PIC flag -DDLL_EXPORT -DPIC works... yes
checking if g++ static flag -static works... yes
checking if g++ supports -c -o file.o... yes
checking if g++ supports -c -o file.o... (cached) yes
checking whether the g++ linker (C:/msys64/mingw64/x86_64-w64-mingw32/bin/ld.exe) supports shared libraries... yes
checking dynamic linker characteristics... Win32 ld.exe
checking how to hardcode library paths into programs... immediate
checking for gawk... (cached) gawk
checking how to run the C preprocessor... gcc -E
checking for bison... bison -y
checking for flex... flex
checking for lex output file root... lex.yy
checking for lex library... none needed
checking for library containing yywrap... no
checking whether yytext is a pointer... yes
checking for getopts... false
checking for a Python interpreter with version >= 3.0... python
checking for python... /mingw64/bin/python
checking for python version... 3.8
checking for python platform... win32
checking for python script directory... ${prefix}/lib/python3.8/site-packages
checking for python extension module directory... ${exec_prefix}/lib/python3.8/site-packages
configure: WARNING: Building hfst successfully requires flex newer than 2.5.33 on some platforms. Unless you are building with pre-flex-generated sources, building will probably fail.
checking whether ln -s works... no, using cp -pR
checking whether make sets $(MAKE)... (cached) yes
checking for doxygen... no
checking for main in -ldl... no
checking for main in -lpthread... yes
checking for main in -lm... yes
checking for ncurses.h... no
checking for curses.h... no
checking for termcap.h... yes
checking for tgetent in -ltermcap... yes
checking for icu-config... /usr/bin/icu-config
checking for pkg-config... /mingw64/bin/pkg-config
### icu-config: Can't find /usr/lib/msys-icuuc68.dll - ICU prefix is wrong.
### Try the --prefix= option
### or --detect-prefix
### (If you want to disable this check, use the --noverify option)
### icu-config: Exitting.
expr: syntax error: unexpected argument '50'
configure: error: in `/d/a/hfst-python/hfst-python/hfst_src':
configure: error: --with-unicode-handler=icu requested but icu>=50 not found
See `config.log' for more details
Error: Command C:\msys64\msys2_shell.cmd -mingw64 -defterm -here -full-path -no-start -shell bash scripts/cibw_before_all_windows.sh failed with code 1. None
从输出中看,configure
似乎找不到我全新安装的flex
、bison
和icu
。如何让configure
查看来自pacman
的安装?有没有更好的方法来解决这个问题?
编辑
pacman
安装的版本是...
bison-3.7.4-1
flex-2.6.4-1
icu-devel-68.2-1
swig-4.0.2-1
我说它看不到我的flex
和bison
的原因是它抱怨configure: WARNING: Building hfst successfully requires flex newer than 2.5.33 on some platforms. Unless you are building with pre-flex-generated sources, building will probably fail.
。由于pacman的flex
版本是flex-2.6.4-1
,我假设configure在系统的其他地方找到了不同的版本。这让我怀疑它也没有找到任何其他依赖项的pacman
版本。
发布于 2021-03-06 08:46:37
将pacman
为这些包安装.pc
文件的位置添加到环境变量PKG_CONFIG_PATH
。
发布于 2021-03-06 15:13:46
从输出中可以看出,configure无法找到全新安装的flex、bison和icu。
不,这看起来一点也不像问题。configure
输出显示它看到了Flex、Bison和ICU:
正在检查野牛...bison -y正在检查flex...flex
..。
正在检查icu-config.../usr/bin/icu-config
诊断输出由来自icu-config
和configure
的消息组成
ICU -config:找不到/usr/lib/msys-icuuc68.dll -ICU前缀错误。请尝试使用-- ### =选项###或-- ### -prefix ### (如果您想禁用此检查,请使用--noverify选项)退出icu-config:退出。expr:语法错误:意外参数'50‘configure: error: in
/d/a/hfst-python/hfst-python/hfst\_src': configure: error: --with-unicode-handler=icu requested but icu>=50 not found See
config.log’有关更多详细信息
关键问题似乎是您的ICU安装损坏了,这将是您安装它的(pacman)包的问题。icu-config
程序应该属于该包,如果它找不到或无法识别其他包组件,那么它要么是完全损坏的,要么是与包的其余部分不匹配。在您的控制下更直接地针对msys2安装进行验证是值得的,但是假设您可以这样做,则应该将其作为打包错误提出。我猜这会被用于msys2项目。
configure
的诊断结果看起来像是icu-config
故障的后续结果,这本身可能不是问题。
如何配置才能从pacman查看安装?
它能看到它们。它们就是坏了(无论如何,icu-devel包是坏的)。
有没有更好的方法来解决这个问题?
我认为你的方法总体上是好的。我建议您在将其设置为GitHub操作之前,在本地msys2安装上进行测试。对于您目前面临的问题,一种可能的解决方法是向pacman询问每个包的特定已知良好版本,而不是让它选择最新的可用版本。因为这样做会使您的构建更具可重复性,所以您可能会认为这是对您的方法的改进。
或者,icu-config
输出提供了一些其他可能性,特别是将--detect-prefix
选项或--noverify
选项添加到icu-config
命令行。这将在configure
中完成,如果它真的解决了问题,那么它可能比等待通过msys2的进程解决问题要快得多(没有针对Msys2的问题;只是这些事情需要时间)。
https://stackoverflow.com/questions/66502556
复制相似问题