我正在尝试使用官方构建脚本但我无法这样做。
我收到以下错误:
fatal error: too many errors emitted, stopping now [-ferror-limit=]
20 errors generated.
ninja: build stopped: subcommand failed.
utils/build-script: fatal error: command terminated with a non-zero exit status 1, aborting
这是错误消息之前的文本:
/usr/local/swiftlang/swift/lib/Immediate/REPL.cpp:244:3: error: unknown type name 'HistoryW'; did you mean 'History'?
HistoryW *h;
^~~~~~~~
History
/usr/include/histedit.h:169:24: note: 'History' declared here
typedef struct history History;
^
/usr/local/swiftlang/swift/lib/Immediate/REPL.cpp:491:30: error: unknown type name 'LineInfoW'; did you mean 'LineInfo'?
bool isAtStartOfLine(const LineInfoW *line) {
^~~~~~~~~
LineInfo
/usr/include/histedit.h:64:3: note: 'LineInfo' declared here
} LineInfo;
^
/usr/local/swiftlang/swift/lib/Immediate/REPL.cpp:501:33: error: unknown type name 'LineInfoW'; did you mean 'LineInfo'?
bool lineLooksLikeLabel(const LineInfoW *line) {
^~~~~~~~~
LineInfo
/usr/include/histedit.h:64:3: note: 'LineInfo' declared here
} LineInfo;
^
/usr/local/swiftlang/swift/lib/Immediate/REPL.cpp:520:34: error: unknown type name 'LineInfoW'; did you mean 'LineInfo'?
bool lineLooksLikeSetter(const LineInfoW *line) {
^~~~~~~~~
LineInfo
/usr/include/histedit.h:64:3: note: 'LineInfo' declared here
} LineInfo;
^
/usr/local/swiftlang/swift/lib/Immediate/REPL.cpp:548:32: error: unknown type name 'LineInfoW'; did you mean 'LineInfo'?
bool lineLooksLikeCase(const LineInfoW *line) {
^~~~~~~~~
LineInfo
/usr/include/histedit.h:64:3: note: 'LineInfo' declared here
} LineInfo;
^
/usr/local/swiftlang/swift/lib/Immediate/REPL.cpp:277:9: error: use of undeclared identifier 'history_winit'; did you mean 'history_init'?
h = history_winit();
^~~~~~~~~~~~~
history_init
/usr/include/histedit.h:179:11: note: 'history_init' declared here
History * history_init(void);
^
/usr/local/swiftlang/swift/lib/Immediate/REPL.cpp:279:5: error: use of undeclared identifier 'el_wset'
el_wset(e, EL_EDITOR, L"emacs");
^
/usr/local/swiftlang/swift/lib/Immediate/REPL.cpp:280:5: error: use of undeclared identifier 'el_wset'
el_wset(e, EL_PROMPT_ESC, PromptFn, LITERAL_MODE_CHAR);
^
/usr/local/swiftlang/swift/lib/Immediate/REPL.cpp:281:5: error: use of undeclared identifier 'el_wset'
el_wset(e, EL_CLIENTDATA, (void*)this);
^
/usr/local/swiftlang/swift/lib/Immediate/REPL.cpp:282:5: error: use of undeclared identifier 'el_wset'
el_wset(e, EL_HIST, history, h);
^
/usr/local/swiftlang/swift/lib/Immediate/REPL.cpp:283:5: error: use of undeclared identifier 'el_wset'
el_wset(e, EL_SIGNAL, 1);
^
/usr/local/swiftlang/swift/lib/Immediate/REPL.cpp:284:5: error: use of undeclared identifier 'el_wset'
el_wset(e, EL_GETCFN, GetCharFn);
^
/usr/local/swiftlang/swift/lib/Immediate/REPL.cpp:287:5: error: use of undeclared identifier 'el_wset'
el_wset(e, EL_ADDFN, L"swift-close-brace", L"Reduce {} indentation level",
^
/usr/local/swiftlang/swift/lib/Immediate/REPL.cpp:289:5: error: use of undeclared identifier 'el_wset'
el_wset(e, EL_BIND, L"}", L"swift-close-brace", nullptr);
^
/usr/local/swiftlang/swift/lib/Immediate/REPL.cpp:291:5: error: use of undeclared identifier 'el_wset'
el_wset(e, EL_ADDFN, L"swift-colon", L"Reduce label indentation level",
^
/usr/local/swiftlang/swift/lib/Immediate/REPL.cpp:293:5: error: use of undeclared identifier 'el_wset'
el_wset(e, EL_BIND, L":", L"swift-colon", nullptr);
^
/usr/local/swiftlang/swift/lib/Immediate/REPL.cpp:296:5: error: use of undeclared identifier 'el_wset'
el_wset(e, EL_ADDFN, L"swift-indent-or-complete",
^
/usr/local/swiftlang/swift/lib/Immediate/REPL.cpp:299:5: error: use of undeclared identifier 'el_wset'
el_wset(e, EL_BIND, L"\t", L"swift-indent-or-complete", nullptr);
^
/usr/local/swiftlang/swift/lib/Immediate/REPL.cpp:301:5: error: use of undeclared identifier 'el_wset'
el_wset(e, EL_ADDFN, L"swift-complete",
我已在 Jinja、Github 和 Swift 用户邮件列表中查找未解决的票证,但均无济于事。有人有解决方案吗?
答案1
您正在构建叉,不是 Apple repo。
看着那(这内容的REPL.cpp
:
#if defined(__APPLE__)
// FIXME: Support REPL on non-Apple platforms. Ubuntu 14.10's editline does not
// include the wide character entry points needed by the REPL yet.
#include <histedit.h>
#endif // __APPLE__
FreeBSD 的编辑行做有宽字符入口点。所以你必须把它包括进去。
改变
#if defined(__APPLE__)
到
#if defined(__APPLE__) || defined(__FreeBSD__)
就像在苹果仓库。这应该可以修复一个编译问题。但可能还有很多问题。
您可能想尝试构建官方 repo,尽管它没有将 FreeBSD 列为受支持的操作系统。您使用的分支近一年没有修改过。
FreeBSD ports collection 包含swift 2.2.1
。如果你不是特别需要swift 3
,我建议你使用它。