about summary refs log tree commit diff
path: root/nixpkgs/pkgs/development/libraries/google-cloud-cpp
diff options
context:
space:
mode:
authorAlyssa Ross <hi@alyssa.is>2022-01-03 23:55:00 +0000
committerAlyssa Ross <hi@alyssa.is>2022-02-19 11:03:39 +0000
commitf4cf97a04cd5d0b86aa46baec9fb228a8f671c03 (patch)
tree28192415ff39a661d0001563bf81cc93fa25d16d /nixpkgs/pkgs/development/libraries/google-cloud-cpp
parentf8422837c9bde058e8f2de37702e7e94b2226040 (diff)
parent18c84ea816348e2a098390101b92d1e39a9dbd45 (diff)
downloadnixlib-f4cf97a04cd5d0b86aa46baec9fb228a8f671c03.tar
nixlib-f4cf97a04cd5d0b86aa46baec9fb228a8f671c03.tar.gz
nixlib-f4cf97a04cd5d0b86aa46baec9fb228a8f671c03.tar.bz2
nixlib-f4cf97a04cd5d0b86aa46baec9fb228a8f671c03.tar.lz
nixlib-f4cf97a04cd5d0b86aa46baec9fb228a8f671c03.tar.xz
nixlib-f4cf97a04cd5d0b86aa46baec9fb228a8f671c03.tar.zst
nixlib-f4cf97a04cd5d0b86aa46baec9fb228a8f671c03.zip
Merge commit '18c84ea816348e2a098390101b92d1e39a9dbd45'
Conflicts:
	nixpkgs/nixos/modules/misc/documentation.nix
	nixpkgs/pkgs/applications/networking/browsers/firefox/packages.nix
	nixpkgs/pkgs/applications/window-managers/sway/default.nix
	nixpkgs/pkgs/build-support/rust/build-rust-package/default.nix
	nixpkgs/pkgs/development/go-modules/generic/default.nix
	nixpkgs/pkgs/development/interpreters/ruby/default.nix
	nixpkgs/pkgs/development/interpreters/ruby/patchsets.nix
	nixpkgs/pkgs/development/libraries/boehm-gc/7.6.6.nix
	nixpkgs/pkgs/development/python-modules/django-mailman3/default.nix
	nixpkgs/pkgs/servers/mail/mailman/web.nix
	nixpkgs/pkgs/top-level/aliases.nix
	nixpkgs/pkgs/top-level/all-packages.nix
	nixpkgs/pkgs/top-level/impure.nix
Diffstat (limited to 'nixpkgs/pkgs/development/libraries/google-cloud-cpp')
-rw-r--r--nixpkgs/pkgs/development/libraries/google-cloud-cpp/default.nix140
-rw-r--r--nixpkgs/pkgs/development/libraries/google-cloud-cpp/skipped_tests.toml112
2 files changed, 208 insertions, 44 deletions
diff --git a/nixpkgs/pkgs/development/libraries/google-cloud-cpp/default.nix b/nixpkgs/pkgs/development/libraries/google-cloud-cpp/default.nix
index d493f31d3750..870e919357e0 100644
--- a/nixpkgs/pkgs/development/libraries/google-cloud-cpp/default.nix
+++ b/nixpkgs/pkgs/development/libraries/google-cloud-cpp/default.nix
@@ -1,76 +1,128 @@
 { lib
 , stdenv
-, clang-tools
-, grpc
-, curl
+, fetchFromGitHub
+, abseil-cpp
+, c-ares
 , cmake
+, crc32c
+, curl
+, gbenchmark
+, grpc
+, gtest
+, ninja
+, nlohmann_json
 , pkg-config
-, fetchFromGitHub
-, doxygen
 , protobuf
-, crc32c
-, fetchurl
-, openssl
-, libnsl
+  # default list of APIs: https://github.com/googleapis/google-cloud-cpp/blob/v1.32.1/CMakeLists.txt#L173
+, apis ? [ "*" ]
+, staticOnly ? stdenv.hostPlatform.isStatic
 }:
 let
