Skip to content

Commit

Permalink
upgrade dependency in example
Browse files Browse the repository at this point in the history
  • Loading branch information
oathdruid committed Oct 25, 2024
1 parent 694b334 commit 0e0e1c6
Show file tree
Hide file tree
Showing 42 changed files with 53 additions and 88 deletions.
2 changes: 0 additions & 2 deletions example/anyflow/.bazelrc

This file was deleted.

2 changes: 1 addition & 1 deletion example/anyflow/.bazelversion
Original file line number Diff line number Diff line change
@@ -1 +1 @@
7.3.2
7.4.0
2 changes: 1 addition & 1 deletion example/anyflow/MODULE.bazel
Original file line number Diff line number Diff line change
@@ -1 +1 @@
bazel_dep(name = 'babylon', version = '1.4.0')
bazel_dep(name = 'babylon', version = '1.4.1')
2 changes: 0 additions & 2 deletions example/depend-use-bzlmod/.bazelrc

This file was deleted.

2 changes: 1 addition & 1 deletion example/depend-use-bzlmod/.bazelversion
Original file line number Diff line number Diff line change
@@ -1 +1 @@
7.3.2
7.4.0
2 changes: 1 addition & 1 deletion example/depend-use-bzlmod/MODULE.bazel
Original file line number Diff line number Diff line change
@@ -1 +1 @@
bazel_dep(name = 'babylon', version = '1.4.0')
bazel_dep(name = 'babylon', version = '1.4.1')
12 changes: 2 additions & 10 deletions example/depend-use-bzlmod/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,21 +2,13 @@

## 使用方法

- 增加仓库注册表
```
# in .bazelrc
# babylon自身发布在独立注册表
common --registry=https://bcr.bazel.build
common --registry=https://baidu.github.io/babylon/registry
```

- 增加依赖项
```
# in MODULE.bazel
bazel_dep(name = 'babylon', version = '1.4.0')
bazel_dep(name = 'babylon', version = '1.4.1')
```

