Skip to content

Commit 8f6914e

Browse files
committed
replace usage in bigtable
1 parent 172e088 commit 8f6914e

File tree

8 files changed

+3
-84
lines changed

8 files changed

+3
-84
lines changed

ci/cloudbuild/dockerfiles/demo-debian-bookworm.Dockerfile

Lines changed: 0 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -58,27 +58,6 @@ RUN curl -fsSL https://distfiles.ariadne.space/pkgconf/pkgconf-2.2.0.tar.gz | \
5858
ENV PKG_CONFIG_PATH=/usr/lib/x86_64-linux-gnu/pkgconfig:/usr/local/lib/pkgconfig
5959
# ```
6060

61-
# #### crc32c
62-
63-
# The project depends on the Crc32c library, we need to compile this from
64-
# source:
65-
66-
# ```bash
67-
WORKDIR /var/tmp/build/crc32c
68-
RUN curl -fsSL https://github.com/google/crc32c/archive/1.1.2.tar.gz | \
69-
tar -xzf - --strip-components=1 && \
70-
cmake \
71-
-DCMAKE_BUILD_TYPE=Release \
72-
-DBUILD_SHARED_LIBS=yes \
73-
-DCRC32C_BUILD_TESTS=OFF \
74-
-DCRC32C_BUILD_BENCHMARKS=OFF \
75-
-DCRC32C_USE_GLOG=OFF \
76-
-S . -B cmake-out && \
77-
cmake --build cmake-out -- -j ${NCPU:-4} && \
78-
cmake --build cmake-out --target install -- -j ${NCPU:-4} && \
79-
ldconfig
80-
# ```
81-
8261
# #### abseil
8362
WORKDIR /var/tmp/build/abseil-cpp
8463
RUN curl -fsSL https://github.com/abseil/abseil-cpp/archive/20250127.1.tar.gz | \

ci/cloudbuild/dockerfiles/demo-ubuntu-24.04.Dockerfile

Lines changed: 0 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -62,28 +62,6 @@ RUN curl -fsSL https://distfiles.ariadne.space/pkgconf/pkgconf-2.2.0.tar.gz | \
6262
RUN ln -s /usr/bin/pkgconf /usr/bin/pkg-config
6363
# ```
6464

65-
66-
# #### crc32c
67-
68-
# The project depends on the Crc32c library, we need to compile this from
69-
# source:
70-
71-
# ```bash
72-
WORKDIR /var/tmp/build/crc32c
73-
RUN curl -fsSL https://github.com/google/crc32c/archive/1.1.2.tar.gz | \
74-
tar -xzf - --strip-components=1 && \
75-
cmake \
76-
-DCMAKE_BUILD_TYPE=Release \
77-
-DBUILD_SHARED_LIBS=yes \
78-
-DCRC32C_BUILD_TESTS=OFF \
79-
-DCRC32C_BUILD_BENCHMARKS=OFF \
80-
-DCRC32C_USE_GLOG=OFF \
81-
-S . -B cmake-out && \
82-
cmake --build cmake-out -- -j ${NCPU:-4} && \
83-
cmake --build cmake-out --target install -- -j ${NCPU:-4} && \
84-
ldconfig
85-
# ```
86-
8765
# #### abseil
8866
WORKDIR /var/tmp/build/abseil-cpp
8967
RUN curl -fsSL https://github.com/abseil/abseil-cpp/archive/20250127.1.tar.gz | \

google/cloud/bigtable/CMakeLists.txt

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,6 @@ include(CTest)
4848
include(CreateBazelConfig)
4949

5050
find_package(opentelemetry-cpp CONFIG)
51-
find_package(Crc32c)
5251

5352
# the client library
5453
add_library(
@@ -297,7 +296,6 @@ target_link_libraries(
297296
google-cloud-cpp::bigtable_protos
298297
google-cloud-cpp::common
299298
google-cloud-cpp::grpc_utils
300-
Crc32c::crc32c
301299
gRPC::grpc++
302300
gRPC::grpc
303301
protobuf::libprotobuf)
@@ -354,9 +352,7 @@ google_cloud_cpp_add_pkgconfig(
354352
"google_cloud_cpp_grpc_utils"
355353
"google_cloud_cpp_common"
356354
"google_cloud_cpp_bigtable_protos"
357-
${EXTRA_MODULES}
358-
LIBS
359-
crc32c)
355+
${EXTRA_MODULES})
360356

361357
# Create and install the CMake configuration files.
362358
include(CMakePackageConfigHelpers)

google/cloud/bigtable/config.cmake.in

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,5 @@ find_dependency(google_cloud_cpp_common)
1919
find_dependency(google_cloud_cpp_grpc_utils)
2020
find_dependency(google_cloud_cpp_opentelemetry)
2121
find_dependency(absl)
22-
find_dependency(Crc32c)
2322

