Near as I can tell, it seems like there are two ways to add include directives in Bazel. The first is to add elements to the "includes" property, and the second is to add include directives to the "copts" property. If I try adding absolute paths to the "includes" property however, I see an error like this:
in includes attribute of cc_library rule //:foo: ignoring invalid absolute path '/usr/local/include'
This is clearly a deliberate error, and rather than argue its merits, let's set it aside and instead try out our second option. My "copts" property looks like this:
copts = [
'-I/usr/local/include',
'-I/usr/local/opt/libressl/include',
]
Trying to build with things set this way gives the following error:
in cc_library rule //:foo: The include path '/usr/local/opt/libressl/include' references a path outside of the execution root.
Note the lack of a message concerning /usr/local/include. If I comment out only the libressl line, the build runs just fine, and I just get compiler errors:
src/foo.cpp:4:10: fatal error: 'openssl/bio.h' file not found
(this is all with Buck v2017.11.16.01 installed via homebrew on MacOS)
Since the treatment of absolute paths in "copts" is uneven, I can only conclude that there's a bug here. After some googling it sounds like this has been reported before, multiple times, but those tickets are all closed. So what's the status? Is this fixed already in a branch and simply not available in a release yet?
--
You received this message because you are subscribed to the Google Groups "bazel-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to bazel-discuss+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/bazel-discuss/fb5a69bf-d9cf-4c5d-bb1c-7c13816e4976%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.