+  googleapisRev = "ed739492993c4a99629b6430affdd6c0fb59d435";
   googleapis = fetchFromGitHub {
     owner = "googleapis";
     repo = "googleapis";
-    rev = "9c9f778aedde02f9826d2ae5d0f9c96409ba0f25";
-    sha256 = "1gd3nwv8qf503wy6km0ad6akdvss9w5b1k3jqizy5gah1fkirkpi";
-  };
-  googleapis-cpp-cmakefiles = stdenv.mkDerivation rec {
-    pname = "googleapis-cpp-cmakefiles";
-    version = "0.1.5";
-    src = fetchFromGitHub {
-      owner = "googleapis";
-      repo = "cpp-cmakefiles";
-      rev = "v${version}";
-      sha256 = "02zkcq2wl831ayd9qy009xvfx7q80pgycx7mzz9vknwd0nn6dd0n";
-    };
-
-    nativeBuildInputs = [ cmake pkg-config ];
-    buildInputs = [ grpc openssl protobuf ];
-
-    postPatch = ''
-      sed -e 's,https://github.com/googleapis/googleapis/archive/9c9f778aedde02f9826d2ae5d0f9c96409ba0f25.tar.gz,file://${googleapis},' \
-      -i CMakeLists.txt
-    '';
-  };
-  _nlohmann_json = fetchurl {
-    url = "https://github.com/nlohmann/json/releases/download/v3.4.0/json.hpp";
-    sha256 = "0pw3jpi572irbp2dqclmyhgic6k9rxav5mpp9ygbp9xj48gnvnk3";
+    rev = googleapisRev;
+    hash = "sha256:1xrnh77vb8hxmf1ywqsifzd39kylhbdyah0b0b9bm7nw0mnahssl";
   };
