Skip to content

Commit

Permalink
GH-35879: [C++] Bump bundled google-cloud-cpp to 2.12.0 (#36119)
Browse files Browse the repository at this point in the history
### Rationale for this change

The version will fix #35318.

### What changes are included in this PR?

Use the latest released version.

### Are these changes tested?

Yes.

### Are there any user-facing changes?

Yes.
* Closes: #35879

Authored-by: Sutou Kouhei <kou@clear-code.com>
Signed-off-by: Sutou Kouhei <kou@clear-code.com>
  • Loading branch information
kou authored Jun 27, 2023
1 parent d62617b commit 4cfe9fa
Show file tree
Hide file tree
Showing 6 changed files with 41 additions and 7 deletions.
16 changes: 15 additions & 1 deletion cpp/cmake_modules/ThirdpartyToolchain.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -623,6 +623,7 @@ if(DEFINED ENV{ARROW_GOOGLE_CLOUD_CPP_URL})
else()
set_urls(google_cloud_cpp_storage_SOURCE_URL
"https://github.com/googleapis/google-cloud-cpp/archive/${ARROW_GOOGLE_CLOUD_CPP_BUILD_VERSION}.tar.gz"
"${THIRDPARTY_MIRROR_URL}/google-cloud-cpp-${ARROW_GOOGLE_CLOUD_CPP_BUILD_VERSION}.tar.gz"
)
endif()

Expand Down Expand Up @@ -4188,6 +4189,7 @@ macro(build_google_cloud_cpp_storage)
set_property(TARGET google-cloud-cpp::common
PROPERTY INTERFACE_LINK_LIBRARIES
absl::base
absl::cord
absl::memory
absl::optional
absl::span
Expand Down Expand Up @@ -4253,13 +4255,25 @@ macro(build_google_cloud_cpp_storage)
absl::bad_variant_access
absl::base
absl::civil_time
absl::cord
absl::cord_internal
absl::cordz_functions
absl::cordz_info
absl::cordz_handle
absl::debugging_internal
absl::demangle_internal
absl::exponential_biased
absl::int128
absl::log_severity
absl::malloc_internal
absl::raw_logging_internal
absl::spinlock_wait
absl::stacktrace
absl::str_format_internal
absl::strings
absl::strings_internal
absl::str_format_internal
absl::symbolize
absl::synchronization
absl::throw_delegate
absl::time
absl::time_zone
Expand Down
4 changes: 2 additions & 2 deletions cpp/thirdparty/versions.txt
Original file line number Diff line number Diff line change
Expand Up @@ -69,8 +69,8 @@ ARROW_GFLAGS_BUILD_VERSION=v2.2.2
ARROW_GFLAGS_BUILD_SHA256_CHECKSUM=34af2f15cf7367513b352bdcd2493ab14ce43692d2dcd9dfc499492966c64dcf
ARROW_GLOG_BUILD_VERSION=v0.5.0
ARROW_GLOG_BUILD_SHA256_CHECKSUM=eede71f28371bf39aa69b45de23b329d37214016e2055269b3b5e7cfd40b59f5
ARROW_GOOGLE_CLOUD_CPP_BUILD_VERSION=v2.8.0
ARROW_GOOGLE_CLOUD_CPP_BUILD_SHA256_CHECKSUM=21fb441b5a670a18bb16b6826be8e0530888d0b94320847c538d46f5a54dddbc
ARROW_GOOGLE_CLOUD_CPP_BUILD_VERSION=v2.12.0
ARROW_GOOGLE_CLOUD_CPP_BUILD_SHA256_CHECKSUM=8cda870803925c62de8716a765e03eb9d34249977e5cdb7d0d20367e997a55e2
ARROW_GRPC_BUILD_VERSION=v1.46.3
ARROW_GRPC_BUILD_SHA256_CHECKSUM=d6cbf22cb5007af71b61c6be316a79397469c58c82a942552a62e708bce60964
ARROW_GTEST_BUILD_VERSION=1.11.0
Expand Down
3 changes: 2 additions & 1 deletion r/R/filesystem.R
Original file line number Diff line number Diff line change
Expand Up @@ -181,6 +181,7 @@ FileSelector$create <- function(base_dir, allow_not_found = FALSE, recursive = F
#' - `retry_limit_seconds`: the maximum amount of time to spend retrying if
#' the filesystem encounters errors. Default is 15 seconds.
#' - `default_metadata`: default metadata to write in new objects.
#' - `project_id`: the project to use for creating buckets.
#'
#' @section Methods:
#'
Expand Down Expand Up @@ -562,7 +563,7 @@ GcsFileSystem$create <- function(anonymous = FALSE, retry_limit_seconds = 15, ..

valid_opts <- c(
"access_token", "expiration", "json_credentials", "endpoint_override",
"scheme", "default_bucket_location", "default_metadata"
"scheme", "default_bucket_location", "default_metadata", "project_id"
)

invalid_opts <- setdiff(names(options), valid_opts)
Expand Down
2 changes: 1 addition & 1 deletion r/configure.win
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ AWS_LIBS="-laws-cpp-sdk-config -laws-cpp-sdk-transfer -laws-cpp-sdk-identity-man
-lUserenv -lversion -lws2_32 -lBcrypt -lWininet -lwinhttp"
# pkg-config --libs libcurl
GCS_LIBS="-lcurl -lnormaliz -lssh2 -lgdi32 -lssl -lcrypto -lcrypt32 -lwldap32 \
-lz -lws2_32 -lnghttp2"
-lz -lws2_32 -lnghttp2 -ldbghelp"

function configure_release() {
VERSION=$(grep ^Version DESCRIPTION | sed s/Version:\ //)
Expand Down
13 changes: 13 additions & 0 deletions r/src/filesystem.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -425,6 +425,15 @@ std::shared_ptr<fs::GcsFileSystem> fs___GcsFileSystem__Make(bool anonymous,
gcs_opts.default_metadata = strings_to_kvm(options["default_metadata"]);
}

// /// \brief The project to use for creating buckets.
// ///
// /// If not set, the library uses the GOOGLE_CLOUD_PROJECT environment
// /// variable. Most I/O operations do not need a project id, only applications
// /// that create new buckets need a project id.
if (!Rf_isNull(options["project_id"])) {
gcs_opts.project_id = cpp11::as_cpp<std::string>(options["project_id"]);
}

auto io_context = MainRThread::GetInstance().CancellableIOContext();
// TODO(ARROW-16884): update when this returns Result
return fs::GcsFileSystem::Make(gcs_opts, io_context);
Expand Down Expand Up @@ -487,6 +496,10 @@ cpp11::list fs___GcsFileSystem__options(const std::shared_ptr<fs::GcsFileSystem>
out.push_back({"default_metadata"_nm = metadata});
}

if (opts.project_id.has_value()) {
out.push_back({"project_id"_nm = opts.project_id.value()});
}

return out;
}

Expand Down
10 changes: 8 additions & 2 deletions r/tests/testthat/test-gcs.R
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,8 @@ fs <- GcsFileSystem$create(
endpoint_override = sprintf("localhost:%s", testbench_port),
retry_limit_seconds = 1,
scheme = "http",
anonymous = TRUE # Will fail to resolve host name if anonymous isn't TRUE
anonymous = TRUE, # Will fail to resolve host name if anonymous isn't TRUE
project_id = "test-project-id"
)

now <- as.character(as.numeric(Sys.time()))
Expand All @@ -155,7 +156,12 @@ gcs_path <- function(...) {
paste(now, ..., sep = "/")
}
gcs_uri <- function(...) {
template <- "gs://anonymous@%s?scheme=http&endpoint_override=localhost%s%s&retry_limit_seconds=1"
template <- paste0("gs://anonymous@%s?",
paste("scheme=http",
"endpoint_override=localhost%s%s",
"retry_limit_seconds=1",
"project_id=test-project-id",
sep = "&"))
sprintf(template, gcs_path(...), "%3A", testbench_port)
}

Expand Down

0 comments on commit 4cfe9fa

Please sign in to comment.