Boost
ライブラリをローカルに構築しようとしていて、自分のプロジェクトでlocal_repository
として使用したいと考えています。私はこれを参考にしています(https://github.com/nelhage/rules_boost)。BazelビルドでローカルにBoostコンポーネントをビルドできません
boost/ // root of the boost project
|
bazel/
| |
| boost.bzl // contains "boost_library" function from https://github.com/nelhage/rules_boost/blob/master/boost/boost.bzl
| |
| BUILD // empty
boost/ // the original boost headers folder from original boost dist
|
lib/ // the original boost sources folder from original boost dist
|
BUILD
|
WORKSPACE
BUILD
ファイルはこの1つのようになります:私はこのようなディレクトリツリーを持っている 適切boost.bzl
WORKSPACE
をロードすると
https://github.com/nelhage/rules_boost/blob/master/BUILD.boost だけです:
ワークスペース(名前= "ブースト")
問題:
は、今私は(bazel build //:<component>
)の個々のコンポーネントを構築しようとしています。 コンポーネント(Boost.Container
、Boost.Test
)のいくつかは、同様の理由で(ヘッダーファイルが見つからない)ビルドに失敗しています。
bazel build //:container 1 ↵
INFO: Found 1 target...
ERROR: /home/spyder/codebase/boost/BUILD:103:1: C++ compilation of rule '//:container' failed: Process exited with status 1 [sandboxed].
libs/container/src/global_resource.cpp:12:51: fatal error: boost/container/pmr/memory_resource.hpp: No such file or directory
compilation terminated.
Use --strategy=CppCompile=standalone to disable sandboxing for the failing actions.
Target //:container failed to build
Use --verbose_failures to see the command lines of failed build steps.
INFO: Elapsed time: 0.519s, Critical Path: 0.18s
bazel build //:test 1 ↵
INFO: Found 1 target...
ERROR: /home/spyder/codebase/boost/BUILD:581:1: C++ compilation of rule '//:test' failed: Process exited with status 1 [sandboxed].
libs/test/src/junit_log_formatter.cpp:11:51: fatal error: boost/test/impl/junit_log_formatter.ipp: No such file or directory
compilation terminated.
Use --strategy=CppCompile=standalone to disable sandboxing for the failing actions.
Target //:test failed to build
Use --verbose_failures to see the command lines of failed build steps.
INFO: Elapsed time: 1.027s, Critical Path: 0.82s
私はそれを修正する上で私を導くことができますか?
EDIT:
Iもbazel query --output=build //:container
によって膨張cc_library
ルールを照会しようとした、非常に驚くほどこの
cc_library(
name = "container",
visibility = ["//visibility:public"],
generator_name = "container",
generator_function = "boost_library",
generator_location = "/home/spyder/codebase/boost/BUILD:103",
licenses = ["notice"],
deps = ["//:config", "//:core", "//:intrusive", "//:move"],
defines = [],
includes = ["boost/container/"],
copts = ["-Wno-unused-value"],
srcs = ["//:libs/container/src/alloc_lib.c", "//:libs/container/src/dlmalloc.cpp", "//:libs/container/src/dlmalloc_2_8_6.c", "//:libs/container/src/dlmalloc_ext_2_8_6.c", "//:libs/container/src/global_resource.cpp", "//:libs/container/src/monotonic_buffer_resource.cpp", "//:libs/container/src/pool_resource.cpp", "//:libs/container/src/synchronized_pool_resource.cpp", "//:libs/container/src/unsynchronized_pool_resource.cpp"],
hdrs = [ ....... , "//:boost/container/pmr/map.hpp", "//:boost/container/pmr/memory_resource.hpp", "//:boost/container/pmr/monotonic_buffer_resource.hpp", "//:boost/container/pmr/polymorphic_allocator.hpp", ........ ],
)
、不満されたソースファイル(libs/container/src/global_resource.cpp
)とヘッダを持って(boost/container/pmr/memory_resource.hpp
)について苦情を申し立てている人は、両方ともsrcs
とhdrs
のリストに正しく含まれています。
はい、すべての依存関係が正しく設定されています。 Boost.Containerの個々の依存関係を構築すると、彼らは絶対にうまく構築されます。エラーは 'Boost.Container'のソースとヘッダーからのみ発生します。さらに、 'bazel query --output = build //:container'を使って' //:container'に問い合わせて、そのヘッダが実際に 'hdrs'リストにあることを知りました。私はそれを問題にしています。 –
さらに詳しい情報を追加しました。 –
さらなる発見で答えを編集しました。 – mhlopko