Giter Site home page Giter Site logo

rules_boost's Introduction

rules_boost -- Bazel build rules for Boost

Copy this into your Bazel MODULE.bazel file to add this repo as an external dependency, making sure to update to the latest commit per the instructions below.

# Boost
# Famous C++ library that has given rise to many new additions to the C++ Standard Library
# Makes @boost available for use: For example, add `@boost//:algorithm` to your deps.
# For more, see https://github.com/nelhage/rules_boost and https://www.boost.org
bazel_dep(name = "rules_boost", repo_name = "com_github_nelhage_rules_boost")
archive_override(
    module_name = "rules_boost",
    urls = "https://github.com/nelhage/rules_boost/archive/refs/heads/master.tar.gz",
    strip_prefix = "rules_boost-master",
    # It is recommended to edit the above URL and the below sha256 to point to a specific version of this repository.
    # integrity = "sha256-...",
)

non_module_boost_repositories = use_extension("@com_github_nelhage_rules_boost//:boost/repositories.bzl", "non_module_dependencies")
use_repo(
    non_module_boost_repositories,
    "boost",
)

You can now use libraries in deps through the @boost repository, for example @boost//:algorithm.

If you're using the Apple or Android-specific rules...

As with all platform-dependent C/C++ in Bazel, you'll need to use Bazel 7+ (and a similarly recent version of rules_apple) for per-platform configuration to work automatically out of the box. (Please file a PR to delete this section if Bazel 7 is now so old as to be standard.)

Suggestion: Updates

Improvements come frequently to the underlying libraries, including security patches, so we'd recommend keeping up-to-date.

We'd strongly recommend you set up Renovate (or similar) at some point to keep this dependency (and others) up-to-date by default. [We aren't affiliated with Renovate or anything, but we think it's awesome. It watches for new versions and sends you PRs for review or automated testing. It's free and easy to set up. It's been astoundingly useful in our codebase, and we've worked with the wonderful maintainer to make things great for Bazel use. And it's used in official Bazel repositories--and this one!]

If not now, maybe come back to this step later, or watch this repo for updates. [Or hey, maybe give us a quick star, while you're thinking about watching.] Like Abseil, we live at head; the latest commit to the main branch is the commit you want. So don't rely on release notifications; use Renovate or poll manually for new commits.

Configuration of Sub-Libraries

ASIO

SSL Support

These rules implement support for Boost ASIO's SSL support. To use ASIO-SSL, you must depend on the "@boost//:asio_ssl" target, instead of "@boost//:asio". ASIO-SSL depends on OpenSSL; By default, rules_boost will download and build the latest BoringSSL commit; To use a different OpenSSL implementation, create a remote named openssl before calling boost_deps. This remote must make available OpenSSL's libssl at @boringssl//:ssl.

io_uring support

To enable io_uring for asio, use --@boost//:asio_has_io_uring. Optionally, pass--@boost//:asio_disable_epoll to use io_uring for all operations.

Beast

Boost Beast uses beast::string_view for things like request/response headers, which by default is a type alias of boost::string_view. If you're using a C++17 compiler that supports std::string_view you can use --@boost//:beast_use_std_string_view to make beast::string_view instead be a type alias of std::string_view.


Based in part on rules from https://github.com/mzhaom/trunk.

rules_boost's People

Contributors

akovachev avatar an-to-nio avatar andrewrademacher avatar asa avatar benjaminp avatar cpsauer avatar dprogm avatar drigz avatar eklitzke avatar finn-ball avatar garymm avatar gjasny avatar hackattack avatar henryymliu avatar kamalmarhubi avatar mapx avatar markusteufelberger avatar nelhage avatar per-gron avatar philwo avatar renovate[bot] avatar richardcochrankodiak avatar russelltg avatar sschnug avatar storypku avatar thebutlah avatar vertexwahn avatar wesleyw72 avatar wijagels avatar zacvawterkodiak avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

rules_boost's Issues

boost/implicit_cast.h is not included in any package

Hi,

I tried to include boost/implicit_cast.hpp file but the file is not included in any package.

external/folly/folly/Conv.h:38:10: fatal error: boost/implicit_cast.hpp: No such file or directory
 #include <boost/implicit_cast.hpp>

Adding this simple code to BUILD.boost will make the header exposed.

boost_library(
    name = "implicit_cast"
)

Problem compiling boost with current master branch

Hey,
I have been getting errors trying to get this to compile. I have deviated from the README.md slightly (as it was well out of date!) and have this in my WORKSPACE file:

http_archive(
    name = "com_github_nelhage_boost",
    strip_prefix = "rules_boost-master",
    type = "tar.gz",
    urls = [
        "https://github.com/nelhage/rules_boost/archive/master.tar.gz"
    ],
)
load("@com_github_nelhage_boost//:boost/boost.bzl", "boost_deps")
boost_deps()

but i'm getting this when trying to use @boost//:test as a deps:

ERROR: /private/var/tmp/_bazel_alex/2d57536a86fcea3046c07ff4838acca7/external/boost/BUILD.bazel:581:1: Linking of rule '@boost//:test' failed (Exit 1).
duplicate symbol _main in:
    bazel-out/local-fastbuild/bin/external/boost/_objs/test/external/boost/libs/test/src/cpp_main.pic.o
    bazel-out/local-fastbuild/bin/external/boost/_objs/test/external/boost/libs/test/src/unit_test_main.pic.o
ld: 1 duplicate symbol for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)

Not sure where to go with this. I'd looooove to get Boost working with Bazel but i'm a nube to both Bazel and C++. Anyone get this working recently?

Unable to use boost/log/utility/setup

When using boost log utility to setup a console log with format, linker reported an error:

function boost::shared_ptr<boost::log::v2s_mt_posix::sinks::synchronous_sink<boost::log::v2s_mt_posix::sinks::basic_text_ostream_backend<char> > > boost::log::v2s_mt_posix::aux::add_console_log<char, boost::parameter::aux::tagged_argument_list_of_1<boost::parameter::aux::tagged_argument<boost::log::v2s_mt_posix::keywords::tag::format, char const [1]> > >(std::basic_ostream<char, std::char_traits<char> >&, boost::parameter::aux::tagged_argument_list_of_1<boost::parameter::aux::tagged_argument<boost::log::v2s_mt_posix::keywords::tag::format, char const [1]> > const&): 
error: undefined reference to 'boost::log::v2s_mt_posix::basic_formatter<char> boost::log::v2s_mt_posix::parse_formatter<char>(char const*, char const*)'

Code to setup:

#include <boost/log/utility/setup/console.hpp>
boost::log::add_console_log(std::cout, boost::log::keywords::format = "");

Missing dependency for beast

Boost beast also depends on endian. Compiling without it gives this error:

ERROR: /Users/ryanburn/proj/ot-chat-example/BUILD:1:1: C++ compilation of rule '//:ot-chat' failed (Exit 1)
In file included from src/chat_session.cpp:1:
In file included from src/chat_session.h:7:
In file included from external/boost/boost/beast/websocket.hpp:18:
In file included from external/boost/boost/beast/websocket/stream.hpp:18:
external/boost/boost/beast/websocket/detail/frame.hpp:20:10: fatal error: 'boost/endian/buffers.hpp' file not found
#include <boost/endian/buffers.hpp>

