diff --git a/.bazelversion b/.bazelversion new file mode 100644 index 0000000000..815da58b7a --- /dev/null +++ b/.bazelversion @@ -0,0 +1 @@ +7.4.1 diff --git a/.github/workflows/bazel.yml b/.github/workflows/bazel.yml index 1049b50444..31cc264b01 100644 --- a/.github/workflows/bazel.yml +++ b/.github/workflows/bazel.yml @@ -5,6 +5,7 @@ on: [pull_request] jobs: test: strategy: + fail-fast: false matrix: os: - ubuntu-latest @@ -17,3 +18,5 @@ jobs: working-directory: test - run: bazelisk test ... --@boost.asio//:ssl=boringssl working-directory: test + - run: bazelisk test ... --@boost.asio//:ssl=openssl + working-directory: test diff --git a/BUILD.bazel b/BUILD.bazel index f585cc2ac3..d1bef22035 100644 --- a/BUILD.bazel +++ b/BUILD.bazel @@ -1,17 +1,32 @@ -load("@rules_cc//cc:defs.bzl", "cc_library") load("@bazel_skylib//rules:common_settings.bzl", "string_flag") load("@bazel_skylib//rules:write_file.bzl", "write_file") +load("@rules_cc//cc:defs.bzl", "cc_library") string_flag( name = "ssl", - visibility = ["//visibility:public"], - values = ["no_ssl", "openssl", "boringssl"], build_setting_default = "no_ssl", + values = [ + "no_ssl", + "boringssl", + "openssl", + ], + visibility = ["//visibility:public"], +) + +config_setting( + name = "no_ssl", + flag_values = {":ssl": "no_ssl"}, ) -config_setting(name = "no_ssl", flag_values = {":ssl": "no_ssl"}) -config_setting(name = "openssl", flag_values = {":ssl": "openssl"}) -config_setting(name = "boringssl", flag_values = {":ssl": "boringssl"}) +config_setting( + name = "boringssl", + flag_values = {":ssl": "boringssl"}, +) + +config_setting( + name = "openssl", + flag_values = {":ssl": "openssl"}, +) write_file( name = "src", @@ -29,25 +44,6 @@ write_file( cc_library( name = "boost.asio", - visibility = ["//visibility:public"], - defines = ["BOOST_ASIO_SEPARATE_COMPILATION"], - linkopts = select({ - "@platforms//os:windows": [ - "-DEFAULTLIB:ws2_32", - "-DEFAULTLIB:mswsock", - ], - "//conditions:default": [ - "-lpthread", - ], - }), - hdrs = glob([ - "include/**/*.hpp", - "include/**/*.h", - "include/**/*.ipp", - ], exclude = [ - "include/boost/asio/impl/src.hpp", - "include/boost/asio/ssl/impl/src.hpp", - ]), srcs = [":src"] + select({ ":no_ssl": [ "include/boost/asio/impl/src.hpp", @@ -57,7 +53,29 @@ cc_library( "include/boost/asio/ssl/impl/src.hpp", ], }), + hdrs = glob( + [ + "include/**/*.hpp", + "include/**/*.h", + "include/**/*.ipp", + ], + exclude = [ + "include/boost/asio/impl/src.hpp", + "include/boost/asio/ssl/impl/src.hpp", + ], + ), + defines = ["BOOST_ASIO_SEPARATE_COMPILATION"], includes = ["include"], + linkopts = select({ + "@platforms//os:windows": [ + "-DEFAULTLIB:ws2_32", + "-DEFAULTLIB:mswsock", + ], + "//conditions:default": [ + "-lpthread", + ], + }), + visibility = ["//visibility:public"], deps = [ "@boost.align", "@boost.array", @@ -78,8 +96,8 @@ cc_library( "@boost.type_traits", "@boost.utility", ] + select({ - ":openssl": ["@openssl//:ssl"], ":boringssl": ["@boringssl//:ssl"], + ":openssl": ["@openssl//:ssl"], ":no_ssl": [], }), ) diff --git a/MODULE.bazel b/MODULE.bazel index 05e50c172c..72c1daf353 100644 --- a/MODULE.bazel +++ b/MODULE.bazel @@ -26,3 +26,4 @@ bazel_dep(name = "boost.system", version = "1.83.0.bzl.2") bazel_dep(name = "boost.throw_exception", version = "1.83.0.bzl.1") bazel_dep(name = "boost.type_traits", version = "1.83.0.bzl.1") bazel_dep(name = "boost.utility", version = "1.83.0.bzl.1") +bazel_dep(name = "openssl", version = "3.3.1.bcr.1") diff --git a/test/.bazelversion b/test/.bazelversion new file mode 100644 index 0000000000..815da58b7a --- /dev/null +++ b/test/.bazelversion @@ -0,0 +1 @@ +7.4.1