Skip to content

Commit

Permalink
fix aws and etcdclient dependency
Browse files Browse the repository at this point in the history
Change-Id: I6480a99a731e6b554f8d36ad3b6c469844187070
  • Loading branch information
wu-hanqing committed Jul 13, 2020
1 parent 7256b5d commit 6c34087
Show file tree
Hide file tree
Showing 10 changed files with 48 additions and 18 deletions.
12 changes: 12 additions & 0 deletions WORKSPACE
Original file line number Diff line number Diff line change
Expand Up @@ -133,3 +133,15 @@ bind(
name = "json",
actual = "@jsoncpp//:json",
)

new_local_repository(
name = "aws_sdk",
build_file = "bazel/aws-sdk.BUILD",
path = "thirdparties/aws-sdk/usr",
)

new_local_repository(
name = "etcdclient",
build_file = "bazel/etcdclient.BUILD",
path = "thirdparties/etcdclient",
)
15 changes: 15 additions & 0 deletions bazel/aws-sdk.BUILD
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
cc_library(
name = "aws_sdk",
srcs = glob([
"lib/lib*so",
]),
hdrs = glob([
"include/**/*.*",
]),
includes = [
"include",
],
visibility = [
"//visibility:public"
],
)
15 changes: 15 additions & 0 deletions bazel/etcdclient.BUILD
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
cc_library(
name = "etcdclient",
srcs = glob([
"libetcdclient.so",
]),
hdrs = glob([
"libetcdclient.h",
]),
includes = [
"."
],
visibility = [
"//visibility:public"
],
)
2 changes: 1 addition & 1 deletion include/etcdclient/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -21,4 +21,4 @@ cc_library(
"-letcdclient",
]),
visibility = ["//visibility:public"],
)
)
6 changes: 1 addition & 5 deletions src/common/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -84,14 +84,10 @@ cc_library(
"s3_adapter.cpp",
]),
copts = COPTS,
linkopts = [
"-laws-cpp-sdk-s3",
"-laws-cpp-sdk-core",
"-L/usr/local/lib"
],
visibility = ["//visibility:public"],
deps = [
"//external:glog",
"//src/common:curve_common",
"@aws_sdk//:aws_sdk",
],
)
2 changes: 1 addition & 1 deletion src/common/s3_adapter.h
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@
#include <aws/core/utils/memory/stl/AWSStringStream.h> //NOLINT
#include <aws/s3/model/BucketLocationConstraint.h> //NOLINT
#include <aws/s3/model/CreateBucketConfiguration.h> //NOLINT
#include <aws/core/utils/threading/Executor.h> // NOLINT
#include <aws/core/utils/threading/Executor.h> // NOLINT
#include "src/common/configuration.h"

namespace curve {
Expand Down
2 changes: 1 addition & 1 deletion src/kvstorageclient/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,6 @@ cc_library(
"//external:glog",
"//external:gflags",
"//src/common:curve_common",
"//include/etcdclient:etcd_client",
"@etcdclient//:etcdclient",
],
)
4 changes: 1 addition & 3 deletions src/kvstorageclient/etcd_client.h
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,9 @@
#ifndef SRC_KVSTORAGECLIENT_ETCD_CLIENT_H_
#define SRC_KVSTORAGECLIENT_ETCD_CLIENT_H_

#include <libetcdclient.h>
#include <string>
#include <vector>
#include "include/etcdclient/etcdclient.h"

namespace curve {
namespace kvstorage {
Expand Down Expand Up @@ -236,5 +236,3 @@ class EtcdClientImp : public KVStorageClient {
} // namespace curve

#endif // SRC_KVSTORAGECLIENT_ETCD_CLIENT_H_


6 changes: 0 additions & 6 deletions src/snapshotcloneserver/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -53,11 +53,8 @@ cc_library(
"-ldl",
"-lz",
"-lpthread",
"-laws-cpp-sdk-core",
"-laws-cpp-sdk-s3",
"-lmysqlcppconn",
"-luuid",
"-L/usr/local/lib",
],
visibility = ["//visibility:public"],
deps = [
Expand Down Expand Up @@ -98,11 +95,8 @@ cc_binary(
"-ldl",
"-lz",
"-lpthread",
"-laws-cpp-sdk-core",
"-laws-cpp-sdk-s3",
"-lmysqlcppconn",
"-luuid",
"-L/usr/local/lib",
],
visibility = ["//visibility:public"],
deps = [
Expand Down
2 changes: 1 addition & 1 deletion test/client/libcbd_libcurve_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -295,7 +295,7 @@ TEST_F(TestLibcbdLibcurve, ReadAndCloseConcurrencyTest) {
ASSERT_GE(fd2, 0);

auto curvefsService = mds_->GetMDSService();
curvefsService->SetCloseFileTask([]() {
curvefsService->SetCloseFileTask([closeFileSleepS]() {
std::this_thread::sleep_for(std::chrono::seconds(closeFileSleepS));
});

Expand Down

0 comments on commit 6c34087

Please sign in to comment.