-
Notifications
You must be signed in to change notification settings - Fork 113
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
Get builds working on OSX #837
Conversation
@@ -42,6 +42,6 @@ enum Level { | |||
ERROR = 1; | |||
WARN = 2; | |||
INFO = 3; | |||
DEBUG = 4; | |||
DEBUGGING = 4; |
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.
Why the change?
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.
"This avoids clashes with C++ builds that use DEBUG as a preprocessor macro." (from the commit message)
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 can't really see the comments while reviewing, unless I review one by on. Am I just an idiot and didn't notice where they are displayed (when looking at all the changes for the PR)?
'--keep_going' | ||
) | ||
|
||
if [[ "${OSTYPE}" == "darwin"* ]]; then |
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 is the * doing? Some kind of matching all? My bash knowledge is failing me
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.
It matches anything starting with darwin
(e.g. my OSTYPE
is darwin19
).
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.
+1 Bash skills
//! host functions by the Oak Runtime; however, the Runtime is not available | ||
//! when compiling on the host platform. | ||
//! | ||
//! On some host platforms (e.g. `target_os = "linux"`), linking a library that |
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.
This is quite annoying :(
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.
Yep. It took a little bit of figuring out, so I thought a nice big comment would help for the future.
build:clang --cpu=k8 | ||
|
||
# Darwin's default compiler is clang, so no need for a crosstool | ||
build:darwin --config=clang-base |
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 think the advantage of specifying a "cross" compiler was that it will force a certain version of clang (the one we download) instead of the one available on the system. Not really a big problem, depends how much we want to control that.
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.
Having a known version would be nice, but the wrapper scripts in toolchain/
didn't seem to quite work for a MacOS build, and just falling back to the native toolchain was the easy way out.
I can revisit what was going wrong with --config=clang
but I might need your help with toolchain wrangling…
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.
LGTM, although //oak/server:wasm_node_test
fails on my machine.
exec ${PAGER:-/usr/bin/less} "$0" || exit 1
Executing tests from //oak/server:wasm_node_test
-----------------------------------------------------------------------------
[libprotobuf ERROR external/com_google_protobuf/src/google/protobuf/descriptor_database.cc:120] File already exists in database: google/protobuf/any.proto
[libprotobuf FATAL external/com_google_protobuf/src/google/protobuf/descriptor.cc:1356] CHECK failed: GeneratedDatabase()->Add(encoded_file_descriptor, size):
libc++abi.dylib: terminating with uncaught exception of type google::protobuf::FatalException: CHECK failed: GeneratedDatabase()->Add(encoded_file_descriptor, size):
external/bazel_tools/tools/test/test-setup.sh: line 310: 26462 Abort trap: 6 "${TEST_PATH}" "$@" 2>&1
Yeah, I didn't fix that because it was due for deletion in #801 – and has now been deleted. |
This avoids clashes with C++ builds that use DEBUG as a preprocessor macro.
The `readlink -f` path-canonicalization utility is not available on OS X by default.
In .bazelrc, separate common options for clang-based build from the options used to force an override of the host compiler to be clang.
This is only available on Bash versions >= 4.2, which is (in particular) not available by default on OS X.
Earlier versions of Bash give errors rather than coping with empty arrays, so check for no-arguments explicitly.
Checklist
cover any TODOs and/or unfinished work.
construction.