-in stdenv.mkDerivation rec {
+  excludedTests = builtins.fromTOML (builtins.readFile ./skipped_tests.toml);
+in
+stdenv.mkDerivation rec {
   pname = "google-cloud-cpp";
-  version = "0.14.0";
+  version = "1.32.1";
 
   src = fetchFromGitHub {
     owner = "googleapis";
     repo = "google-cloud-cpp";
     rev = "v${version}";
-    sha256 = "15wci4m8h6py7fqfziq8mp5m6pxp2h1cbh5rp2k90mk5js4jb9pa";
+    sha256 = "0g720sni70nlncv4spm4rlfykdkpjnv81axfz2jd1arpdajm0mg9";
   };
 
-  buildInputs = [ curl crc32c googleapis-cpp-cmakefiles grpc protobuf libnsl ];
-  nativeBuildInputs = [ clang-tools cmake pkg-config doxygen ];
+  postPatch = ''
+    substituteInPlace external/googleapis/CMakeLists.txt \
+      --replace "https://github.com/googleapis/googleapis/archive/${googleapisRev}.tar.gz" "file://${googleapis}"
+  '';
+
+  nativeBuildInputs = [
+    cmake
+    ninja
+    pkg-config
+  ] ++ lib.optionals (!doInstallCheck) [
+    # enable these dependencies when doInstallCheck failse because we're
+    # unconditionally building tests and benchmarks
+    #
+    # when doInstallCheck is true, these deps are added to installCheckInputs
+    gbenchmark
+    gtest
+  ];
 
-  outputs = [ "out" "dev" ];
+  buildInputs = [
+    abseil-cpp
+    c-ares
+    crc32c
+    curl
+    grpc
+    nlohmann_json
+    protobuf
+  ];
 
-  postPatch = ''
-    sed -e 's,https://github.com/nlohmann/json/releases/download/v3.4.0/json.hpp,file://${_nlohmann_json},' \
-    -i cmake/DownloadNlohmannJson.cmake
+  doInstallCheck = true;
+
+  preInstallCheck =
+    let
+      # These paths are added to (DY)LD_LIBRARY_PATH because they contain
+      # testing-only shared libraries that do not need to be installed, but
+      # need to be loadable by the test executables.
+      #
+      # Setting (DY)LD_LIBRARY_PATH is only necessary when building shared libraries.
+      additionalLibraryPaths = [
+        "$PWD/google/cloud/bigtable"
+        "$PWD/google/cloud/bigtable/benchmarks"
+        "$PWD/google/cloud/pubsub"
+        "$PWD/google/cloud/spanner"
+        "$PWD/google/cloud/spanner/benchmarks"
+        "$PWD/google/cloud/storage"
+        "$PWD/google/cloud/storage/benchmarks"
+        "$PWD/google/cloud/testing_util"
+      ];
+      ldLibraryPathName = "${lib.optionalString stdenv.isDarwin "DY"}LD_LIBRARY_PATH";
+    in
+    lib.optionalString doInstallCheck (
+      lib.optionalString (!staticOnly) ''
+        export ${ldLibraryPathName}=${lib.concatStringsSep ":" additionalLibraryPaths}
+      '' + ''
+        export GTEST_FILTER="-${lib.concatStringsSep ":" excludedTests.cases}"
+      ''
+    );
+
+  installCheckPhase = lib.optionalString doInstallCheck ''
+    runHook preInstallCheck
+
+    # disable tests that contact the internet
+    ctest --exclude-regex '^(${lib.concatStringsSep "|" excludedTests.whole})'
+
+    runHook postInstallCheck
   '';
 
+  installCheckInputs = lib.optionals doInstallCheck [
+    gbenchmark
+    gtest
+  ];
+
   cmakeFlags = [
-    "-DBUILD_SHARED_LIBS:BOOL=ON"
+    "-DBUILD_SHARED_LIBS:BOOL=${if staticOnly then "OFF" else "ON"}"
+    # unconditionally build tests to catch linker errors as early as possible
+    # this adds a good chunk of time to the build
+    "-DBUILD_TESTING:BOOL=ON"
+    "-DGOOGLE_CLOUD_CPP_ENABLE_EXAMPLES:BOOL=OFF"
+  ] ++ lib.optionals (apis != [ "*" ]) [
+    "-DGOOGLE_CLOUD_CPP_ENABLE=${lib.concatStringsSep ";" apis}"
   ];
 
   meta = with lib; {
     license = with licenses; [ asl20 ];
     homepage = "https://github.com/googleapis/google-cloud-cpp";
     description = "C++ Idiomatic Clients for Google Cloud Platform services";
-    maintainers = with maintainers; [ ];
+    maintainers = with maintainers; [ cpcloud ];
   };
 }
diff --git a/nixpkgs/pkgs/development/libraries/google-cloud-cpp/skipped_tests.toml b/nixpkgs/pkgs/development/libraries/google-cloud-cpp/skipped_tests.toml
new file mode 100644
index 000000000000..c2fb2a24483a
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/google-cloud-cpp/skipped_tests.toml
@@ -0,0 +1,112 @@
+whole = [
+  "bigquery_bigquery_read_integration_test",
+  "bigtable_admin_backup_integration_test",
+  "bigtable_admin_iam_policy_integration_test",
+  "bigtable_admin_integration_test",
+  "bigtable_apply_read_latency_benchmark",
+  "bigtable_data_async_future_integration_test",
+  "bigtable_data_integration_test",
+  "bigtable_endurance_benchmark",
+  "bigtable_filters_integration_test",
+  "bigtable_mutation_batcher_throughput_benchmark",
+  "bigtable_mutations_integration_test",
+  "bigtable_read_sync_vs_async_benchmark",
+  "bigtable_scan_throughput_benchmark",
+  "bigtable_table_sample_rows_integration_test",
+  "iam_iam_credentials_integration_test",
+  "iam_iam_integration_test",
+  "pubsub_endurance",
+  "pubsub_schema_admin_integration_test",
+  "pubsub_subscriber_integration_test",
+  "pubsub_subscription_admin_integration_test",
+  "pubsub_throughput",
+  "pubsub_topic_admin_integration_test",
+  "spanner_admin_backup_extra_integration_test",
+  "spanner_admin_database_admin_integration_test",
+  "spanner_admin_instance_admin_integration_test",
+  "spanner_backup_extra_integration_test",
+  "spanner_client_integration_test",
+  "spanner_client_stress_test",
+  "spanner_data_types_integration_test",
+  "spanner_database_admin_integration_test",
+  "spanner_instance_admin_integration_test",
+  "spanner_multiple_rows_cpu_benchmark",
+  "spanner_rpc_failure_threshold_integration_test",
+  "spanner_session_pool_integration_test",
+  "spanner_single_row_throughput_benchmark",
+  "storage_aggregate_download_throughput_benchmark",
+  "storage_aggregate_upload_throughput_benchmark",
+  "storage_alternative_endpoint_integration_test",
+  "storage_auto_finalize_integration_test",
+  "storage_bucket_integration_test",
+  "storage_create_client_integration_test",
+  "storage_create_dataset",
+  "storage_curl_download_request_integration_test",
+  "storage_curl_request_integration_test",
+  "storage_curl_resumable_upload_session_integration_test",
+  "storage_curl_sign_blob_integration_test",
+  "storage_grpc_integration_test",
+  "storage_key_file_integration_test",
+  "storage_minimal_iam_credentials_rest_integration_test",
+  "storage_object_basic_crud_integration_test",
+  "storage_object_checksum_integration_test",
+  "storage_object_compose_many_integration_test",
+  "storage_object_file_integration_test",
+  "storage_object_hash_integration_test",
+  "storage_object_insert_integration_test",
+  "storage_object_insert_preconditions_integration_test",
+  "storage_object_integration_test",
+  "storage_object_list_objects_versions_integration_test",
+  "storage_object_media_integration_test",
+  "storage_object_parallel_upload_integration_test",
+  "storage_object_plenty_clients_serially_integration_test",
+  "storage_object_plenty_clients_simultaneously_integration_test",
+  "storage_object_read_headers_integration_test",
+  "storage_object_read_preconditions_integration_test",
+  "storage_object_read_range_integration_test",
+  "storage_object_read_stream_integration_test",
+  "storage_object_resumable_parallel_upload_integration_test",
+  "storage_object_resumable_write_integration_test",
+  "storage_object_rewrite_integration_test",
+  "storage_object_write_preconditions_integration_test",
+  "storage_object_write_stream_integration_test",
+  "storage_object_write_streambuf_integration_test",
+  "storage_service_account_integration_test",
+  "storage_signed_url_integration_test",
+  "storage_small_reads_integration_test",
+  "storage_storage_file_transfer_benchmark",
+  "storage_storage_parallel_uploads_benchmark",
+  "storage_storage_throughput_vs_cpu_benchmark",
+  "storage_thread_integration_test",
+  "storage_throughput_experiment_test",
+  "storage_tracing_integration_test",
+  "storage_unified_credentials_integration_test",
+  "common_grpc_utils_internal_grpc_impersonate_service_account_integration_test"
+]
+cases = [
+  "BackupExtraIntegrationTest.CreateBackupWithExpiredVersionTime",
+  "BackupExtraIntegrationTest.BackupWithExpiredVersionTime",
+  "BackupExtraIntegrationTest.BackupWithFutureVersionTime",
+  "BackupExtraIntegrationTest.CreateBackupWithFutureVersionTime",
+  "DatabaseAdminClientTest.CreateWithEncryptionKey",
+  "DatabaseAdminClientTest.CreateWithNonexistentEncryptionKey",
+  "DatabaseAdminClientTest.DatabaseBasicCRUD",
+  "DatabaseAdminClientTest.VersionRetentionPeriodCreate",
+  "DatabaseAdminClientTest.VersionRetentionPeriodCreateFailure",
+  "DatabaseAdminClientTest.VersionRetentionPeriodUpdate",
+  "DatabaseAdminClientTest.VersionRetentionPeriodUpdateFailure",
+  "InstanceAdminClientTest.InstanceConfig",
+  "InstanceAdminClientTest.InstanceIam",
+  "InstanceAdminClientTest.InstanceReadOperations",
+  "LoggingIntegrationTest.ListMonitoredResourceDescriptors",
+  "LoggingIntegrationTest.WriteLogEntries",
+  "ObjectFileMultiThreadedTest.Download",
+  "SubscriberIntegrationTest.FireAndForget",
+  "SubscriberIntegrationTest.PublishOrdered",
+  "SubscriberIntegrationTest.PublishPullAck",
+  "SubscriberIntegrationTest.RawStub",
+  "SubscriberIntegrationTest.ReportNotFound",
+  "SubscriberIntegrationTest.StreamingSubscriptionBatchSource",
+  "SubscriptionAdminIntegrationTest.SubscriptionCRUD",
+  "TopicAdminIntegrationTest.TopicCRUD"
+]