Cabal突然停止构建我的项目。自从上次成功构建以来,项目本身没有太大变化,我猜只安装了OS更新。
我在cabal v2-build
上得到的错误是:
Undefined symbols for architecture x86_64:
"_u_errorName_70", referenced from:
___hs_u_errorName in libHStxt-c-0.7.1.0-21406b30.a(text_icu.o)
"_ucnv_close_70", referenced from:
___hs_ucnv_close in libHStxt-c-0.7.1.0-21406b30.a(text_icu.o)
"_ucnv_fromUChars_70", referenced from:
___hs_ucnv_fromUChars in libHStxt-c-0.7.1.0-21406b30.a(text_icu.o)
"_ucnv_getMaxCharSize_70", referenced from:
___get_max_bytes_for_string in libHStxt-c-0.7.1.0-21406b30.a(text_icu.o)
"_ucnv_open_70", referenced from:
___hs_ucnv_open in libHStxt-c-0.7.1.0-21406b30.a(text_icu.o)
"_ucnv_setFallback_70", referenced from:
___hs_ucnv_setFallback in libHStxt-c-0.7.1.0-21406b30.a(text_icu.o)
"_ucnv_toUChars_70", referenced from:
___hs_ucnv_toUChars in libHStxt-c-0.7.1.0-21406b30.a(text_icu.o)
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
`gcc' failed in phase `Linker'. (Exit code: 1)
此外,cabal repl
也停止工作:
<command line>: dlopen(/Users/user/.cabal/store/ghc-8.10.7/lib/libHStxt-c-0.7.1.0-21406b30-ghc8.10.7.dylib, 0x0005): Library not loaded: '/usr/local/opt/icu4c/lib/libicuuc.70.dylib'
Referenced from: '/Users/user/.cabal/store/ghc-8.10.7/lib/libHStxt-c-0.7.1.0-21406b30-ghc8.10.7.dylib'
Reason: tried: '/usr/local/opt/icu4c/lib/libicuuc.70.dylib' (no such file), '/usr/local/lib/libicuuc.70.dylib' (no such file), '/usr/lib/libicuuc.70.dylib' (no such file), '/usr/local/Cellar/icu4c/71.1/lib/libicuuc.70.dylib' (no such file), '/usr/local/lib/libicuuc.70.dylib' (no such file), '/usr/lib/libicuuc.70.dylib' (no such file)
Error: cabal: repl failed for exe:appname from
appname-1.0.0
我正在使用ghc 8.10.7
、macOS Monterey 12.6.1和cabal --version
输出
cabal-install version 3.8.1.0
compiled using version 3.8.1.0 of the Cabal library
icu4c
的版本为71.1,使用brew
进行安装。
我怎样才能使项目再次成功编译?
1条答案
按热度按时间ar7v8xwq1#
看起来
text-icu
包是针对icu4u
版本70构建的,然后您的系统升级到了版本71。(即~/.cabal/store/ghc-<version>/
)。项目中cabal v2-build
的下一次运行将重新构建其所有依赖项,包括因系统升级而变得“陈旧”的软件包。请注意,删除存储可能会破坏已安装的可执行文件。