- 添加依赖的子模块到编译目标,全部可用子模块可以参照[模块功能文档](../../README.md#模块功能文档),或者[BUILD](../../BUILD)文件,也可以直接添加All in One依赖目标`@babylon`
- 添加依赖的子模块到编译目标,全部可用子模块可以参照[模块功能文档](../../docs/README.zh-cn.md#模块功能文档),或者[BUILD](../../BUILD)文件,也可以直接添加All in One依赖目标`@babylon`
```
# in BUILD
cc_library(
Expand Down
4 changes: 2 additions & 2 deletions example/depend-use-cmake-fetch/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ set(BUILD_DEPS ON)
include(FetchContent)
FetchContent_Declare(
babylon
URL "https://github.com/baidu/babylon/releases/download/v1.4.0/v1.4.0.tar.gz"
URL_HASH SHA256=0dd2f1690e7dd842406a4e6d55c507ae224aa1ebac1089d43891b5015f9df2fc
URL "https://github.com/baidu/babylon/releases/download/v1.4.1/v1.4.1.tar.gz"
URL_HASH SHA256=930e8d24822a472466e8b616011a57c37021b02486ad19ee7b62c12bfef923b8
)
FetchContent_MakeAvailable(babylon)

Expand Down
4 changes: 2 additions & 2 deletions example/depend-use-cmake-fetch/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ set(BUILD_DEPS ON)
include(FetchContent)
FetchContent_Declare(
babylon
URL "https://github.com/baidu/babylon/releases/download/v1.4.0/v1.4.0.tar.gz"
URL_HASH SHA256=0dd2f1690e7dd842406a4e6d55c507ae224aa1ebac1089d43891b5015f9df2fc
URL "https://github.com/baidu/babylon/releases/download/v1.4.1/v1.4.1.tar.gz"
URL_HASH SHA256=930e8d24822a472466e8b616011a57c37021b02486ad19ee7b62c12bfef923b8
)
FetchContent_MakeAvailable(babylon)
```
Expand Down
8 changes: 4 additions & 4 deletions example/depend-use-cmake-find/build.sh
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
#!/bin/sh
set -ex

URL=https://github.com/baidu/babylon/releases/download/v1.4.0/v1.4.0.tar.gz
NAME=babylon-1.4.0
SHA256=0dd2f1690e7dd842406a4e6d55c507ae224aa1ebac1089d43891b5015f9df2fc
URL=https://github.com/baidu/babylon/releases/download/v1.4.1/v1.4.1.tar.gz
NAME=babylon-1.4.1
SHA256=930e8d24822a472466e8b616011a57c37021b02486ad19ee7b62c12bfef923b8
if ! echo "$SHA256 $NAME.tar.gz" | sha256sum -c; then
wget $URL --continue -O $NAME.tar.gz
fi
Expand All @@ -12,7 +12,7 @@ tar xzf $NAME.tar.gz
mv $NAME babylon

cd babylon
cmake -Bbuild -DCMAKE_INSTALL_PREFIX=$PWD/output -DBUILD_TESTING=OFF
cmake -Bbuild -DCMAKE_INSTALL_PREFIX=$PWD/output
cmake --build build
cmake --install build
cd -
Expand Down
6 changes: 3 additions & 3 deletions example/depend-use-cmake-subdir/build.sh
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
#!/bin/sh
set -ex

URL=https://github.com/baidu/babylon/releases/download/v1.4.0/v1.4.0.tar.gz
NAME=babylon-1.4.0
SHA256=0dd2f1690e7dd842406a4e6d55c507ae224aa1ebac1089d43891b5015f9df2fc
URL=https://github.com/baidu/babylon/releases/download/v1.4.1/v1.4.1.tar.gz
NAME=babylon-1.4.1
SHA256=930e8d24822a472466e8b616011a57c37021b02486ad19ee7b62c12bfef923b8
if ! echo "$SHA256 $NAME.tar.gz" | sha256sum -c; then
wget $URL --continue -O $NAME.tar.gz
fi
Expand Down
1 change: 0 additions & 1 deletion example/depend-use-workspace/.bazelrc

This file was deleted.

2 changes: 1 addition & 1 deletion example/depend-use-workspace/.bazelversion
Original file line number Diff line number Diff line change
@@ -1 +1 @@
7.3.1
7.4.0
8 changes: 4 additions & 4 deletions example/depend-use-workspace/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@
# in WORKSPACE
http_archive(
name = 'com_baidu_babylon',
urls = ['https://github.com/baidu/babylon/releases/download/v1.4.0/v1.4.0.tar.gz'],
strip_prefix = 'babylon-1.4.0',
sha256 = '0dd2f1690e7dd842406a4e6d55c507ae224aa1ebac1089d43891b5015f9df2fc',
urls = ['https://github.com/baidu/babylon/releases/download/v1.4.1/v1.4.1.tar.gz'],
strip_prefix = 'babylon-1.4.1',
sha256 = '930e8d24822a472466e8b616011a57c37021b02486ad19ee7b62c12bfef923b8',
)
```

Expand All @@ -19,7 +19,7 @@ http_archive(
... // 增加babylon的WORKSPACE内的依赖项,注意和项目已有依赖去重合并
```

- 添加依赖的子模块到编译目标,全部可用子模块可以参照[模块功能文档](../../README.md#模块功能文档),或者[BUILD](../../BUILD)文件,也可以直接添加All in One依赖目标`@com_baidu_babylon//:babylon`
- 添加依赖的子模块到编译目标,全部可用子模块可以参照[模块功能文档](../../docs/README.zh-cn.md#模块功能文档),或者[BUILD](../../BUILD)文件,也可以直接添加All in One依赖目标`@com_baidu_babylon//:babylon`
```
# in BUILD
cc_library(
Expand Down
20 changes: 10 additions & 10 deletions example/depend-use-workspace/WORKSPACE
Original file line number Diff line number Diff line change
Expand Up @@ -6,28 +6,28 @@ load('@bazel_tools//tools/build_defs/repo:http.bzl', 'http_archive')
# babylon
http_archive(
name = 'com_baidu_babylon',
urls = ['https://github.com/baidu/babylon/releases/download/v1.4.0/v1.4.0.tar.gz'],
strip_prefix = 'babylon-1.4.0',
sha256 = '0dd2f1690e7dd842406a4e6d55c507ae224aa1ebac1089d43891b5015f9df2fc',
urls = ['https://github.com/baidu/babylon/releases/download/v1.4.1/v1.4.1.tar.gz'],
strip_prefix = 'babylon-1.4.1',
sha256 = '930e8d24822a472466e8b616011a57c37021b02486ad19ee7b62c12bfef923b8',
)
################################################################################

################################################################################
# copy from WORKSPACE of babylon
http_archive(
name = 'com_google_absl',
urls = ['https://github.com/abseil/abseil-cpp/archive/refs/tags/20211102.0.tar.gz'],
strip_prefix = 'abseil-cpp-20211102.0',
sha256 = 'dcf71b9cba8dc0ca9940c4b316a0c796be8fab42b070bb6b7cab62b48f0e66c4',
urls = ['https://github.com/abseil/abseil-cpp/archive/refs/tags/20220623.1.tar.gz'],
strip_prefix = 'abseil-cpp-20220623.1',
sha256 = '91ac87d30cc6d79f9ab974c51874a704de9c2647c40f6932597329a282217ba8',
)

http_archive(
name = 'com_google_protobuf',
urls = ['https://github.com/protocolbuffers/protobuf/archive/refs/tags/v3.19.6.tar.gz'],
urls = ['https://github.com/protocolbuffers/protobuf/archive/refs/tags/v3.19.6.zip'],
strip_prefix = 'protobuf-3.19.6',
sha256 = '9a301cf94a8ddcb380b901e7aac852780b826595075577bb967004050c835056',
sha256 = '387e2c559bb2c7c1bc3798c4e6cff015381a79b2758696afcbf8e88730b47389',
)
load("@com_google_protobuf//:protobuf_deps.bzl", "protobuf_deps")
load('@com_google_protobuf//:protobuf_deps.bzl', 'protobuf_deps')
protobuf_deps()

http_archive(
Expand All @@ -36,6 +36,6 @@ http_archive(
strip_prefix = 'rules_boost-4ab574f9a84b42b1809978114a4664184716f4bf',
sha256 = '2215e6910eb763a971b1f63f53c45c0f2b7607df38c96287666d94d954da8cdc',
)
load("@com_github_nelhage_rules_boost//:boost/boost.bzl", "boost_deps")
load('@com_github_nelhage_rules_boost//:boost/boost.bzl', 'boost_deps')
boost_deps()
################################################################################
2 changes: 1 addition & 1 deletion example/depend-use-workspace/build.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/sh
set -ex

bazel run example
bazel run --enable_bzlmod=false example
2 changes: 0 additions & 2 deletions example/use-anyflow-with-brpc/.bazelrc

This file was deleted.

2 changes: 1 addition & 1 deletion example/use-anyflow-with-brpc/.bazelversion
Original file line number Diff line number Diff line change
@@ -1 +1 @@
7.3.2
7.4.0
2 changes: 1 addition & 1 deletion example/use-anyflow-with-brpc/MODULE.bazel
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
bazel_dep(name = 'babylon', version = '1.4.0')
bazel_dep(name = 'babylon', version = '1.4.1')
bazel_dep(name = 'brpc', version = '1.10.0.bcr.1')
bazel_dep(name = 'yaml-cpp', version = '0.8.0')
2 changes: 1 addition & 1 deletion example/use-anyflow-with-brpc/build.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/sh
set -ex

bazel build server client
bazel build --registry=https://bcr.bazel.build --registry=https://baidu.github.io/babylon/registry server client
4 changes: 0 additions & 4 deletions example/use-arena-with-brpc/.bazelrc

This file was deleted.

2 changes: 1 addition & 1 deletion example/use-arena-with-brpc/MODULE.bazel
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
bazel_dep(name = 'babylon', version = '1.4.0')
bazel_dep(name = 'babylon', version = '1.4.1')
bazel_dep(name = 'brpc', version = '1.9.0.bcr.1')
bazel_dep(name = 'tcmalloc', version = '0.0.0-20240411-5ed309d')
single_version_override(module_name = 'protobuf', version = '25.3.arenastring')
2 changes: 1 addition & 1 deletion example/use-arena-with-brpc/build.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/sh
set -ex

bazel build client server
bazel build --registry=https://bcr.bazel.build --registry=https://baidu.github.io/babylon/registry --compilation_mode=opt --cxxopt=-std=c++17 client server
4 changes: 0 additions & 4 deletions example/use-async-logger/.bazelrc

This file was deleted.

2 changes: 1 addition & 1 deletion example/use-async-logger/.bazelversion
Original file line number Diff line number Diff line change
@@ -1 +1 @@
7.3.2
7.4.0
2 changes: 1 addition & 1 deletion example/use-async-logger/MODULE.bazel
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
bazel_dep(name = 'babylon', version = '1.4.0')
bazel_dep(name = 'babylon', version = '1.4.1')
bazel_dep(name = 'brpc', version = '1.10.0.bcr.1')
bazel_dep(name = 'spdlog', version = '1.14.1')
bazel_dep(name = 'tcmalloc', version = '0.0.0-20240411-5ed309d')
Expand Down
2 changes: 1 addition & 1 deletion example/use-async-logger/build.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/sh
set -ex

bazel build example
bazel build --registry=https://bcr.bazel.build --registry=https://baidu.github.io/babylon/registry --compilation_mode=opt --cxxopt=-std=c++17 example
4 changes: 0 additions & 4 deletions example/use-counter-with-bvar/.bazelrc

This file was deleted.

2 changes: 1 addition & 1 deletion example/use-counter-with-bvar/.bazelversion
Original file line number Diff line number Diff line change
@@ -1 +1 @@
7.3.2
7.4.0
2 changes: 1 addition & 1 deletion example/use-counter-with-bvar/MODULE.bazel
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
bazel_dep(name = 'babylon', version = '1.4.0')
bazel_dep(name = 'babylon', version = '1.4.1')
bazel_dep(name = 'brpc', version = '1.10.0.bcr.1')
bazel_dep(name = 'tcmalloc', version = '0.0.0-20240411-5ed309d')
single_version_override(module_name = 'protobuf', version = '3.19.6')
2 changes: 1 addition & 1 deletion example/use-counter-with-bvar/build.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/sh
set -ex

bazel build example
bazel build --registry=https://bcr.bazel.build --registry=https://baidu.github.io/babylon/registry --compilation_mode=opt --cxxopt=-std=c++17 example
4 changes: 0 additions & 4 deletions example/use-execution-queue/.bazelrc

This file was deleted.

2 changes: 1 addition & 1 deletion example/use-execution-queue/.bazelversion
Original file line number Diff line number Diff line change
@@ -1 +1 @@
7.3.2
7.4.0
2 changes: 1 addition & 1 deletion example/use-execution-queue/MODULE.bazel
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
bazel_dep(name = 'babylon', version = '1.4.0')
bazel_dep(name = 'babylon', version = '1.4.1')
bazel_dep(name = 'brpc', version = '1.10.0.bcr.1')
bazel_dep(name = 'tcmalloc', version = '0.0.0-20240411-5ed309d')
single_version_override(module_name = 'protobuf', version = '3.19.6')
2 changes: 1 addition & 1 deletion example/use-execution-queue/build.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/sh
set -ex

bazel build example
bazel build --registry=https://bcr.bazel.build --registry=https://baidu.github.io/babylon/registry --compilation_mode=opt --cxxopt=-std=c++17 example
2 changes: 0 additions & 2 deletions example/use-with-bthread/.bazelrc

This file was deleted.

2 changes: 1 addition & 1 deletion example/use-with-bthread/.bazelversion
Original file line number Diff line number Diff line change
@@ -1 +1 @@
7.3.2
7.4.0
2 changes: 1 addition & 1 deletion example/use-with-bthread/MODULE.bazel
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
bazel_dep(name = 'babylon', version = '1.4.0')
bazel_dep(name = 'babylon', version = '1.4.1')
bazel_dep(name = 'brpc', version = '1.10.0.bcr.1')
4 changes: 2 additions & 2 deletions example/use-with-bthread/build.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#!/bin/sh
set -ex

bazel run example
bazel run anyflow_multi_nodes
bazel run --registry=https://bcr.bazel.build --registry=https://baidu.github.io/babylon/registry example
bazel run --registry=https://bcr.bazel.build --registry=https://baidu.github.io/babylon/registry anyflow_multi_nodes
2 changes: 0 additions & 2 deletions example/use-with-glog/.bazelrc

This file was deleted.

2 changes: 1 addition & 1 deletion example/use-with-glog/.bazelversion
Original file line number Diff line number Diff line change
@@ -1 +1 @@
7.3.2
7.4.0
2 changes: 1 addition & 1 deletion example/use-with-glog/MODULE.bazel
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
bazel_dep(name = 'babylon', version = '1.4.0')
bazel_dep(name = 'babylon', version = '1.4.1')
bazel_dep(name = 'glog', version = '0.7.1')

0 comments on commit 0e0e1c6

Please sign in to comment.