Open pkova opened 1 year ago
I suspect this is because we're erroneously using #include <>
instead of #include ""
for when referring to header files from some of the dependencies we're building ourselves. Can you switch to i/131/macos-build, which fixes #include
issue I just mentioned, and try again?
That got me further, ran into this issue next:
ERROR: /private/var/tmp/_bazel_pkova/7da81147f29e30d81d8599eb0dba1610/external/h2o/BUILD.bazel:243:11: Compiling lib/core/util.c failed: undeclared inclusion(s) in rule '@h2o//:h2o':
this rule is missing dependency declarations for the following files included by 'lib/core/util.c':
'/usr/local/include/uv.h'
'/usr/local/include/uv/errno.h'
'/usr/local/include/uv/version.h'
'/usr/local/include/uv/unix.h'
'/usr/local/include/uv/threadpool.h'
'/usr/local/include/uv/darwin.h'
Target //pkg/vere:urbit failed to build
Note that trying to build from i/131/macos-build without my fix to pkg/ent/ent.c
will fail with the same error as in the original issue.
@pkova I think the h2o is using #include <>
for some of the dependencies we're building ourselves, namely libuv, openssl, and curl. I updated the h2o patch to use #include ""
instead, which should pick up the versions of those dependencies we're building. I also included the macOS #include <sys/random.h>
fix you linked to above. Can you pull and try again?
Now I'm running into this one. No permutation of double quotes or < > seems to do the trick either.
ERROR: /Users/pkova/Desktop/vere/pkg/urcrypt/BUILD.bazel:5:11: Compiling pkg/urcrypt/argon.c failed: undeclared inclusion(s) in rule '//pkg/urcrypt:urcrypt':
this rule is missing dependency declarations for the following files included by 'pkg/urcrypt/argon.c':
'/usr/local/include/blake2.h'
Can you try installing clang
with brew
and running with the brew
-installed clang
toolchain:
$ brew install clang
$ bazel build --clang_version="14.0.6" --extra_toolchains=//bazel/toolchain:brew-clang-macos-x86_64-toolchain :urbit
We ran into a similar issue on the macos-x86_64
CI runners, and using the brew
-installed clang
toolchain worked in that case. Also note you can put the extra options in .user.bazelrc
to avoid typing them every time i.e. the above bazel build
command is equivalent to:
$ echo 'build --clang_version=14.0.6' >> .user.bazelrc
$ echo 'build --extra_toolchains=//bazel/toolchain/brew-clang-macos-x86_64-toolchain' >> .user.bazelrc
# From now on, you can simply type `bazel build :urbit`.
$ bazel build :urbit
No dice. After trying an ungodly amount of permutations of clang versions and messing with sys_includes
for brew-clang-macos-x86_64-config
in /bazel/toolchain/BUILD.bazel
the best I've been able to do is have it compile 736/739 steps and then seemingly infinitely loop on compiling /pkg/noun/allocate.c
.
That sounds like https://github.com/urbit/urbit/issues/5561. Try commenting out build --copt='-g'
in .bazelrc. If that doesn't work, maybe try adjusting the optimization level via --copt
i.e. --copt='-O2'
.
Thank god, I was about to end it all. I made #147 with my changes.
It turns out the system-provided clang
on macos-x86_64
has /usr/local/include
in its set of include paths, whereas the system-provided clang
on macos-aarch64
does not. You can confirm this by running clang -v -x c - -v /dev/null
on both platforms. @pkova, your change to include /usr/local/include
turned out to be correct. I'm going to put up a new PR, which includes a few other changes to the macOS toolchains' include paths (to ensure parity with the output of clang -v -x c - -v /dev/null
).
OS version: 12.6.2 (21G320)
Tried the steps in the guide at INSTALL.md, also tried the solutions in #119.
The first error I encountered is below. Some quick googling brought me to this. The fix was importing
unistd.h
before this line inpkg/ent/ent.c
. https://github.com/urbit/vere/blob/98cbc349cf93058d9f3da2a84791ed4e8167b0ec/pkg/ent/ent.c#L15After
bazel clean --expunge
and trying again with this fix I run up against errors like this:I can fix each of these by manually copying in the correct header file but that takes forever and is obviously incorrect.