Use BOOST_ASIO_SEPARATE_COMPILATION for Boost.Asio

Hi, I just wanted to suggest using BOOST_ASIO_SEPARATE_COMPILATION for Boost.Asio.

Most other heavyweight Boost libraries already require separate compilation, but Asio has left its default as header-only for convenience (so users don't have to deal with the complexity of compiling and linking to Boost). But given Bazel already takes care of that complexity, it seems better to compile the library separately and link to it.

To do this, you can just follow the instructions here, e.g.:

boost_library(
    name = "asio",
    srcs = [
        "boost/asio/impl/src.cpp",
        "boost/asio/impl/src.hpp",
    ],
    defines = [
        "BOOST_ASIO_SEPARATE_COMPILATION",
    ] + select({
    ...

(Also see the note about #include <boost/asio/ssl/impl/src.hpp> for SSL use. I'm not sure if that's best included in the same target or a separate one, if any.)

Thanks!

Missing declarations when building @boost//:container

When trying to build a piece of code that requires @boost//:asio I got an error that pointed to @boost//:container. So I tried to build that package and got the following error (built with -s to be verbose):

โžœ  source bazel build -s @boost//:container
(02:57:48) INFO: Current date is 2018-03-03
(02:57:48) INFO: Analysed target @boost//:container (0 packages loaded).
(02:57:48) INFO: Found 1 target...
(02:57:48) SUBCOMMAND: # @boost//:container [action 'Compiling external/boost/libs/container/src/dlmalloc_ext_2_8_6.c']
(cd /home/grefab/.cache/bazel/_bazel_grefab/625db2899dea4334ee02b1bf7e892565/execroot/__main__ && \
  exec env - \
    PWD=/proc/self/cwd \
  /usr/bin/clang -U_FORTIFY_SOURCE -fstack-protector -Wall -B/usr/bin -B/usr/bin -fcolor-diagnostics -fno-omit-frame-pointer -MD -MF bazel-out/k8-fastbuild/bin/external/boost/_objs/container/external/boost/libs/container/src/dlmalloc_ext_2_8_6.pic.d -fPIC -iquote external/boost -iquote bazel-out/k8-fastbuild/genfiles/external/boost -iquote external/bazel_tools -iquote bazel-out/k8-fastbuild/genfiles/external/bazel_tools -isystem external/boost -isystem bazel-out/k8-fastbuild/genfiles/external/boost -isystem external/boost/boost/container -isystem bazel-out/k8-fastbuild/genfiles/external/boost/boost/container -isystem external/boost/boost/config -isystem bazel-out/k8-fastbuild/genfiles/external/boost/boost/config -isystem external/boost/boost/version -isystem bazel-out/k8-fastbuild/genfiles/external/boost/boost/version -isystem external/bazel_tools/tools/cpp/gcc3 -isystem external/boost/boost/core -isystem bazel-out/k8-fastbuild/genfiles/external/boost/boost/core -isystem external/boost/boost/intrusive -isystem bazel-out/k8-fastbuild/genfiles/external/boost/boost/intrusive -isystem external/boost/boost/assert -isystem bazel-out/k8-fastbuild/genfiles/external/boost/boost/assert -isystem external/boost/boost/cstdint -isystem bazel-out/k8-fastbuild/genfiles/external/boost/boost/cstdint -isystem external/boost/boost/noncopyable -isystem bazel-out/k8-fastbuild/genfiles/external/boost/boost/noncopyable -isystem external/boost/boost/static_assert -isystem bazel-out/k8-fastbuild/genfiles/external/boost/boost/static_assert -isystem external/boost/boost/move -isystem bazel-out/k8-fastbuild/genfiles/external/boost/boost/move -isystem external/boost/boost/detail -isystem bazel-out/k8-fastbuild/genfiles/external/boost/boost/detail -isystem external/boost/boost/limits -isystem bazel-out/k8-fastbuild/genfiles/external/boost/boost/limits -Wno-unused-value -no-canonical-prefixes -Wno-builtin-macro-redefined '-D__DATE__="redacted"' '-D__TIMESTAMP__="redacted"' '-D__TIME__="redacted"' -c external/boost/libs/container/src/dlmalloc_ext_2_8_6.c -o bazel-out/k8-fastbuild/bin/external/boost/_objs/container/external/boost/libs/container/src/dlmalloc_ext_2_8_6.pic.o)
(02:57:48) ERROR: /home/grefab/.cache/bazel/_bazel_grefab/625db2899dea4334ee02b1bf7e892565/external/boost/BUILD.bazel:320:1: undeclared inclusion(s) in rule '@boost//:container':
this rule is missing dependency declarations for the following files included by 'external/boost/libs/container/src/dlmalloc_ext_2_8_6.c':
  '/usr/lib/clang/5.0.1/include/stddef.h'
  '/usr/lib/clang/5.0.1/include/__stddef_max_align_t.h'
  '/usr/lib/clang/5.0.1/include/limits.h'
external/boost/libs/container/src/dlmalloc_ext_2_8_6.c:1097:8: warning: variable 'ret' is used uninitialized whenever 'if' condition is false [-Wsometimes-uninitialized]
   if (!PREACTION(m)) {
       ^~~~~~~~~~~~~
external/boost/libs/container/src/dlmalloc_ext_2_8_6.c:1125:11: note: uninitialized use occurs here
   return ret;
          ^~~
external/boost/libs/container/src/dlmalloc_ext_2_8_6.c:1097:4: note: remove the 'if' if its condition is always true
   if (!PREACTION(m)) {
   ^~~~~~~~~~~~~~~~~~~
external/boost/libs/container/src/dlmalloc_ext_2_8_6.c:1095:4: note: variable 'ret' is declared here
   boost_cont_malloc_stats_t ret;
   ^
1 warning generated.
Target @boost//:container failed to build
Use --verbose_failures to see the command lines of failed build steps.
(02:57:48) INFO: Elapsed time: 0.482s, Critical Path: 0.24s
(02:57:48) FAILED: Build did NOT complete successfully

My setup is ubuntu 16.04 with clang 5.0.1, set via environment (no CROSSTOOL involved):

CC=/usr/bin/clang
CXX=/usr/bin/clang++

I updated rules_boost by updating the commit in WORKSPACE to the latest commit available as of today (the problem occurs in both commits):

git_repository(
    name = "com_github_nelhage_rules_boost",
#    commit = "239ce40e42ab0e3fe7ce84c2e9303ff8a277c41a",
    commit = "769c22fa72177314cd6fae505bd36116d6ed1f6b",
    remote = "https://github.com/nelhage/rules_boost",
)

load("@com_github_nelhage_rules_boost//:boost/boost.bzl", "boost_deps")
boost_deps()

These are the settings for compilation as configured in tools/bazel.rc:

build  --cxxopt='-std=c++14' --cxxopt='-O2' --cxxopt='-Wno-unknown-pragmas' --show_timestamps

Any idea what goes wrong? Is there a general way to declare these includes?

Possible to use boost git repos + commit hash instead of tarball?

Right now you seem to pull from your own mirror, which is not sustainable and a bit hard to keep up-to-date.

With git repos there might also be a chance to expose more than a single version of boost, by pinning various different commit hashes to different library versions.

unknown option '-std=c99'

Minor issue, but still would be nice to fix it: build.lzma has the line copts = ["-std=c99"], When build runs on Windows we get a ton of INFO messages about unknown option '-std=c99' Would it be possible to NOT apply this option on Windows? Is it even needed for Linux?

Building on Android by removing -lpthread

Thank you, @nelhage, for an amazingly helpful set of rules!

I'm writing to ask if you'd consider updating the rules so they could be built on Android (NDK). The only issue I'm seeing is that pthread isn't a separate library from libc on Android, so linking (w/ -lpthread) fails.

If we select out -lpthread on Android, I think that would do the trick. Protobuf/tensorflow dealt with a similar issue here. (However, I'm not sure their solution actually selects for the right thing in the current version of Bazel; the select doesn't seem to match, using the minimal NDK example from the bazel page as a test. This is all a bit of a mess pre Bazel platforms shipping--but I thought you might know better than I how to select robustly for Android. Since the {"crosstool_top": "//external:android/crosstool"} doesn't seem to work robustly, internally we're selecting on {"android_crosstool_top": "@androidndk//:default_crosstool"}, which is an alias of the default, and then pass it in with bazel build --android_crosstool_top=@androidndk//:default_crosstool ... when we're building for Android.)

-Chris

P.S. I just read a bit of your blog, and it put a big smile on my face :)

auto_link on Windows (MSVC)

On Windows, with MSVC compiler, the auto_link macros of Boost generate such directives:

#pragma comment(lib, "libboost_thread-vc140-mt-x64-1_67.lib")

into header files, such as boost/thread.hpp.

However, Bazel will build @boost//:thread into bazel-bin\external\boost\thread.lib (rather than bazel-bin\external\boost\libboost_thread-vc140-mt-x64-1_67.lib)

When I build a cc_binary that depends on, say @boost//:thread, it will fail to link:

LINK : fatal error LNK1104: cannot open file 'libboost_thread-vc140-mt-x64-1_67.lib'
Target //test-ui-app:win32 failed to build
INFO: Elapsed time: 2.819s, Critical Path: 0.20s
INFO: 0 processes.
FAILED: Build did NOT complete successfully

because that #pragma comment directive will cause link.exe to search for the non-existent libboost_thread-vc140-mt-x64-1_67.lib, even though Bazel will also pass the valid path of thread.lib to link.exe.

So, can we disable Boost auto_link on Windows, or workaround this somehow?

Rule does not exist for boost python

I believe the version of Boost built here includes Boost Python but there is no rule for it.

I would be happy to try this, but I'd need a mild amount of assistance as I just started playing with Bazel this weekend. I haven't figured out how to get Bazel to start building/testing stuff in this kind of structure yet (as opposed to one where all the rules are in the plain BUILD file).

Build fails with gcc 4.8

Building on an Ubuntu 14.04 machine gives the following error:

ERROR: /usr/local/google/home/rodrigoq/.cache/bazel/_bazel_rodrigoq/f18209624566089c9f60bd21b92d9983/external/org_lzma_lzma/BUILD.bazel:21:1: C++ compilation of rule '@org_lzma_lzma//:lzma' failed (Exit 1)
In file included from external/org_lzma_lzma/src/liblzma/common/common.h:17:0,
                 from external/org_lzma_lzma/src/liblzma/common/vli_decoder.c:13:
external/org_lzma_lzma/src/common/mythread.h:138:52: error: expected ';', ',' or ')' before 'set'
 mythread_sigmask(int how, const sigset_t *restrict set,
                                                    ^
In file included from external/org_lzma_lzma/src/liblzma/common/vli_decoder.c:13:0:
external/org_lzma_lzma/src/liblzma/common/common.h:107:27: error: expected ';', ',' or ')' before 'in'
   const uint8_t *restrict in, size_t *restrict in_pos,
                           ^
external/org_lzma_lzma/src/liblzma/common/common.h:150:2: error: unknown type name 'lzma_code_function'
  lzma_code_function code;
  ^
external/org_lzma_lzma/src/liblzma/common/common.h:268:51: error: expected ';', ',' or ')' before 'in'
 extern size_t lzma_bufcpy(const uint8_t *restrict in, size_t *restrict in_pos,
                                                   ^
external/org_lzma_lzma/src/liblzma/common/vli_decoder.c:17:36: error: expected ';', ',' or ')' before 'vli'
 lzma_vli_decode(lzma_vli *restrict vli, size_t *vli_pos,
                                    ^
Target @org_lzma_lzma//:lzma failed to build

This can be resolved by using bazel build --conlyopt=-std=c99. It can also be resolved by setting copts = ["-std=c99"] in BUILD.lzma, but I'm concerned this could break other platforms?

Unable to find package for @com_github_nelhage_rules_boost//:boost/boost.bzl

Hi Guys,
I am trying to build native_client in DeepSpeech mozilla project however I am always facing this error.
Unable to find package for @com_github_nelhage_rules_boost//:boost/boost.bzl: The repository '@com_github_nelhage_rules_boost' could not be resolved.
I tried to load it locally but doesn't work too I got always a Path error.
PS: in native_client build file the package is loaded via this command:
load("@com_github_nelhage_rules_boost//:boost/boost.bzl", "boost_deps")
and its WORKSPACE file is empty.
you can have a look here for more details
https://github.com/mozilla/DeepSpeech/tree/master/native_client

test target link failure

I am trying to build a open source project colmap suing Bazel. I am using the boost test dependency in deps = ["@boost//:test"]

cc_test( name = "bitmap_test", size = "small", srcs = ["src/util/bitmap_test.cc"], linkstatic = 1, deps = [ ":lib", "@boost//:test", ], )

but there are link errors for missing symbols in the boost::unit_test namespace. For instance

ld.lld: error: undefined symbol: boost::unit_test::unit_test_log_t::set_checkpoint(boost::unit_test::basic_cstring, unsigned long, boost::unit_test::basic_cstring)

referenced by bitmap_test.cc
bazel-out/k8-opt/bin/third_party/colmap/_objs/bitmap_test/bitmap_test.o:(TestBitmapGrayColor_invoker())

I looked at the missing symbols and they all corresponded to *.ipp files and noticed that cpp files were in libs/test/src/. The test target excludes these files.

boost_library( name = "test", exclude_src = glob(["libs/test/src/*.cpp"]), deps = [ ":algorithm", ":assert", ":bind", ":call_traits", ":config", ":core", ":current_function", ":detail", ":exception", ":function", ":io", ":iterator", ":limits", ":mpl", ":numeric_conversion", ":optional", ":preprocessor", ":smart_ptr", ":static_assert", ":timer", ":type", ":type_traits", ":utility", ":version", ], )
I commented the exclude_src line and the link errors were eliminated.

tests/stacktrace_test.cc fails

commit: 2020/01/16 master 9eff867

repro:

My repo already build zlib, lzma, bzip2, etc.. So I just reused my existing builds of those repositories. I also modified the workspace names of zlib and lzma to match rules_boost.

Essentially:

13:59 $ bazel test examples/cc/boost:stacktrace_test
INFO: Invocation ID: a01f8363-eb10-46c2-bf46-46c6593ded31
INFO: Analyzed target //examples/cc/boost:stacktrace_test (3 packages loaded, 4539 targets configured).
INFO: Found 1 test target...
INFO: Writing explanation of rebuilds to 'build/logs'
ERROR: /mnt/data/cache/bazel/_bazel_zhongming/5a5efdfcd4f98edbd655a37c61128c16/external/boost/BUILD.bazel:1627:1: C++ compilation of rule '@boost//:stacktrace' failed (Exit 1) clang failed: error executing command
  (cd /mnt/data/cache/bazel/_bazel_zhongming/5a5efdfcd4f98edbd655a37c61128c16/sandbox/linux-sandbox/1579/execroot/logi && \
  exec env - \
    PATH=/bin:/usr/bin:/usr/local/bin \
    PWD=/proc/self/cwd \
  tools/toolchains/cc/clang/wrappers/clang -nostdinc -isystemexternal/clang/include/c++/v1 -isystemexternal/clang/lib/clang/9.0.0/include -isystem/usr/include -isystem/usr/include/x86_64-linux-gnu -U_FORTIFY_SOURCE '-D_FORTIFY_SOURCE=1' -Wall -fcolor-diagnostics -fno-omit-frame-pointer -fstack-protector -MD -MF bazel-out/k8-fastbuild/bin/external/boost/_objs/stacktrace/backtrace.pic.d '-frandom-seed=bazel-out/k8-fastbuild/bin/external/boost/_objs/stacktrace/backtrace.pic.o' -fPIC -DBOOST_FALLTHROUGH -iquote external/boost -iquote bazel-out/k8-fastbuild/bin/external/boost -isystem external/boost -isystem bazel-out/k8-fastbuild/bin/external/boost -isystem external/boost/boost/stacktrace -isystem bazel-out/k8-fastbuild/bin/external/boost/boost/stacktrace -isystem external/boost/boost/array -isystem bazel-out/k8-fastbuild/bin/external/boost/boost/array -isystem external/boost/boost/assert -isystem bazel-out/k8-fastbuild/bin/external/boost/boost/assert -isystem external/boost/boost/config -isystem bazel-out/k8-fastbuild/bin/external/boost/boost/config -isystem external/boost/boost/version -isystem bazel-out/k8-fastbuild/bin/external/boost/boost/version -isystem external/boost/boost/core -isystem bazel-out/k8-fastbuild/bin/external/boost/boost/core -isystem external/boost/boost/functional -isystem bazel-out/k8-fastbuild/bin/external/boost/boost/functional -isystem external/boost/boost/container_hash -isystem bazel-out/k8-fastbuild/bin/external/boost/boost/container_hash -isystem external/boost/boost/integer -isystem bazel-out/k8-fastbuild/bin/external/boost/boost/integer -isystem external/boost/boost/cstdint -isystem bazel-out/k8-fastbuild/bin/external/boost/boost/cstdint -isystem external/boost/boost/limits -isystem bazel-out/k8-fastbuild/bin/external/boost/boost/limits -isystem external/boost/boost/static_assert -isystem bazel-out/k8-fastbuild/bin/external/boost/boost/static_assert -isystem external/boost/boost/type_traits -isystem bazel-out/k8-fastbuild/bin/external/boost/boost/type_traits -isystem external/boost/boost/mpl -isystem bazel-out/k8-fastbuild/bin/external/boost/boost/mpl -isystem external/boost/boost/move -isystem bazel-out/k8-fastbuild/bin/external/boost/boost/move -isystem external/boost/boost/detail -isystem bazel-out/k8-fastbuild/bin/external/boost/boost/detail -isystem external/boost/boost/preprocessor -isystem bazel-out/k8-fastbuild/bin/external/boost/boost/preprocessor -isystem external/boost/boost/swap -isystem bazel-out/k8-fastbuild/bin/external/boost/boost/swap -isystem external/boost/boost/throw_exception -isystem bazel-out/k8-fastbuild/bin/external/boost/boost/throw_exception -isystem external/boost/boost/current_function -isystem bazel-out/k8-fastbuild/bin/external/boost/boost/current_function -isystem external/boost/boost/exception -isystem bazel-out/k8-fastbuild/bin/external/boost/boost/exception -isystem external/boost/boost/lexical_cast -isystem bazel-out/k8-fastbuild/bin/external/boost/boost/lexical_cast -isystem external/boost/boost/chrono -isystem bazel-out/k8-fastbuild/bin/external/boost/boost/chrono -isystem external/boost/boost/operators -isystem bazel-out/k8-fastbuild/bin/external/boost/boost/operators -isystem external/boost/boost/predef -isystem bazel-out/k8-fastbuild/bin/external/boost/boost/predef -isystem external/boost/boost/ratio -isystem bazel-out/k8-fastbuild/bin/external/boost/boost/ratio -isystem external/boost/boost/system -isystem bazel-out/k8-fastbuild/bin/external/boost/boost/system -isystem external/boost/boost/cerrno -isystem bazel-out/k8-fastbuild/bin/external/boost/boost/cerrno -isystem external/boost/boost/noncopyable -isystem bazel-out/k8-fastbuild/bin/external/boost/boost/noncopyable -isystem external/boost/boost/utility -isystem bazel-out/k8-fastbuild/bin/external/boost/boost/utility -isystem external/boost/boost/container -isystem bazel-out/k8-fastbuild/bin/external/boost/boost/container -isystem external/boost/boost/intrusive -isystem bazel-out/k8-fastbuild/bin/external/boost/boost/intrusive -isystem external/boost/boost/math -isystem bazel-out/k8-fastbuild/bin/external/boost/boost/math -isystem external/boost/boost/atomic -isystem bazel-out/k8-fastbuild/bin/external/boost/boost/atomic -isystem external/boost/boost/concept_check -isystem bazel-out/k8-fastbuild/bin/external/boost/boost/concept_check -isystem external/boost/boost/concept -isystem bazel-out/k8-fastbuild/bin/external/boost/boost/concept -isystem external/boost/boost/concept_archetype -isystem bazel-out/k8-fastbuild/bin/external/boost/boost/concept_archetype -isystem external/boost/boost/iterator -isystem bazel-out/k8-fastbuild/bin/external/boost/boost/iterator -isystem external/boost/boost/fusion -isystem bazel-out/k8-fastbuild/bin/external/boost/boost/fusion -isystem external/boost/boost/call_traits -isystem bazel-out/k8-fastbuild/bin/external/boost/boost/call_traits -isystem external/boost/boost/function_types -isystem bazel-out/k8-fastbuild/bin/external/boost/boost/function_types -isystem external/boost/boost/get_pointer -isystem bazel-out/k8-fastbuild/bin/external/boost/boost/get_pointer -isystem external/boost/boost/ref -isystem bazel-out/k8-fastbuild/bin/external/boost/boost/ref -isystem external/boost/boost/tuple -isystem bazel-out/k8-fastbuild/bin/external/boost/boost/tuple -isystem external/boost/boost/typeof -isystem bazel-out/k8-fastbuild/bin/external/boost/boost/typeof -isystem external/boost/boost/lambda -isystem bazel-out/k8-fastbuild/bin/external/boost/boost/lambda -isystem external/boost/boost/mp11 -isystem bazel-out/k8-fastbuild/bin/external/boost/boost/mp11 -isystem external/boost/boost/range -isystem bazel-out/k8-fastbuild/bin/external/boost/boost/range -isystem external/boost/boost/optional -isystem bazel-out/k8-fastbuild/bin/external/boost/boost/optional -isystem external/boost/boost/none -isystem bazel-out/k8-fastbuild/bin/external/boost/boost/none -isystem external/boost/boost/type -isystem bazel-out/k8-fastbuild/bin/external/boost/boost/type -isystem external/boost/boost/regex -isystem bazel-out/k8-fastbuild/bin/external/boost/boost/regex -isystem external/boost/boost/smart_ptr -isystem bazel-out/k8-fastbuild/bin/external/boost/boost/smart_ptr -isystem external/boost/boost/align -isystem bazel-out/k8-fastbuild/bin/external/boost/boost/align -isystem external/boost/boost/scoped_array -isystem bazel-out/k8-fastbuild/bin/external/boost/boost/scoped_array -isystem external/boost/boost/checked_delete -isystem bazel-out/k8-fastbuild/bin/external/boost/boost/checked_delete -isystem external/boost/boost/scoped_ptr -isystem bazel-out/k8-fastbuild/bin/external/boost/boost/scoped_ptr -isystem external/boost/boost/shared_array -isystem bazel-out/k8-fastbuild/bin/external/boost/boost/shared_array -isystem external/boost/boost/shared_ptr -isystem bazel-out/k8-fastbuild/bin/external/boost/boost/shared_ptr -isystem external/boost/boost/numeric_conversion -isystem bazel-out/k8-fastbuild/bin/external/boost/boost/numeric_conversion '-D__DATE__='\''redacted'\''' '-D__TIMESTAMP__='\''redacted'\''' '-D__TIME__='\''redacted'\''' -Wno-builtin-macro-redefined -no-canonical-prefixes -Wno-unused-value -c external/boost/libs/stacktrace/src/backtrace.cpp -o bazel-out/k8-fastbuild/bin/external/boost/_objs/stacktrace/backtrace.pic.o)
Execution platform: //tools/platforms:linux64_clang

Use --sandbox_debug to see verbose messages from the sandbox
In file included from external/boost/libs/stacktrace/src/backtrace.cpp:15:
In file included from external/boost/boost/stacktrace/detail/frame_unwind.ipp:25:
external/boost/boost/stacktrace/detail/libbacktrace_impls.hpp:23:13: fatal error: 'backtrace.h' file not found
#   include <backtrace.h>
            ^~~~~~~~~~~~~
1 error generated.
Target //examples/cc/boost:stacktrace_test failed to build
INFO: Elapsed time: 19.442s, Critical Path: 0.44s
INFO: 0 processes.
FAILED: Build did NOT complete successfully

FAILED: Build did NOT complete successfully

I searched the boost-1.71.0 repository using find . -name 'backtrace.h'. But it did not return me anything.

I also briefly Google 'backtrace.h boost'. The first few pages relate to the 0boost stacktrace module but does not mention anything super useful yet.

I'm not familiar with boost. Running out of ideas to try here.

Any pointers or keywords would be appreciated.

Thanks.

bazel build @boost//:iostream not working

Hello, I am on windows 10, tried with bazel 0.10 and 0.14.

When I add "@boost//:iostreams" to any cc_library I get the error:
/external/net_zlib_zlib/BUILD.bazel:6:1: in cc_library rule @net_zlib_zlib//:zlib: Expected action_config for 'preprocess-assemble' to be configured. I am not sure if the problem is from the library or If I am doing something wrong, Do you have any what might cause the problem?

Workplace file:

local_repository(
  name = "com_github_nelhage_rules_boost",
  # commit = "239ce40e42ab0e3fe7ce84c2e9303ff8a277c41a",
  # remote = "https://github.com/nelhage/rules_boost",
  path = "third_party/com_github_nelhage_rules_boost",
)

load("@com_github_nelhage_rules_boost//:boost/boost.bzl", "boost_deps")
boost_deps()

and my BUILD file:

cc_library(
    name = "storage",
    srcs = [
      "blobstore.cc",
      "blobstore.h",
    ],
    hdrs = [
      "blobstore.h",
    ],
    deps = [
      "@boost//:iostreams",
    ],
    defines = ["BOOST_ALL_NO_LIB"],
)

rule does not exist for boost graph

I don't see a rule for "graph" anywhere in BUILD.boost.
Was it left out on purpose?

was hoping to access it with something like:

  deps = ["@boost//:graph"]

I was able to get it to work on my own, but it was a little messy
building and pulling in other boost dependencies as separate repos
for graph specifically, it looked something like:

getting repo:

new_git_repository(
    name = "com_github_boost_graph",
    build_file = "bazel/deps/boost/boost_graph.BUILD",
    commit = "4c752ee2f11c249e0d5b1fab8f0ef9da3428f575",
    remote = "https://github.com/boostorg/graph.git",
)

build rule:

package(default_visibility = ["//visibility:public"])

cc_library(
  name = "graph",
  includes = [
    "include/",
  ],
  hdrs = glob([
    "include/boost/**/*.hpp",
  ]),
  srcs = [
  ],
  deps = [
    "@com_github_boost_property_map//:property_map",
    "@com_github_boost_property_tree//:property_tree",
    "@com_github_boost_lexical_cast//:lexical_cast",
    "@com_github_boost_xpressive//:xpressive",
  ]
)

any plans to add a rule for graph?

Build Failure on GCC 10

I just upgraded my workstation to Fedora 32 (scheduled to be released a week from now), and I'm getting a build failure now w/ GCC 10. I am using the latest commit, currently fe9a079. The failure I see is like:

ERROR: /home/evan/.cache/bazel/_bazel_evan/180b6ea7081ea11eb90ea7e00a54ca93/external/boost/BUILD.bazel:506:1: undeclared inclusion(s) in rule '@boost//:container':
this rule is missing dependency declarations for the following files included by 'external/boost/libs/container/src/synchronized_pool_resource.cpp':
  '/usr/lib/gcc/x86_64-redhat-linux/10/include/stddef.h'
  '/usr/lib/gcc/x86_64-redhat-linux/10/include/stdarg.h'
  '/usr/lib/gcc/x86_64-redhat-linux/10/include/stdint.h'

BOOST_ASIO_SEPARATE_COMPILATION breaks asio ssl engine include

PR #167 introduced BOOST_ASIO_SEPARATE_COMPILATION, but this results in boost/asio/ssl/detail/impl/engine.ipp failing to be included in compilation (because BOOST_ASIO_HEADER_ONLY is now not defined), and thus the linker can't find any symbols from ssl engine, e.g.:

ld.lld: error: undefined symbol: boost::asio::ssl::context::context(boost::asio::ssl::context_base::method)
ld.lld: error: undefined symbol: boost::asio::ssl::detail::engine::native_handle()
ld.lld: error: undefined symbol: boost::asio::ssl::context::~context()
...

So far I don't have a solution other than reverting to the commit prior to PR #167.

bazel error: "Error downloading ..."

I am currently getting the following error when depending on @boost//:system using these rules:

ERROR: /Users/alex/Code/go/src/github.com/zippyai/zippy/packages/MockRobot/BUILD:1:1: 
no such package '@boost//': Error downloading 
[https://sourceforge.net/projects/boost/files/boost/1.61.0/boost_1_61_0.tar.bz2/download] to 
/private/var/tmp/_bazel_alex/c2b0a41d8882371a0ab2752ce12185be/external/boost/download.tar.bz2: 
Received fatal alert: handshake_failure and referenced by '//packages/MockRobot:MockRobot'.

I guess this is a sourceforge issue. I wonder if it's possible to find an alternative place to host these files.

Update README WORKSPACE file

The commit field in README's WORKSPACE file makes the downloaded rule stay at Oct 3, 2019, which is outdated.

Problems with building boost/iostreams on windows

Update to: #68
Here is the issue about the missing action_config: bazelbuild/bazel#5495

Removing "contrib/amd64/amd64-match.S" and "-Wno-implicit-function-declaration" from BUILD.zlib fixed the build issue on windows.
Now the problem I get is from lzma:

ERROR: .../f3jdn2ka/external/org_lzma_lzma/BUILD.bazel:6:1: Executing genrule @org_lzma_lzma//:configure_lzma failed (Exit -1). Note: Remote connection/protocol failed with: execution failed
Action failed to execute: java.io.IOException: ERROR: src/main/native/windows/processes-jni.cc(239): CreateProcessW("C:\msys64\usr\bin\bash.exe" -c "source external/bazel_tools/tools/genrule/genrule-setup.sh; cd external/org_lzma_lzma && ./configure && cp config.h ../../bazel-out/x64_windows-fastbuild/genfiles/external/org_lzma_lzma/config.h"): The system cannot find the file specified.

403 Forbidden downloading https://dl.bintray.com/boostorg/release/1.67.0/source/boost_1_67_0.tar.gz

With the latest commit I get a 403 Forbidden when downloading the boost libraries:

Error downloading [https://dl.bintray.com/boostorg/release/1.67.0/source/boost_1_67_0.tar.gz] to 
/home/xxx/.cache/bazel/_bazel_phil/7a0a3fce9466c5669459d49aa0461110/external/boost/boost_1_67_0.tar.gz: GET returned 403 Forbidden

I'm guessing that this is a change in the configuration of the boost download server, because the same code worked a couple of days ago.

Open to suppressing all warnings?

I've submitted a number of PRs suppressing or fixing warnings on macos, but every few weeks I find new warnings. Instead of continually submitting new PRs to suppress these warnings, would you be open to just universally providing -w to suppress all warnings?

error downloading tarsal

I'm seeing this error when trying to use the boost dep, any ideas?

Error downloading [https://sourceforge.net/projects/boost/files/boost/1.61.0/boost_1_61_0.tar.bz2/download] to /home/alan/.cache/bazel/_bazel_alan/50d2d8587c8bcf0c3c09e1faf2188140/external/boost/download.tar.bz2: Received fatal alert: handshake_failure and referenced by '//examples:boost'

Compilation warning in external/boost/libs/serialization/src/binary_wiarchive.cpp

Noticed the following compilation warning. Would be awesome if it could be fixed.

WARNING: From Compiling external/boost/libs/serialization/src/binary_iarchive.cpp:
In file included from external/boost/boost/detail/endian.hpp:9,
                 from external/boost/boost/archive/impl/basic_binary_iarchive.ipp:25,
                 from external/boost/libs/serialization/src/binary_iarchive.cpp:20:
external/boost/boost/predef/detail/endian_compat.h:11:161: note: #pragma message: The use of BOOST_*_ENDIAN and BOOST_BYTE_ORDER is deprecated. Please include <boost/predef/other/endian.h> and use BOOST_ENDIAN_*_BYTE instead
 #pragma message("The use of BOOST_*_ENDIAN and BOOST_BYTE_ORDER is deprecated. Please include <boost/predef/other/endian.h> and use BOOST_ENDIAN_*_BYTE instead")

Thanks so much for your support and maintenance of this repo! Its tremendously useful and very helpful for the bazel ecosystem!

Was the ARM support reverted?

Hi, bazel is not able build boost in ARM (aarch64). I'm trying to build ray project.

Ubuntu 18.04, Linux Titan 4.9.140-tegra #1 SMP PREEMPT Sat Oct 19 15:54:06 PDT 2019 aarch64 aarch64 aarch64 GNU/Linux
bazel 2.1.0- (@non-git)
Python 3.6.9

Errors

ERROR: Analysis of target '//:ray_pkg' failed; build aborted:

/home/abishek/.cache/bazel/_bazel_root/f9684c56d3bfa17b4fade757272d3420/external/boost/BUILD.bazel:116:1: Configurable attribute "srcs" doesn't match this configuration (would a default condition help?).
Conditions checked:
 @boost//:linux_arm
 @boost//:linux_x86_64
 @boost//:osx_x86_64
 @boost//:windows_x86_64
INFO: Elapsed time: 1203.931s
INFO: 0 processes.
FAILED: Build did NOT complete successfully (5 packages loaded, 2763 targets configur\
ed)
Traceback (most recent call last):
  File "setup.py", line 221, in <module>
    license="Apache 2.0")
  File "/home/abishek/.local/lib/python3.6/site-packages/setuptools/__init__.py", line 144, in setup
    return distutils.core.setup(**attrs)
  File "/usr/lib/python3.6/distutils/core.py", line 148, in setup
    dist.run_commands()
  File "/usr/lib/python3.6/distutils/dist.py", line 955, in run_commands
    self.run_command(cmd)
  File "/usr/lib/python3.6/distutils/dist.py", line 974, in run_command
    cmd_obj.run()
  File "/home/abishek/.local/lib/python3.6/site-packages/wheel/bdist_wheel.py", line 223, in run
    self.run_command('build')
  File "/usr/lib/python3.6/distutils/cmd.py", line 313, in run_command
    self.distribution.run_command(command)
  File "/usr/lib/python3.6/distutils/dist.py", line 974, in run_command
    cmd_obj.run()
  File "/usr/lib/python3.6/distutils/command/build.py", line 135, in run
    self.run_command(cmd_name)
  File "/usr/lib/python3.6/distutils/cmd.py", line 313, in run_command
    self.distribution.run_command(command)
  File "/usr/lib/python3.6/distutils/dist.py", line 974, in run_command
    cmd_obj.run()
  File "setup.py", line 102, in run
    subprocess.check_call(command)
  File "/usr/lib/python3.6/subprocess.py", line 311, in check_call
    raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command '['../build.sh', '-p', '/usr/bin/python3']' returned non-zero exit status 1.

If I manually add linux_arm to

boost_library(
    name = "context",
    srcs = BOOST_CTX_ASM_SOURCES + select({
        ":linux_arm": [
            "libs/context/src/posix/stack_traits.cpp",
        ],
        ":linux": [
            "libs/context/src/posix/stack_traits.cpp",
        ],
        ":osx_x86_64": [
            "libs/context/src/posix/stack_traits.cpp",
        ],
        ":windows_x86_64": [
            "libs/context/src/windows/stack_traits.cpp",
        ],
    }),

New error occurs at 1586:1,

+ /usr/local/bin/bazel build //:ray_pkg --verbose_failures
ERROR: /home/abishek/.cache/bazel/_bazel_root/f9684c56d3bfa17b4fade757272d3420/external/boost/BUILD.bazel:1586:1: Configurable attribute "defines" doesn't match this configuration (would a default condition help?).
Conditions checked:
 @boost//:linux_arm
 @boost//:linux_x86_64
 @boost//:osx_x86_64
 @boost//:windows_x86_64
ERROR: Analysis of target '//:ray_pkg' failed; build aborted:

/home/abishek/.cache/bazel/_bazel_root/f9684c56d3bfa17b4fade757272d3420/external/boost/BUILD.bazel:1586:1: Configurable attribute "defines" doesn't match this configuration (would a default condition help?).
Conditions checked:
 @boost//:linux_arm
 @boost//:linux_x86_64
 @boost//:osx_x86_64
 @boost//:windows_x86_64
INFO: Elapsed time: 627.317s
INFO: 0 processes.
FAILED: Build did NOT complete successfully (2 packages loaded, 2546 targets configur\
ed)
    Fetching @boringssl; fetching
Traceback (most recent call last):
  File "setup.py", line 221, in <module>
    license="Apache 2.0")
  File "/home/abishek/.local/lib/python3.6/site-packages/setuptools/__init__.py", line 144, in setup
    return distutils.core.setup(**attrs)
  File "/usr/lib/python3.6/distutils/core.py", line 148, in setup
    dist.run_commands()
  File "/usr/lib/python3.6/distutils/dist.py", line 955, in run_commands
    self.run_command(cmd)
  File "/usr/lib/python3.6/distutils/dist.py", line 974, in run_command
    cmd_obj.run()
  File "/home/abishek/.local/lib/python3.6/site-packages/wheel/bdist_wheel.py", line 223, in run
    self.run_command('build')
  File "/usr/lib/python3.6/distutils/cmd.py", line 313, in run_command
    self.distribution.run_command(command)
  File "/usr/lib/python3.6/distutils/dist.py", line 974, in run_command
    cmd_obj.run()
  File "/usr/lib/python3.6/distutils/command/build.py", line 135, in run
    self.run_command(cmd_name)
  File "/usr/lib/python3.6/distutils/cmd.py", line 313, in run_command
    self.distribution.run_command(command)
  File "/usr/lib/python3.6/distutils/dist.py", line 974, in run_command
    cmd_obj.run()
  File "setup.py", line 102, in run
    subprocess.check_call(command)
  File "/usr/lib/python3.6/subprocess.py", line 311, in check_call
    raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command '['../build.sh', '-p', '/usr/bin/python3']' returned non-zero exit status 1.

If I add linux_arm there as well,

boost_library(
    name = "thread",
    srcs = select({
         ":linux_arm": [
            "libs/thread/src/pthread/once.cpp",
            "libs/thread/src/pthread/thread.cpp",
         ],
        ":linux": [
            "libs/thread/src/pthread/once.cpp",
            "libs/thread/src/pthread/thread.cpp",
        ],
        ":osx_x86_64": [
            "libs/thread/src/pthread/once.cpp",
            "libs/thread/src/pthread/thread.cpp",
        ],
        ":windows_x86_64": [
            "libs/thread/src/win32/thread.cpp",
            "libs/thread/src/win32/tss_dll.cpp",
            "libs/thread/src/win32/tss_pe.cpp",
        ],
    }),

Second error (1586:1) disappears, but first error reappears again (116:1).

I see that the ARM specific changes provided
here- #121 is not in the latest rules; have they become invalid?

Mac OS: Error downloading [https://zlib.net/zlib-1.2.11.tar.gz]

This may be specifically a bazel issue. However we have plenty of packages being downloaded in our build and the zlib is the only one it's complaining about.

wget https://zlib.net/zlib-1.2.11.tar.gz works, so I know the file exists.

ERROR: /private/var/tmp/bazel/feccc00fb7c3b07c1f4af822dba815a1/external/boost/BUILD.bazel:496:1: no such package '@net_zlib_zlib//': Error downloading [https://zlib.net/zlib-1.2.11.tar.gz] to /private/var/tmp/bazel/feccc00fb7c3b07c1f4af822dba815a1/external/net_zlib_zlib/zlib-1.2.11.tar.gz: sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target and referenced by '@boost//:iostreams'
ERROR: Analysis of target '//' failed; build aborted: no such package '@net_zlib_zlib//': Error downloading [https://zlib.net/zlib-1.2.11.tar.gz] to /private/var/tmp/bazel/feccc00fb7c3b07c1f4af822dba815a1/external/net_zlib_zlib/zlib-1.2.11.tar.gz: sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target

Windows: invalid numeric argument '/Wno-unused-value'

bazel build @boost//:regex gives the error:

ERROR: .../external/boost/BUILD.bazel:806:1: C++ compilation of rule '@boost//:regex' failed (Exit 2)
cl : Command line error D8021 : invalid numeric argument '/Wno-unused-value'

It works fine if in boost/boost.bzl we change
line 21 from

default_copts = ["-Wno-unused-value"]

to

default_copts = []

Missing symbol on macos

Hi,

I am trying to build a simple test on macOS:

#define BOOST_TEST_MODULE Test Framework Foo
#define BOOST_TEST_MAIN
#define BOOST_TEST_DYN_LINK
#include <boost/test/unit_test.hpp>
BOOST_AUTO_TEST_CASE(Foo) {
 BOOST_CHECK(true);
}

so I added:

 cc_test(
    name="test_foo",
    srcs=["foo.cxx"],
    deps=["@boost//:test"],
 )

to my top-level BUILD file. While everything compiles smoothly, I then have:

exec ${PAGER:-/usr/bin/less} "$0" || exit 1
Executing tests from //:foo
-----------------------------------------------------------------------------
dyld: Symbol not found: __ZTVN5boost9unit_test15unit_test_log_tE
  Referenced from: /private/var/tmp/_bazel_ktf/91d9fc6dbe68776a4f2028cf1026c7db/sandbox/darwin-sandbox/3/execroot/__main__/bazel-out/darwin-fastbuild/bin/foo.runfiles/__main__/foo
  Expected in: flat namespace
 in /private/var/tmp/_bazel_ktf/91d9fc6dbe68776a4f2028cf1026c7db/sandbox/darwin-sandbox/3/execroot/__main__/bazel-out/darwin-fastbuild/bin/foo.runfiles/__main__/foo
Abort trap: 6

when I try to run it. Notice that if I compile a simple test using e.g. boost::thread it works fine.

Build fail on ppc64

Please add an option to build, or maybe an empty condition in order not to fail on non supported platforms.

Thanks

preprocessor warning on macos for asio impl

The following warning occurs on macos from @boost//:asio. Unsure what the best fix is, otherwise I would have submitted a PR. Is it as simple as using -Wno-#warnings?

WARNING: From Compiling external/boost/boost/asio/impl/src.cpp:
external/boost/boost/asio/impl/src.cpp:21:3: warning: "This file is deprecated." [-W#warnings]
# warning "This file is deprecated."
  ^
external/boost/boost/asio/impl/src.cpp:22:3: warning: "Please #include <boost/asio/impl/src.hpp> instead." [-W#warnings]
# warning "Please #include <boost/asio/impl/src.hpp> instead."
  ^
2 warnings generated.

Building with Valgrind

Whenever i run my program I have a lot of memory leaks that come from boost -- i know i cause them but it just says boost. I was reading that Boost Context (a dependency) has to be built with valgrind=on as an option and if not this can cause these erroneous errors.. Is there a possibility that something that could be done here. I looked at the BUILD file and I could not find anything. Sorry if this is the wrong place for this!

Compilation warning when using -c opt in boost iostreams

The following warning appears when using bazel build -c opt @boost//:iostreams, and occurs due to the absence of -Wno-uninitialized in @com_github_facebook_zstd:

                                           ^
WARNING: From Compiling external/com_github_facebook_zstd/lib/legacy/zstd_v01.c:
external/com_github_facebook_zstd/lib/legacy/zstd_v01.c: In function 'ZSTD_decompressSequences':
external/com_github_facebook_zstd/lib/legacy/zstd_v01.c:1878:35: warning: 'dumps' may be used uninitialized in this function [-Wmaybe-uninitialized]
         seqState.dumpsEnd = dumps + dumpsLength;
                             ~~~~~~^~~~~~~~~~~~~
external/com_github_facebook_zstd/lib/legacy/zstd_v01.c:1889:18: warning: 'nbSeq' may be used uninitialized in this function [-Wmaybe-uninitialized]
             nbSeq--;
             ~~~~~^~
external/com_github_facebook_zstd/lib/legacy/zstd_v01.c:1878:35: warning: 'dumpsLength' may be used uninitialized in this function [-Wmaybe-uninitialized]
         seqState.dumpsEnd = dumps + dumpsLength;
                             ~~~~~~^~~~~~~~~~~~~
external/com_github_facebook_zstd/lib/legacy/zstd_v01.c: In function 'ZSTD_decompressBlock':
external/com_github_facebook_zstd/lib/legacy/zstd_v01.c:1541:20: warning: '*((void *)&litbp+4)' may be used uninitialized in this function [-Wmaybe-uninitialized]
             size_t rleSize = litbp.origSize;
                    ^~~~~~~
external/com_github_facebook_zstd/lib/legacy/zstd_v01.c:1525:23: note: '*((void *)&litbp+4)' was declared here
     blockProperties_t litbp;
                       ^~~~~
external/com_github_facebook_zstd/lib/legacy/zstd_v01.c:1532:5: warning: 'litbp' may be used uninitialized in this function [-Wmaybe-uninitialized]
     switch(litbp.blockType)
     ^~~~~~
external/com_github_facebook_zstd/lib/legacy/zstd_v01.c:1525:23: note: 'litbp' was declared here
     blockProperties_t litbp;
                       ^~~~~
external/com_github_facebook_zstd/lib/legacy/zstd_v01.c: In function 'ZSTDv01_decompressDCtx':
external/com_github_facebook_zstd/lib/legacy/zstd_v01.c:1962:9: warning: 'blockProperties' may be used uninitialized in this function [-Wmaybe-uninitialized]
         switch(blockProperties.blockType)
         ^~~~~~

-Wmaybe-uninitialized only works when compiled in release mode, which is why it doesn't appear elsewhere. From the GCC documentation:

The effectiveness of some warnings depends on optimizations also being enabled. For example -Wsuggest-final-types is more effective with link-time optimization and -Wmaybe-uninitialized does not warn at all unless optimization is enabled.

Note that -Wno-maybe-uninitialized is not a flag on Clang, so it would be better to use the less specific -Wno-uninitialized to fix this.

polygon rule missing deps

Test script:

#include "boost/polygon/voronoi.hpp"
int main() {}

BUILD:

cc_binary(
    name = "test_voronoi",
    srcs = ["test_voronoi.cc"],
    deps = [
        "@boost//:polygon",
    ]
)

Results in:

In file included from external/boost/boost/polygon/voronoi.hpp:13:0,
                 from twa/planning/nav/voronoi.cc:3:
external/boost/boost/polygon/isotropy.hpp:29:10: fatal error: boost/config.hpp: No such file or directory
 #include <boost/config.hpp>
          ^~~~~~~~~~~~~~~~~~

In file included from external/boost/boost/polygon/voronoi.hpp:13:0,
                 from twa/planning/nav/voronoi.cc:3:
external/boost/boost/polygon/isotropy.hpp:43:10: fatal error: boost/mpl/size_t.hpp: No such file or directory
 #include <boost/mpl/size_t.hpp>
          ^~~~~~~~~~~~~~~~~~~~~~

In file included from external/boost/boost/polygon/voronoi.hpp:13:0,
                 from twa/planning/nav/voronoi.cc:3:
external/boost/boost/polygon/isotropy.hpp:45:10: fatal error: boost/utility/enable_if.hpp: No such file or directory
 #include <boost/utility/enable_if.hpp>
          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~

The following diff seems to have fix the issue:

index 97c5be9..d1f3ae6 100644
--- a/BUILD.boost
+++ b/BUILD.boost
@@ -1194,7 +1194,10 @@ boost_library(
 boost_library(
     name = "polygon",
     deps = [
+        ":config",
         ":integer",
+        ":mpl",
+        ":utility",
     ],
 )

Note: using commit 13a7a40214bf62b6c5e44aa376db18c6315e67b2

I got 403 Problem

ERROR: /Users/xxxxxx/src/envoy/tcp/common/proxy_response/BUILD:6:1: no such package '@boost//': Error downlo
ading [https://dl.bintray.com/boostorg/release/1.66.0/source/boost_1_66_0.tar.gz] to /private/var/tmp/_bazel_zachary/6ac1e2163e019cce46a0c470f3f76eb1/extern
al/boost/boost_1_66_0.tar.gz: GET returned 403 Forbidden and referenced by '//src/envoy/tcp/common/proxy_response:proxy_response_lib'

This problem seems similar with bazelbuild/bazel#5932

Label '@bazel_skylib//rules:copy_file.bzl' is invalid because 'rules' is not a package

Help please:

I encounter error below:

error loading package '@boost//': Label '@bazel_skylib//rules:copy_file.bzl' is invalid because 'rules' is not a package; perhaps you meant to put the colon here: '@bazel_skylib//:rules/copy_file.bzl'? and referenced by '//smartvideo/server:executor_service'
ERROR: Analysis of target '//smartvideo/server:executor_service' failed; build aborted: Analysis failed

bazel version is : bazel 3.7.1

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.