无法在FreeBSD上构建Swift - REPL错误


1

我试图使用官方构建脚本在FreeBSD 10.2上安装Swift 3,但我无法这样做。

我收到以下错误:

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用户邮件列表中的开放票,但都无济于事。有没有人有办法解决吗?

Answers:


2

你是用叉子建造的,而不是Apple的回购。

内容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的editline 确实有广泛的字符入口点。所以你必须包括它。

更改

#if defined(__APPLE__)

#if defined(__APPLE__) || defined(__FreeBSD__)

就像在Apple回购中一样。这应该解决一个编译问题。但可能会有更多。

您可能想尝试构建官方仓库,尽管它没有将FreeBSD列为受支持的操作系统。您使用的分支在近一年内未被修改。

FreeBSD ports集合包含swift 2.2.1。如果您没有特别需要swift 3,我建议您使用它。

By using our site, you acknowledge that you have read and understand our Cookie Policy and Privacy Policy.
Licensed under cc by-sa 3.0 with attribution required.