vere icon indicating copy to clipboard operation
vere copied to clipboard

Unable to build on MacOs due to undeclared inclusions even with clang version specified

Open melodicht opened this issue 2 years ago • 6 comments

The following is what I have typed into my terminal, and I have included my clang --version output. https://pastebin.com/2Skf2PVa

The key error message is this:

ERROR: /Users/usr/Documents/jetting/vere/pkg/urcrypt/BUILD.bazel:7:13: 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'

I have tried building on both the develop and release branches, but the error messages are the same. Any help is appreciated. Thank you.

melodicht avatar Sep 27 '23 01:09 melodicht

@melodicht sorry for the delay. the bazel build is quite difficult to debug, but it looks to me like bazel is finding blake2.h in /usr/local/ instead of vendor'd in pkg/urcrypt/argon2, and then erroring out due to the missing dependency declaration?

I'd try moving/removing /usr/local/include/blake2.h and rebuilding. Failing that, I'd try bazel clean and the bazel build again, and see if you get a different error.

@matthew-levan any other ideas?

joemfb avatar Sep 28 '23 14:09 joemfb

Thank you for the response. I tried finding blake2.h, but I can't seem to find it at all, even after searching my entire computer. I do not have a usr directory, only a pkg directory. I have included the full content of the vere directory in this pastebin: https://pastebin.com/KWmid3RW

melodicht avatar Sep 28 '23 14:09 melodicht

@melodicht, this is a common issue with the Bazel build system as we use it in Vere (it happens with other "undeclared inclusions" too, like gmp.h for instance). Will you please paste the output of /usr/local/include? You probably need to run rm /usr/local/include/blake2.h or (if you want to simply backup the header file instead of removing it) mv /usr/local/include/blake2.h /usr/local/include/blake2.h.bak.

On Thu, Sep 28, 2023 at 10:41 AM melodicht @.***> wrote:

Thank you for the response. I tried finding blake2.h, but I can't seem to find it at all. I do not have a usr directory, only a pkg directory. I have included the full content of the vere directory in this pastebin: https://pastebin.com/KWmid3RW

— Reply to this email directly, view it on GitHub https://github.com/urbit/vere/issues/525#issuecomment-1739402871, or unsubscribe https://github.com/notifications/unsubscribe-auth/AV2DQRH62R6R2FMKUZH3FH3X4WECNANCNFSM6AAAAAA5ISZ2CM . You are receiving this because you were mentioned.Message ID: @.***>

matthew-levan avatar Sep 28 '23 15:09 matthew-levan

Thanks. By output, do you mean what's in it? Here's the pastebin: https://pastebin.com/QZ2Ty1qk

I added .bak to the back of all of the files that had the undeclared inclusion error, and now it builds completely. I have yet to test it out. The following are the list of files that I had to add .bak to:

  • blake2.h
  • gmp.h
  • uv.h
  • All of the .h files in the uv directory

melodicht avatar Sep 29 '23 00:09 melodicht

Ok, that's what I expected. Thanks for confirming. It's quite annoying to have to remove/rename system-level dependencies like this. I've spent some time trying to figure out how to get Vere to build despite having files like you mentioned in system paths, but haven't been able to crack it. Let's keep this issue open until we have a more acceptable solution (instead of having to remove/rename system headers).

On Thu, Sep 28, 2023 at 8:02 PM melodicht @.***> wrote:

Thanks. By output, do you mean what's in it? Here's the pastebin: https://pastebin.com/QZ2Ty1qk

I added .bak to the back of all of the files that had the undeclared inclusion error, and now it builds completely. I have yet to test it out. The following are the list of files that I had to add .bak to:

  • blake2.h
  • gmp.h
  • uv.h
  • All of the .h files in the uv directory

— Reply to this email directly, view it on GitHub https://github.com/urbit/vere/issues/525#issuecomment-1740140497, or unsubscribe https://github.com/notifications/unsubscribe-auth/AV2DQRECQZYNI2YNDWCGYNDX4YF3FANCNFSM6AAAAAA5ISZ2CM . You are receiving this because you were mentioned.Message ID: @.***>

matthew-levan avatar Sep 29 '23 13:09 matthew-levan

I found a way to force Bazel to specifically look for these headers in our local build directories instead of the system directories: instead of #include "blake2.h" it would be #include "blake2/blake2.h".

It's not too pretty but I'm open to the change since it'd ease my pain as I run into the same issue you described in the original post, but with urcrypt.

cc @joemfb

matthew-levan avatar Oct 13 '23 16:10 matthew-levan