-
Notifications
You must be signed in to change notification settings - Fork 2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[macOS] Darwin build patches #2820
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
utACK. Not tested at all, including on Mac.
This PR will go through several "try-commit" cycles in order for changes here to sequentially "unlock" further issues on the MacOS CI builder, making it progressively "less red" rather than immediately green 😄 @zkbot try |
⌛ Trying commit 4999cc4 with merge e19e88e4356b80d2b1d8e88f67b5fca33613542a... |
if test x$BUILD_OS = xdarwin; then | ||
# Xcode's ld (at least ld64-302.3) doesn't support -z | ||
AX_CHECK_LINK_FLAG([[-Wl,-z,relro]], [HARDENED_LDFLAGS="$HARDENED_LDFLAGS -Wl,-z,relro"],[AC_MSG_WARN(Cannot enable RELRO)]) | ||
AX_CHECK_LINK_FLAG([[-Wl,-z,now]], [HARDENED_LDFLAGS="$HARDENED_LDFLAGS -Wl,-z,now"],[AC_MSG_WARN(Cannot enable BIND_NOW)]) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added the security label because these changes need further investigation (perhaps in a separate issue though, if this is merged). It's currently necessary to not require these on Darwin (or clang will not build), but are there other flags we could try instead? Or are these flags maybe not present because they are not necessary? As a datapoint, Bitcoin Core does not require these flags.
☀️ Test successful - pr-try |
@zkbot try |
⌛ Trying commit 3363ceb with merge b118e1233f1f5d6df2c4609a9091aad60bef9003... |
☀️ Test successful - pr-try |
@zkbot try |
⌛ Trying commit 20d0d42 with merge 9b26bac6bb07f0bcc3192840a755517d20255533... |
☀️ Test successful - pr-try |
@zkbot try |
⌛ Trying commit 95dc0d4 with merge d403af4c827dafe35ba1b98e82f72ae1d94a1182... |
The next build error comes from a warning:
The corresponding zcash-apple patch disables the warning, which seems to be a common approach. But there may be a way to refactor this to avoid the warning. |
☀️ Test successful - pr-try |
@zkbot try |
⌛ Trying commit a3731f2 with merge 00cabf5a85c25c5938d7065279379a76f25d4cb7... |
☀️ Test successful - pr-try |
@zkbot try |
b9ad57b
to
7a84046
Compare
Rebased the branch to bring in the improved |
…iValue size_t is ambiguous for serialization, and UniValue doesn't have an API for handling this internally.
7a84046
to
b96f7d6
Compare
Force-pushed the final three commits to use @zkbot try |
⌛ Trying commit b96f7d6 with merge 1f8fcb515313a67c99d073fd1d06a1ad7e77a93b... |
💔 Test failed - pr-try |
The one failure was transient (ccache tripping up). All other supported builders passed, and the MacOS builder remains at the linker error. I am inclined to merge this as-is, handling the UniValue casts at their source rather than inside the UniValue code. |
I built and ran this on OSX High Sierra earlier this week. Just tried to build it again with --disable-libs flag passed resulting in the following error:
|
@braddmiller could you please try again with |
Command run: Result:
|
Per @braddmiller elsewhere, the version of clang used above was |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I just ran: ./build.sh --disable-rust --disable-libs -j1
with no issues.
Another reference point for CI worker update:
➜ src git:(darwin-build-patches) clang --version Apple LLVM version 9.0.0 (clang-900.0.39.2) Target: x86_64-apple-darwin17.2.0 Thread model: posix InstalledDir: /Library/Developer/CommandLineTools/usr/bin
Tested ACK: (see above comment for details related to clang ver) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
utACK
@@ -825,10 +825,10 @@ UniValue AsyncRPCOperation_mergetoaddress::perform_joinsplit( | |||
UniValue arrInputMap(UniValue::VARR); | |||
UniValue arrOutputMap(UniValue::VARR); | |||
for (size_t i = 0; i < ZC_NUM_JS_INPUTS; i++) { | |||
arrInputMap.push_back(inputMap[i]); | |||
arrInputMap.push_back(static_cast<uint64_t>(inputMap[i])); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would mildly prefer the "extend UniValue to support size_t
" approach, but I don't object to these casts since we can clean it up later.
@@ -21,8 +21,38 @@ class MerklePath { | |||
|
|||
template <typename Stream, typename Operation> | |||
inline void SerializationOp(Stream& s, Operation ser_action, int nType, int nVersion) { | |||
READWRITE(authentication_path); | |||
READWRITE(index); | |||
std::vector<std::vector<unsigned char>> pathBytes; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What's the status of this: can this PR be merged as-is without #3107?
Alright, let's merge this, and address any subsequent MacOS issues in follow-up PRs. Thanks everyone! @zkbot r+ |
📌 Commit b96f7d6 has been approved by |
[macOS] Darwin build patches Part of #2246.
Part of #2246.