From b62462d3312adfc5523ea16d832dcfb62d28498c Mon Sep 17 00:00:00 2001 From: "H. Vetinari" Date: Wed, 31 Aug 2022 17:51:58 +0200 Subject: [PATCH 1/5] Revert "Keep windows static" This reverts commit 440ce9c994ca5f66a38a02902faf17dc4fbd78e2. --- recipe/bld.bat | 2 +- recipe/build-libgoogle-cloud.bat | 5 ++--- recipe/meta.yaml | 7 +++---- 3 files changed, 6 insertions(+), 8 deletions(-) diff --git a/recipe/bld.bat b/recipe/bld.bat index 31508c4..e92da09 100644 --- a/recipe/bld.bat +++ b/recipe/bld.bat @@ -10,7 +10,7 @@ cmake -G "Ninja" ^ -S . -B build ^ -DGOOGLE_CLOUD_CPP_ENABLE=__ga_libraries__ ^ -DBUILD_TESTING=OFF ^ - -DBUILD_SHARED_LIBS=OFF ^ + -DBUILD_SHARED_LIBS=ON ^ -DCMAKE_BUILD_TYPE=Release ^ -DCMAKE_CXX_STANDARD=17 ^ -DCMAKE_INSTALL_PREFIX="%LIBRARY_PREFIX%" ^ diff --git a/recipe/build-libgoogle-cloud.bat b/recipe/build-libgoogle-cloud.bat index 6eceaf4..fe1d1f6 100644 --- a/recipe/build-libgoogle-cloud.bat +++ b/recipe/build-libgoogle-cloud.bat @@ -7,10 +7,9 @@ set BUILD_PREFIX="%BUILD_PREFIX:\=/%" set SRC_DIR="%SRC_DIR:\=/%" if [%PKG_NAME%] == [libgoogle-cloud] ( - @rem cmake --install build_cmake --component google_cloud_cpp_runtime + cmake --install build --component google_cloud_cpp_runtime if %ERRORLEVEL% neq 0 exit 1 ) else ( - @rem cmake --install build_cmake --component google_cloud_cpp_development - cmake --install build + cmake --install build --component google_cloud_cpp_development if %ERRORLEVEL% neq 0 exit 1 ) diff --git a/recipe/meta.yaml b/recipe/meta.yaml index 2c2e5d6..de9a624 100644 --- a/recipe/meta.yaml +++ b/recipe/meta.yaml @@ -75,12 +75,11 @@ outputs: - test -f $PREFIX/lib/libgoogle_cloud_cpp_bigtable.so.{{ version }} # [linux] - test ! -f $PREFIX/lib/cmake/google_cloud_cpp_bigtable/google_cloud_cpp_bigtable-config.cmake # [not win] - test ! -f $PREFIX/include/google/cloud/bigtable/version.h # [not win] - # Currently, the windows build is static. - #- if not exist %LIBRARY_PREFIX%\\bin\\libgoogle_cloud_cpp_storage.dll exit 1 # [win] - #- if not exist %LIBRARY_PREFIX%\\lib\\pkgconfig\\google_cloud_cpp_storage.pc exit 1 # [win] + - if not exist %LIBRARY_PREFIX%\\bin\\libgoogle_cloud_cpp_storage.dll exit 1 # [win] + - if not exist %LIBRARY_PREFIX%\\lib\\pkgconfig\\google_cloud_cpp_storage.pc exit 1 # [win] - if exist %LIBRARY_PREFIX%\\lib\\cmake\\google_cloud_cpp_storage\\google_cloud_cpp_storage-config.cmake exit 1 # [win] - if exist %LIBRARY_PREFIX%\\include\\google\\cloud\\storage\\version.h exit 1 # [win] - #- if not exist %LIBRARY_PREFIX%\\bin\\libgoogle_cloud_cpp_bigtable.dll exit 1 # [win] + - if not exist %LIBRARY_PREFIX%\\bin\\libgoogle_cloud_cpp_bigtable.dll exit 1 # [win] - if exist %LIBRARY_PREFIX%\\lib\\cmake\\google_cloud_cpp_bigtable\\google_cloud_cpp_bigtable-config.cmake exit 1 # [win] - if exist %LIBRARY_PREFIX%\\include\\google\\cloud\\bigtable\\version.h exit 1 # [win] From 39a7ce89d212a83aac75a7c1ba9023ac32ded5c3 Mon Sep 17 00:00:00 2001 From: "H. Vetinari" Date: Wed, 31 Aug 2022 19:05:57 +0200 Subject: [PATCH 2/5] don't try to build exteral/googleapis as shared on win --- recipe/meta.yaml | 2 ++ recipe/patches/0001-disable-libraries.patch | 2 +- ...-support-for-cross-compilation-11782.patch | 2 +- ...-build-external-googleapis-as-shared.patch | 24 +++++++++++++++++++ 4 files changed, 28 insertions(+), 2 deletions(-) create mode 100644 recipe/patches/0003-do-not-try-to-build-external-googleapis-as-shared.patch diff --git a/recipe/meta.yaml b/recipe/meta.yaml index de9a624..9a0545a 100644 --- a/recipe/meta.yaml +++ b/recipe/meta.yaml @@ -18,6 +18,8 @@ source: - patches/0001-disable-libraries.patch # [libprotobuf == "3.21"] # backport https://github.com/googleapis/google-cloud-cpp/pull/11782 - patches/0002-fix-better-support-for-cross-compilation-11782.patch + # don't try to build the protobuf-heavy googleapis as shared on win + - patches/0003-do-not-try-to-build-external-googleapis-as-shared.patch # [win] build: number: 1 diff --git a/recipe/patches/0001-disable-libraries.patch b/recipe/patches/0001-disable-libraries.patch index b524b5b..06a79a3 100644 --- a/recipe/patches/0001-disable-libraries.patch +++ b/recipe/patches/0001-disable-libraries.patch @@ -1,7 +1,7 @@ From f014c88e7ea57ec2907edf26752264566ef7fa0a Mon Sep 17 00:00:00 2001 From: Carlos O'Ryan Date: Tue, 7 Feb 2023 01:35:26 +0000 -Subject: [PATCH 1/2] disable libraries +Subject: [PATCH 1/3] disable libraries --- cmake/GoogleCloudCppFeatures.cmake | 6 +++--- diff --git a/recipe/patches/0002-fix-better-support-for-cross-compilation-11782.patch b/recipe/patches/0002-fix-better-support-for-cross-compilation-11782.patch index e1ec633..398e1f3 100644 --- a/recipe/patches/0002-fix-better-support-for-cross-compilation-11782.patch +++ b/recipe/patches/0002-fix-better-support-for-cross-compilation-11782.patch @@ -1,7 +1,7 @@ From ddfa37bdafcf5ae551157676f5086518f720417d Mon Sep 17 00:00:00 2001 From: Carlos O'Ryan Date: Tue, 6 Jun 2023 11:30:17 -0400 -Subject: [PATCH 2/2] fix: better support for cross-compilation (#11782) +Subject: [PATCH 2/3] fix: better support for cross-compilation (#11782) Allow overrides for the `protobuf::protoc` and `gRPC::grpc_cpp_plugin` targets. On cross-compilation builds the targets point to the binaries diff --git a/recipe/patches/0003-do-not-try-to-build-external-googleapis-as-shared.patch b/recipe/patches/0003-do-not-try-to-build-external-googleapis-as-shared.patch new file mode 100644 index 0000000..072f8c8 --- /dev/null +++ b/recipe/patches/0003-do-not-try-to-build-external-googleapis-as-shared.patch @@ -0,0 +1,24 @@ +From d9f5e22ce65f427a42d5988fa7227d2dc257b7db Mon Sep 17 00:00:00 2001 +From: "H. Vetinari" +Date: Wed, 31 Aug 2022 19:00:34 +0200 +Subject: [PATCH 3/3] do not try to build external/googleapis as shared + +--- + CMakeLists.txt | 3 +++ + 1 file changed, 3 insertions(+) + +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 028802691d..59fb481451 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -207,7 +207,10 @@ host environment. + "find_dependency(Protobuf)") + find_package(Protobuf REQUIRED) + endif () ++ # do not try to build googleapis shared on windows ++ set(BUILD_SHARED_LIBS OFF) + add_subdirectory(external/googleapis) ++ set(BUILD_SHARED_LIBS ON) + endif () + + # Enable testing in this directory so we can do a top-level `make test`. This From 25eecb0d93b6fe1d640fa998da485388df3ae3ff Mon Sep 17 00:00:00 2001 From: "H. Vetinari" Date: Tue, 8 Nov 2022 13:42:04 +1100 Subject: [PATCH 3/5] make test section more readable & complete --- recipe/meta.yaml | 61 +++++++++++++++++++++++++----------------------- 1 file changed, 32 insertions(+), 29 deletions(-) diff --git a/recipe/meta.yaml b/recipe/meta.yaml index 9a0545a..8733796 100644 --- a/recipe/meta.yaml +++ b/recipe/meta.yaml @@ -43,7 +43,7 @@ requirements: outputs: - name: libgoogle-cloud - script: build-libgoogle-cloud.sh # [unix] + script: build-libgoogle-cloud.sh # [unix] script: build-libgoogle-cloud.bat # [win] build: run_exports: @@ -68,25 +68,25 @@ outputs: - google-cloud-cpp {{ version }} *_{{ PKG_BUILDNUM }} test: commands: - - test -f $PREFIX/lib/libgoogle_cloud_cpp_storage.{{ version }}.dylib # [osx] - - test -f $PREFIX/lib/libgoogle_cloud_cpp_storage.so.{{ version }} # [linux] - - test ! -f $PREFIX/lib/pkgconfig/google_cloud_cpp_storage.pc # [not win] - - test ! -f $PREFIX/lib/cmake/google_cloud_cpp_storage/google_cloud_cpp_storage-config.cmake # [not win] - - test ! -f $PREFIX/include/google/cloud/storage/version.h # [not win] - - test -f $PREFIX/lib/libgoogle_cloud_cpp_bigtable.{{ version }}.dylib # [osx] - - test -f $PREFIX/lib/libgoogle_cloud_cpp_bigtable.so.{{ version }} # [linux] - - test ! -f $PREFIX/lib/cmake/google_cloud_cpp_bigtable/google_cloud_cpp_bigtable-config.cmake # [not win] - - test ! -f $PREFIX/include/google/cloud/bigtable/version.h # [not win] - - if not exist %LIBRARY_PREFIX%\\bin\\libgoogle_cloud_cpp_storage.dll exit 1 # [win] - - if not exist %LIBRARY_PREFIX%\\lib\\pkgconfig\\google_cloud_cpp_storage.pc exit 1 # [win] - - if exist %LIBRARY_PREFIX%\\lib\\cmake\\google_cloud_cpp_storage\\google_cloud_cpp_storage-config.cmake exit 1 # [win] - - if exist %LIBRARY_PREFIX%\\include\\google\\cloud\\storage\\version.h exit 1 # [win] - - if not exist %LIBRARY_PREFIX%\\bin\\libgoogle_cloud_cpp_bigtable.dll exit 1 # [win] - - if exist %LIBRARY_PREFIX%\\lib\\cmake\\google_cloud_cpp_bigtable\\google_cloud_cpp_bigtable-config.cmake exit 1 # [win] - - if exist %LIBRARY_PREFIX%\\include\\google\\cloud\\bigtable\\version.h exit 1 # [win] + {% for component in ["bigtable", "storage"] %} + # shared libs + - test -f $PREFIX/lib/libgoogle_cloud_cpp_{{ component }}.so.{{ version }} # [linux] + - test -f $PREFIX/lib/libgoogle_cloud_cpp_{{ component }}.{{ version }}.dylib # [osx] + - if not exist %LIBRARY_BIN%\\libgoogle_cloud_cpp_{{ component }}.dll exit 1 # [win] + - if not exist %LIBRARY_LIB%\\libgoogle_cloud_cpp_{{ component }}.lib exit 1 # [win] + # absence of headers + - test ! -f $PREFIX/include/google/cloud/{{ component }}/version.h # [unix] + - if exist %LIBRARY_INC%\\google\\cloud\\{{ component }}\\version.h exit 1 # [win] + # absence of metadata (pkgconfig) + - test ! -f $PREFIX/lib/pkgconfig/google_cloud_cpp_{{ component }}.pc # [unix] + - if exist %LIBRARY_LIB%\\pkgconfig\\google_cloud_cpp_{{ component }}.pc exit 1 # [win] + # absence of metadata (CMake) + - test ! -f $PREFIX/lib/cmake/google_cloud_cpp_{{ component }}/google_cloud_cpp_{{ component }}-config.cmake # [unix] + - if exist %LIBRARY_LIB%\\cmake\\google_cloud_cpp_{{ component }}\\google_cloud_cpp_{{ component }}-config.cmake exit 1 # [win] + {% endfor %} - name: google-cloud-cpp - script: build-libgoogle-cloud.sh # [unix] + script: build-libgoogle-cloud.sh # [unix] script: build-libgoogle-cloud.bat # [win] build: run_exports: @@ -115,17 +115,6 @@ outputs: # as required; if possible, this should be removed upstream - zlib test: - commands: - - ./run_test_google_cloud_cpp.sh # [unix] - - ./run_test_google_cloud_cpp.bat # [win] - - test -f $PREFIX/lib/cmake/google_cloud_cpp_storage/google_cloud_cpp_storage-config.cmake # [not win] - - test -f $PREFIX/include/google/cloud/storage/version.h # [not win] - - test -f $PREFIX/lib/cmake/google_cloud_cpp_bigtable/google_cloud_cpp_bigtable-config.cmake # [not win] - - test -f $PREFIX/include/google/cloud/bigtable/version.h # [not win] - - if not exist %LIBRARY_PREFIX%\\lib\\cmake\\google_cloud_cpp_storage\\google_cloud_cpp_storage-config.cmake exit 1 # [win] - - if not exist %LIBRARY_PREFIX%\\include\\google\\cloud\\storage\\version.h exit 1 # [win] - - if not exist %LIBRARY_PREFIX%\\lib\\cmake\\google_cloud_cpp_bigtable\\google_cloud_cpp_bigtable-config.cmake exit 1 # [win] - - if not exist %LIBRARY_PREFIX%\\include\\google\\cloud\\bigtable\\version.h exit 1 # [win] requires: - {{ compiler('cxx') }} - cmake @@ -136,6 +125,20 @@ outputs: source_files: - google/cloud/storage/quickstart/*.cc - google/cloud/storage/quickstart/CMakeLists.txt + commands: + - ./run_test_google_cloud_cpp.sh # [unix] + - ./run_test_google_cloud_cpp.bat # [win] + {% for component in ["bigtable", "storage"] %} + # headers + - test -f $PREFIX/include/google/cloud/{{ component }}/version.h # [unix] + - if not exist %LIBRARY_INC%\\google\\cloud\\{{ component }}\\version.h exit 1 # [win] + # pkgconfig + - test -f $PREFIX/lib/pkgconfig/google_cloud_cpp_{{ component }}.pc # [unix] + - if not exist %LIBRARY_LIB%\\pkgconfig\\google_cloud_cpp_{{ component }}.pc exit 1 # [win] + # CMake + - test -f $PREFIX/lib/cmake/google_cloud_cpp_{{ component }}/google_cloud_cpp_{{ component }}-config.cmake # [unix] + - if not exist %LIBRARY_LIB%\\cmake\\google_cloud_cpp_{{ component }}\\google_cloud_cpp_{{ component }}-config.cmake exit 1 # [win] + {% endfor %} about: home: https://github.com/googleapis/google-cloud-cpp From 35a48d9b1067e9c43f4097433be4f586cf906f23 Mon Sep 17 00:00:00 2001 From: "H. Vetinari" Date: Tue, 8 Nov 2022 15:06:21 +1100 Subject: [PATCH 4/5] set -DCMAKE_WINDOWS_EXPORT_ALL_SYMBOLS=ON --- recipe/bld.bat | 1 + 1 file changed, 1 insertion(+) diff --git a/recipe/bld.bat b/recipe/bld.bat index e92da09..9c40600 100644 --- a/recipe/bld.bat +++ b/recipe/bld.bat @@ -16,6 +16,7 @@ cmake -G "Ninja" ^ -DCMAKE_INSTALL_PREFIX="%LIBRARY_PREFIX%" ^ -DCMAKE_MODULE_PATH="%LIBRARY_PREFIX%/lib/cmake" ^ -DCMAKE_INSTALL_LIBDIR=lib ^ + -DCMAKE_WINDOWS_EXPORT_ALL_SYMBOLS=ON ^ -DGOOGLE_CLOUD_CPP_ENABLE_EXAMPLES=OFF ^ -DGOOGLE_CLOUD_CPP_ENABLE_WERROR=OFF if %ERRORLEVEL% neq 0 exit 1 From e37fbf221a30377adf08f0cf9b7dc8c55f480a4c Mon Sep 17 00:00:00 2001 From: "H. Vetinari" Date: Fri, 9 Jun 2023 21:14:35 +1100 Subject: [PATCH 5/5] debug: skip everything but windows --- recipe/meta.yaml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/recipe/meta.yaml b/recipe/meta.yaml index 8733796..5b0c560 100644 --- a/recipe/meta.yaml +++ b/recipe/meta.yaml @@ -23,6 +23,9 @@ source: build: number: 1 + # debug + skip: true # [not win] + requirements: build: - {{ compiler('c') }}