wwbmmm commented on code in PR #1996:
URL: https://github.com/apache/incubator-brpc/pull/1996#discussion_r1023478198


##########
docs/cn/bazel_support.md:
##########
@@ -0,0 +1,14 @@
+## bRPC 作为Bazel第三方依赖
+1. bRPC 依赖于一些开源库, 但这些库并没有提供bazel支持, 所以需要你手动将一部分依赖加入到你的构建项目中.
+2. 将 /example/bazel_1_3_release/build_for_brpc 该文件移动到你的项目根目录下, 将 
/example/bazel_1_3_release/build_for_brpc/WORKSPACE_eample 内容添加到你的WORKSPACE中.

Review Comment:
   eample -> example



##########
docs/en/bazel_support.md:
##########
@@ -0,0 +1,14 @@
+## bRPC as a Bazel third-party dependency
+1. bRPC relies on a number of open source libraries that do not provide bazel 
support, so you will need to manually add some of these dependencies to your 
build project.
+2. Move the file /example/bazel_1_3_release/build_for_brpc to the root of your 
project, and add the contents of 
/example/bazel_1_3_release/build_for_brpc/WORKSPACE_eample to your WORKSPACE

Review Comment:
   eample -> example



##########
example/bazel_1_3_release/WORKSPACE_example:
##########
@@ -0,0 +1,113 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+#
+#   http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied.  See the License for the
+# specific language governing permissions and limitations
+# under the License.
+
+workspace(name="test_project")
+load("@bazel_tools//tools/build_defs/repo:git.bzl", "git_repository", 
"new_git_repository")
+load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")
+
+
+BAZEL_SKYLIB_VERSION = "1.1.1"  # 2021-09-27T17:33:49Z
+
+BAZEL_SKYLIB_SHA256 = 
"c6966ec828da198c5d9adbaa94c05e3a1c7f21bd012a0b29ba8ddbccb2c93b0d"
+
+
+http_archive(
+    name = "bazel_skylib",
+    sha256 = BAZEL_SKYLIB_SHA256,
+    urls = [
+        
"https://github.com/bazelbuild/bazel-skylib/releases/download/{version}/bazel-skylib-{version}.tar.gz".format(version
 = BAZEL_SKYLIB_VERSION),
+        
"https://mirror.bazel.build/github.com/bazelbuild/bazel-skylib/releases/download/{version}/bazel-skylib-{version}.tar.gz".format(version
 = BAZEL_SKYLIB_VERSION),
+    ],
+)
+
+# build for bRPC
+http_archive(
+    name = "com_google_protobuf",  # 2021-10-29T00:04:02Z
+    build_file = "//build_brpc/protobuf:protobuf.BUILD",
+    patch_cmds = [
+        "sed -i protobuf.bzl -re '4,4d;417,508d'",
+    ],
+    patch_cmds_win = [
+        """$content = Get-Content 'protobuf.bzl' | Where-Object {
+    -not ($_.ReadCount -ne 4) -and
+    -not ($_.ReadCount -ge 418 -and $_.ReadCount -le 509)
+}
+Set-Content protobuf.bzl -Value $content -Encoding UTF8
+""",
+    ],
+    sha256 = 
"87407cd28e7a9c95d9f61a098a53cf031109d451a7763e7dd1253abf8b4df422",
+    strip_prefix = "protobuf-3.19.1",
+    urls = 
["https://github.com/protocolbuffers/protobuf/archive/refs/tags/v3.19.1.tar.gz";],
+)
+
+
+BAZEL_SKYLIB_VERSION = "1.1.1"  # 2021-09-27T17:33:49Z

Review Comment:
   duplicated with line 23