2423
include("${CMAKE_CURRENT_LIST_DIR}/google_cloud_cpp_bigtable-targets.cmake")

google/cloud/bigtable/internal/crc32c.cc

Lines changed: 2 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -14,22 +14,16 @@
1414

1515
#include "google/cloud/bigtable/internal/crc32c.h"
1616
#include "absl/base/config.h"
17-
#if defined(ABSL_LTS_RELEASE_VERSION) && ABSL_LTS_RELEASE_VERSION >= 20230125
1817
#include "absl/crc/crc32c.h"
19-
#define GOOGLE_CLOUD_CPP_USE_ABSL_CRC32C 1
20-
#else
21-
#define GOOGLE_CLOUD_CPP_USE_ABSL_CRC32C 0
22-
#endif // ABSL_LTS_RELEASE_VERSION
23-
#include <crc32c/crc32c.h>
2418

2519
namespace google {
2620
namespace cloud {
2721
namespace bigtable_internal {
2822
GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN
2923

3024
std::uint32_t ExtendCrc32c(std::uint32_t crc, absl::string_view data) {
31-
return crc32c::Extend(crc, reinterpret_cast<uint8_t const*>(data.data()),
32-
data.size());
25+
return static_cast<std::uint32_t>(
26+
absl::ExtendCrc32c(absl::crc32c_t{crc}, data));
3327
}
3428

3529
std::uint32_t ExtendCrc32c(std::uint32_t crc,
@@ -47,8 +41,6 @@ std::uint32_t ExtendCrc32c(std::uint32_t crc, absl::Cord const& data) {
4741
return crc;
4842
}
4943

50-
#if GOOGLE_CLOUD_CPP_USE_ABSL_CRC32C
51-
5244
std::uint32_t ExtendCrc32c(std::uint32_t crc, absl::string_view data,
5345
std::uint32_t data_crc) {
5446
return static_cast<std::uint32_t>(absl::ConcatCrc32c(
@@ -69,26 +61,6 @@ std::uint32_t ExtendCrc32c(std::uint32_t crc, absl::Cord const& data,
6961
absl::crc32c_t{crc}, absl::crc32c_t{data_crc}, data.size()));
7062
}
7163

72-
#else
73-
74-
std::uint32_t ExtendCrc32c(std::uint32_t crc, absl::string_view data,
75-
std::uint32_t /*data_crc*/) {
76-
return ExtendCrc32c(crc, data);
77-
}
78-
79-
std::uint32_t ExtendCrc32c(std::uint32_t crc,
80-
bigtable_internal::ConstBufferSequence const& data,
81-
std::uint32_t /*data_crc*/) {
82-
return ExtendCrc32c(crc, data);
83-
}
84-
85-
std::uint32_t ExtendCrc32c(std::uint32_t crc, absl::Cord const& data,
86-
std::uint32_t /*data_crc*/) {
87-
return ExtendCrc32c(crc, data);
88-
}
89-
90-
#endif // GOOGLE_CLOUD_CPP_USE_ABSL_CRC32C
91-
9264
GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END
9365
} // namespace bigtable_internal
9466
} // namespace cloud

google/cloud/storage/CMakeLists.txt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,6 @@ google_cloud_cpp_doxygen_targets("storage" DEPENDS cloud-docs
3131
include(GoogleCloudCppCommon)
3232

3333
include(IncludeNlohmannJson)
34-
find_package(Crc32c)
3534

3635
# Export the version information for Bazel.
3736
include(CreateBazelConfig)

google/cloud/storage/config.cmake.in

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@ find_dependency(google_cloud_cpp_rest_internal)
1717
find_dependency(google_cloud_cpp_common)
1818
find_dependency(absl)
1919
find_dependency(CURL)
20-
find_dependency(Crc32c)
2120
find_dependency(nlohmann_json)
2221
if (NOT WIN32)
2322
find_dependency(OpenSSL)

google/cloud/storage/google_cloud_cpp_storage.cmake

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -268,7 +268,6 @@ target_link_libraries(
268268
google-cloud-cpp::common
269269
google-cloud-cpp::rest_internal
270270
nlohmann_json::nlohmann_json
271-
Crc32c::crc32c
272271
CURL::libcurl
273272
Threads::Threads)
274273
if (WIN32)
@@ -342,8 +341,6 @@ google_cloud_cpp_add_pkgconfig(
342341
"absl_variant"
343342
NON_WIN32_REQUIRES
344343
openssl
345-
LIBS
346-
crc32c
347344
WIN32_LIBS
348345
ws2_32
349346
bcrypt)

0 commit comments

Comments
 (0)