##########
example/bazel_1_3_release/WORKSPACE_example:
##########
@@ -0,0 +1,113 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+#
+#   http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied.  See the License for the
+# specific language governing permissions and limitations
+# under the License.
+
+workspace(name="test_project")
+load("@bazel_tools//tools/build_defs/repo:git.bzl", "git_repository", 
"new_git_repository")
+load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")
+
+
+BAZEL_SKYLIB_VERSION = "1.1.1"  # 2021-09-27T17:33:49Z
+
+BAZEL_SKYLIB_SHA256 = 
"c6966ec828da198c5d9adbaa94c05e3a1c7f21bd012a0b29ba8ddbccb2c93b0d"
+
+
+http_archive(
+    name = "bazel_skylib",
+    sha256 = BAZEL_SKYLIB_SHA256,
+    urls = [
+        
"https://github.com/bazelbuild/bazel-skylib/releases/download/{version}/bazel-skylib-{version}.tar.gz".format(version
 = BAZEL_SKYLIB_VERSION),
+        
"https://mirror.bazel.build/github.com/bazelbuild/bazel-skylib/releases/download/{version}/bazel-skylib-{version}.tar.gz".format(version
 = BAZEL_SKYLIB_VERSION),
+    ],
+)
+
+# build for bRPC
+http_archive(
+    name = "com_google_protobuf",  # 2021-10-29T00:04:02Z
+    build_file = "//build_brpc/protobuf:protobuf.BUILD",
+    patch_cmds = [
+        "sed -i protobuf.bzl -re '4,4d;417,508d'",
+    ],
+    patch_cmds_win = [
+        """$content = Get-Content 'protobuf.bzl' | Where-Object {
+    -not ($_.ReadCount -ne 4) -and
+    -not ($_.ReadCount -ge 418 -and $_.ReadCount -le 509)
+}
+Set-Content protobuf.bzl -Value $content -Encoding UTF8
+""",
+    ],
+    sha256 = 
"87407cd28e7a9c95d9f61a098a53cf031109d451a7763e7dd1253abf8b4df422",
+    strip_prefix = "protobuf-3.19.1",
+    urls = 
["https://github.com/protocolbuffers/protobuf/archive/refs/tags/v3.19.1.tar.gz";],
+)
+
+
+BAZEL_SKYLIB_VERSION = "1.1.1"  # 2021-09-27T17:33:49Z
+
+BAZEL_SKYLIB_SHA256 = 
"c6966ec828da198c5d9adbaa94c05e3a1c7f21bd012a0b29ba8ddbccb2c93b0d"
+
+
+http_archive(
+    name = "com_github_madler_zlib",  # 2017-01-15T17:57:23Z
+    build_file = "//build_brpc/zlib:zlib.BUILD",
+    sha256 = 
"c3e5e9fdd5004dcb542feda5ee4f0ff0744628baf8ed2dd5d66f8ca1197cb1a1",
+    strip_prefix = "zlib-1.2.11",
+    urls = [
+        
"https://downloads.sourceforge.net/project/libpng/zlib/1.2.11/zlib-1.2.11.tar.gz";,
+        "https://zlib.net/fossils/zlib-1.2.11.tar.gz";,
+    ],
+)
+
+
+new_local_repository(
+    name = "openssl",
+    path = "/usr",
+    build_file = "//build_brpc/openssl:openssl.BUILD",
+)
+
+bind(
+    name = "ssl",
+    actual = "@openssl//:ssl"
+)
+
+
+http_archive(
+    name = "bazel_skylib",

Review Comment:
   duplicated with line 29



##########
example/bazel_1_3_release/test/test.cpp:
##########
@@ -0,0 +1,23 @@
+// Licensed to the Apache Software Foundation (ASF) under one
+// or more contributor license agreements.  See the NOTICE file
+// distributed with this work for additional information
+// regarding copyright ownership.  The ASF licenses this file
+// to you under the Apache License, Version 2.0 (the
+// "License"); you may not use this file except in compliance
+// with the License.  You may obtain a copy of the License at
+//
+//   http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing,
+// software distributed under the License is distributed on an
+// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+// KIND, either express or implied.  See the License for the
+// specific language governing permissions and limitations
+// under the License.
+
+#include <bthread/execution_queue.h>
+
+int main () {
+  //

Review Comment:
   you may call some bthread function here



##########
example/bazel_1_3_release/WORKSPACE_example:
##########
@@ -0,0 +1,113 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+#
+#   http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied.  See the License for the
+# specific language governing permissions and limitations
+# under the License.
+
+workspace(name="test_project")
+load("@bazel_tools//tools/build_defs/repo:git.bzl", "git_repository", 
"new_git_repository")
+load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")
+
+
+BAZEL_SKYLIB_VERSION = "1.1.1"  # 2021-09-27T17:33:49Z
+
+BAZEL_SKYLIB_SHA256 = 
"c6966ec828da198c5d9adbaa94c05e3a1c7f21bd012a0b29ba8ddbccb2c93b0d"
+
+
+http_archive(
+    name = "bazel_skylib",
+    sha256 = BAZEL_SKYLIB_SHA256,
+    urls = [
+        
"https://github.com/bazelbuild/bazel-skylib/releases/download/{version}/bazel-skylib-{version}.tar.gz".format(version
 = BAZEL_SKYLIB_VERSION),
+        
"https://mirror.bazel.build/github.com/bazelbuild/bazel-skylib/releases/download/{version}/bazel-skylib-{version}.tar.gz".format(version
 = BAZEL_SKYLIB_VERSION),
+    ],
+)
+
+# build for bRPC
+http_archive(
+    name = "com_google_protobuf",  # 2021-10-29T00:04:02Z
+    build_file = "//build_brpc/protobuf:protobuf.BUILD",
+    patch_cmds = [
+        "sed -i protobuf.bzl -re '4,4d;417,508d'",
+    ],
+    patch_cmds_win = [
+        """$content = Get-Content 'protobuf.bzl' | Where-Object {
+    -not ($_.ReadCount -ne 4) -and
+    -not ($_.ReadCount -ge 418 -and $_.ReadCount -le 509)
+}
+Set-Content protobuf.bzl -Value $content -Encoding UTF8
+""",
+    ],
+    sha256 = 
"87407cd28e7a9c95d9f61a098a53cf031109d451a7763e7dd1253abf8b4df422",
+    strip_prefix = "protobuf-3.19.1",
+    urls = 
["https://github.com/protocolbuffers/protobuf/archive/refs/tags/v3.19.1.tar.gz";],
+)
+
+
+BAZEL_SKYLIB_VERSION = "1.1.1"  # 2021-09-27T17:33:49Z
+
+BAZEL_SKYLIB_SHA256 = 
"c6966ec828da198c5d9adbaa94c05e3a1c7f21bd012a0b29ba8ddbccb2c93b0d"

Review Comment:
   duplicated with line 25



##########
docs/cn/bazel_support.md:
##########
@@ -0,0 +1,14 @@
+## bRPC 作为Bazel第三方依赖
+1. bRPC 依赖于一些开源库, 但这些库并没有提供bazel支持, 所以需要你手动将一部分依赖加入到你的构建项目中.
+2. 将 /example/bazel_1_3_release/build_for_brpc 该文件移动到你的项目根目录下, 将 
/example/bazel_1_3_release/build_for_brpc/WORKSPACE_eample 内容添加到你的WORKSPACE中.

Review Comment:
   you may change the directory name from `bazel_1_3_release` to 
`build_with_bazel` since there is an existing directory named 
`build_with_old_bazel`
   And you can follow the directory structure of `build_with_old_bazel`



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to