Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: create google-cloud-cpp-core feedstock #24315

Merged
merged 32 commits into from
Dec 5, 2023
Merged
Show file tree
Hide file tree
Changes from 31 commits
Commits
Show all changes
32 commits
Select commit Hold shift + click to select a range
39e782a
feat: create `google-cloud-cpp-core` feedstock
coryan Oct 12, 2023
161c3ba
Fix lints
coryan Oct 19, 2023
38f48c3
Fix Windows build
coryan Oct 19, 2023
b5f66f1
Fix test script for Windows
coryan Oct 20, 2023
6c15afb
Also test for version.h on Windows
coryan Oct 20, 2023
b369852
Another round of fixes for Windows
coryan Oct 20, 2023
a55bd56
Fix for loop (again)
coryan Oct 20, 2023
c082f20
Fix for loop (again)
coryan Oct 20, 2023
c0d7646
Fix build step on Windows
coryan Oct 20, 2023
a7b0750
Fix install step on Windows
coryan Oct 20, 2023
bcff933
Fix variable expansion
coryan Oct 20, 2023
ba80882
Fix install for oauth2 on Windows
coryan Oct 20, 2023
3111675
Don't mess with ZLIB just yet
coryan Oct 20, 2023
dfe25f2
Revert "Don't mess with ZLIB just yet"
coryan Oct 20, 2023
41e27af
Include patches to simplify `find_package(CURL)`
coryan Oct 20, 2023
664f62a
Address review comments
coryan Oct 21, 2023
00bd6f5
Another attempt at fixing the macOS build
coryan Oct 21, 2023
67e2b49
Hmm... the build says `libcxx` is needed
coryan Oct 22, 2023
f61f0a5
Another attempt at fixing macOS
coryan Oct 22, 2023
841aa0a
Apparently libcxx is needed for each subpackage
coryan Oct 22, 2023
09426e7
Remove stale comments
coryan Oct 26, 2023
f1d90b9
Rename install scripts
coryan Oct 26, 2023
497ba1e
Remove devel -> devel run_exports
coryan Oct 26, 2023
5594921
No foo -> libgoogle-cloud-comon in run_exports
coryan Oct 26, 2023
1cabbae
Rename libgoogle-cloud-common to libgoogle-cloud
coryan Oct 26, 2023
934689b
Reorder macro definitions
coryan Oct 26, 2023
e51d89e
Adjust build and install scripts too
coryan Oct 26, 2023
612674a
Fix comments
coryan Oct 26, 2023
ceea4eb
Address review comments
coryan Nov 27, 2023
75408ad
Fix library names under Windows
coryan Nov 27, 2023
10e865d
I missed some details on Windows
coryan Nov 27, 2023
a7e1cef
Address review comments
coryan Nov 28, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
74 changes: 74 additions & 0 deletions recipes/google-cloud-cpp-core/bld.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
@echo on
setlocal EnableDelayedExpansion

:: CMake does not like paths with \ characters
set LIBRARY_PREFIX="%LIBRARY_PREFIX:\=/%"
set BUILD_PREFIX="%BUILD_PREFIX:\=/%"
set SRC_DIR="%SRC_DIR:\=/%"

:: Compile the common libraries. These are shared by other feedstocks
:: and by the subpackages in this feedstock.
cmake -G "Ninja" ^
-S . -B .build/common ^
-DGOOGLE_CLOUD_CPP_ENABLE=__common__ ^
-DBUILD_TESTING=OFF ^
-DBUILD_SHARED_LIBS=OFF ^
-DCMAKE_BUILD_TYPE=Release ^
-DCMAKE_CXX_STANDARD=17 ^
-DCMAKE_INSTALL_PREFIX="%LIBRARY_PREFIX%" ^
-DCMAKE_MODULE_PATH="%LIBRARY_PREFIX%/lib/cmake" ^
-DCMAKE_INSTALL_LIBDIR=lib ^
-DGOOGLE_CLOUD_CPP_ENABLE_EXAMPLES=OFF ^
-DGOOGLE_CLOUD_CPP_ENABLE_WERROR=OFF
if %ERRORLEVEL% neq 0 exit 1

cmake --build .build/common --config Release
if %ERRORLEVEL% neq 0 exit 1

cmake --install .build/common --prefix stage
if %ERRORLEVEL% neq 0 exit 1

set STAGE="%cd:\=/%"

:: These subpackages are the most commonly used features of google-cloud-cpp.
:: We want to compile them in the core feedstock.
FOR %%G IN (oauth2 bigtable storage spanner) DO (
cmake -G "Ninja" ^
-S . -B .build/%%G ^
-DGOOGLE_CLOUD_CPP_ENABLE=%%G ^
-DGOOGLE_CLOUD_CPP_USE_INSTALLED_COMMON=ON ^
-DCMAKE_PREFIX_PATH="%STAGE%/stage" ^
-DBUILD_TESTING=OFF ^
-DBUILD_SHARED_LIBS=OFF ^
-DCMAKE_BUILD_TYPE=Release ^
-DCMAKE_CXX_STANDARD=17 ^
-DCMAKE_INSTALL_PREFIX="%LIBRARY_PREFIX%" ^
-DCMAKE_MODULE_PATH="%LIBRARY_PREFIX%/lib/cmake" ^
-DCMAKE_INSTALL_LIBDIR=lib ^
-DGOOGLE_CLOUD_CPP_ENABLE_EXAMPLES=OFF ^
-DGOOGLE_CLOUD_CPP_ENABLE_WERROR=OFF
if %ERRORLEVEL% neq 0 exit 1

cmake --build .build/%%G --config Release
if %ERRORLEVEL% neq 0 exit 1
)

:: `pubsub` must to be compiled with `iam` and policytroubleshooter with `iam`
cmake -G "Ninja" ^
-S . -B .build/pubsub ^
-DGOOGLE_CLOUD_CPP_ENABLE=pubsub,iam,policytroubleshooter ^
-DGOOGLE_CLOUD_CPP_USE_INSTALLED_COMMON=ON ^
-DCMAKE_PREFIX_PATH="%STAGE%/stage" ^
-DBUILD_TESTING=OFF ^
-DBUILD_SHARED_LIBS=OFF ^
-DCMAKE_BUILD_TYPE=Release ^
-DCMAKE_CXX_STANDARD=17 ^
-DCMAKE_INSTALL_PREFIX="%LIBRARY_PREFIX%" ^
-DCMAKE_MODULE_PATH="%LIBRARY_PREFIX%/lib/cmake" ^
-DCMAKE_INSTALL_LIBDIR=lib ^
-DGOOGLE_CLOUD_CPP_ENABLE_EXAMPLES=OFF ^
-DGOOGLE_CLOUD_CPP_ENABLE_WERROR=OFF
if %ERRORLEVEL% neq 0 exit 1

cmake --build .build/pubsub --config Release
if %ERRORLEVEL% neq 0 exit 1
69 changes: 69 additions & 0 deletions recipes/google-cloud-cpp-core/build.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
#!/bin/bash

set -euo pipefail

export OPENSSL_ROOT_DIR=$PREFIX

if [[ "${target_platform}" == osx-* ]]; then
# See https://conda-forge.org/docs/maintainer/knowledge_base.html#newer-c-features-with-old-sdk
CXXFLAGS="${CXXFLAGS} -D_LIBCPP_DISABLE_AVAILABILITY"
fi

echo "$(date -u '+%Y-%m-%dT%H:%M:%SZ'): Building __common__ features..."
cmake ${CMAKE_ARGS} \
-GNinja -S . -B .build/common \
-DGOOGLE_CLOUD_CPP_ENABLE=__common__ \
-DBUILD_TESTING=OFF \
-DBUILD_SHARED_LIBS=ON \
-DOPENSSL_ROOT_DIR=$PREFIX \
-DCMAKE_BUILD_TYPE=release \
-DCMAKE_CXX_STANDARD=17 \
-DCMAKE_INSTALL_PREFIX=$PREFIX \
-DCMAKE_INSTALL_LIBDIR=lib \
-DProtobuf_PROTOC_EXECUTABLE=$BUILD_PREFIX/bin/protoc \
-DGOOGLE_CLOUD_CPP_GRPC_PLUGIN_EXECUTABLE=$BUILD_PREFIX/bin/grpc_cpp_plugin \
-DGOOGLE_CLOUD_CPP_ENABLE_WERROR=OFF

cmake --build .build/common
cmake --install .build/common --prefix .build/stage
echo "$(date -u '+%Y-%m-%dT%H:%M:%SZ'): DONE - Building __common__ features"

for feature in oauth2 bigtable spanner storage; do
echo "$(date -u '+%Y-%m-%dT%H:%M:%SZ'): Building ${feature}"
cmake ${CMAKE_ARGS} \
-GNinja -S . -B .build/${feature} \
-DGOOGLE_CLOUD_CPP_ENABLE=${feature} \
-DGOOGLE_CLOUD_CPP_USE_INSTALLED_COMMON=ON \
-DCMAKE_PREFIX_PATH="${CMAKE_PREFIX_PATH};${PWD}/.build/stage" \
-DBUILD_TESTING=OFF \
-DBUILD_SHARED_LIBS=ON \
-DOPENSSL_ROOT_DIR=$PREFIX \
-DCMAKE_BUILD_TYPE=release \
-DCMAKE_CXX_STANDARD=17 \
-DCMAKE_INSTALL_PREFIX=$PREFIX \
-DCMAKE_INSTALL_LIBDIR=lib \
-DProtobuf_PROTOC_EXECUTABLE=$BUILD_PREFIX/bin/protoc \
-DGOOGLE_CLOUD_CPP_GRPC_PLUGIN_EXECUTABLE=$BUILD_PREFIX/bin/grpc_cpp_plugin \
-DGOOGLE_CLOUD_CPP_ENABLE_WERROR=OFF
cmake --build .build/${feature}
echo "$(date -u '+%Y-%m-%dT%H:%M:%SZ'): DONE - Building ${feature}"
done

echo "$(date -u '+%Y-%m-%dT%H:%M:%SZ'): Building pubsub"
cmake ${CMAKE_ARGS} \
-GNinja -S . -B .build/pubsub \
-DGOOGLE_CLOUD_CPP_ENABLE=pubsub,iam,policytroubleshooter \
-DGOOGLE_CLOUD_CPP_USE_INSTALLED_COMMON=ON \
-DCMAKE_PREFIX_PATH="${CMAKE_PREFIX_PATH};${PWD}/.build/stage" \
-DBUILD_TESTING=OFF \
-DBUILD_SHARED_LIBS=ON \
-DOPENSSL_ROOT_DIR=$PREFIX \
-DCMAKE_BUILD_TYPE=release \
-DCMAKE_CXX_STANDARD=17 \
-DCMAKE_INSTALL_PREFIX=$PREFIX \
-DCMAKE_INSTALL_LIBDIR=lib \
-DProtobuf_PROTOC_EXECUTABLE=$BUILD_PREFIX/bin/protoc \
-DGOOGLE_CLOUD_CPP_GRPC_PLUGIN_EXECUTABLE=$BUILD_PREFIX/bin/grpc_cpp_plugin \
-DGOOGLE_CLOUD_CPP_ENABLE_WERROR=OFF
cmake --build .build/pubsub
echo "$(date -u '+%Y-%m-%dT%H:%M:%SZ'): DONE - Building pubsub"
4 changes: 4 additions & 0 deletions recipes/google-cloud-cpp-core/conda_build_config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# The default at [1] is 10.9 and abseil does not compile with that
# [1]: https://github.com/conda-forge/conda-forge-pinning-feedstock/blob/main/recipe/conda_build_config.yaml
MACOSX_DEPLOYMENT_TARGET:
- 10.13 # [osx and x86_64]
Comment on lines +3 to +4
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seeing issues with feedstock creation for this recipe. Think it has to do with the fact that we are modifying MACOSX_DEPLOYMENT_TARGET, but not restricting that modification to osx and x86_64, which has an adverse affect on other architectures (like osx and arm64). So think we want to add a selector to MACOSX_DEPLOYMENT_TARGET (as shown below)

Suggested change
MACOSX_DEPLOYMENT_TARGET:
- 10.13 # [osx and x86_64]
MACOSX_DEPLOYMENT_TARGET: # [osx and x86_64]
- 10.13 # [osx and x86_64]

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, done in d4fe07d

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure what's happening here. The create_feedstocks job still failed, but an empty https://github.com/conda-forge/google-cloud-cpp-core-feedstock got created already.

53 changes: 53 additions & 0 deletions recipes/google-cloud-cpp-core/install-libgoogle-cloud.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
@echo on
setlocal EnableDelayedExpansion

:: CMake does not like paths with \ characters
set LIBRARY_PREFIX="%LIBRARY_PREFIX:\=/%"
set BUILD_PREFIX="%BUILD_PREFIX:\=/%"
set SRC_DIR="%SRC_DIR:\=/%"

:: Once DLLs are working, we should install the non-devel packages using
:: cmake --install .build/%FEATURE% --component google_cloud_cpp_runtime
:: and the devel packages using
:: cmake --install .build/%FEATURE% --component google_cloud_cpp_development

if [%PKG_NAME%] == [libgoogle-cloud] (
REM TODO: fix when DLL support comes along
) else if [%PKG_NAME%] == [libgoogle-cloud-devel] (
REM cmake --install .build/common --component google_cloud_cpp_development
cmake --install .build/common
if %ERRORLEVEL% neq 0 exit 1
) else if [%PKG_NAME%] == [libgoogle-cloud-bigtable] (
REM TODO: fix when DLL support comes along
) else if [%PKG_NAME%] == [libgoogle-cloud-bigtable-devel] (
cmake --install .build/bigtable
if %ERRORLEVEL% neq 0 exit 1
) else if [%PKG_NAME%] == [libgoogle-cloud-oauth2] (
REM TODO: fix when DLL support comes along
) else if [%PKG_NAME%] == [libgoogle-cloud-oauth2-devel] (
cmake --install .build/oauth2
if %ERRORLEVEL% neq 0 exit 1
) else if [%PKG_NAME%] == [libgoogle-cloud-spanner] (
REM TODO: fix when DLL support comes along
) else if [%PKG_NAME%] == [libgoogle-cloud-spanner-devel] (
cmake --install .build/spanner
if %ERRORLEVEL% neq 0 exit 1
) else if [%PKG_NAME%] == [libgoogle-cloud-storage] (
REM TODO: fix when DLL support comes along
) else if [%PKG_NAME%] == [libgoogle-cloud-storage-devel] (
cmake --install .build/storage
if %ERRORLEVEL% neq 0 exit 1
) else if [%PKG_NAME%] == [libgoogle-cloud-pubsub] (
REM TODO: fix when DLL support comes along
) else if [%PKG_NAME%] == [libgoogle-cloud-pubsub-devel] (
cmake --install .build/pubsub
if %ERRORLEVEL% neq 0 exit 1
) else if [%PKG_NAME%] == [libgoogle-cloud-iam] (
REM Nothing to do, installed by pubsub
) else if [%PKG_NAME%] == [libgoogle-cloud-iam-devel] (
REM Nothing to do, installed by pubsub
) else if [%PKG_NAME%] == [libgoogle-cloud-policytroubleshooter] (
REM Nothing to do, installed by pubsub
) else if [%PKG_NAME%] == [libgoogle-cloud-policytroubleshooter-devel] (
REM Nothing to do, installed by pubsub
)
33 changes: 33 additions & 0 deletions recipes/google-cloud-cpp-core/install-libgoogle-cloud.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
#!/bin/bash

set -euo pipefail

case "${PKG_NAME}" in
libgoogle-cloud-devel)
cmake --install .build/common --component google_cloud_cpp_development
;;
libgoogle-cloud)
cmake --install .build/common --component google_cloud_cpp_runtime
;;
libgoogle-cloud-iam-devel)
# Do nothing, this is installed by `libgoogle-cloud-pubsub-devel`.
;;
libgoogle-cloud-iam)
# Do nothing, this is installed by `libgoogle-cloud-pubsub`.
;;
libgoogle-cloud-policytroubleshooter-devel)
# Do nothing, this is installed by `libgoogle-cloud-pubsub-devel`.
;;
libgoogle-cloud-policytroubleshooter)
# Do nothing, this is installed by `libgoogle-cloud-pubsub`.
;;
libgoogle-cloud-*-devel)
feature=${PKG_NAME/#libgoogle-cloud-/}
feature=${feature/%-devel/}
cmake --install .build/${feature} --component google_cloud_cpp_development
;;
libgoogle-cloud-*)
feature=${PKG_NAME/#libgoogle-cloud-/}
cmake --install .build/${feature} --component google_cloud_cpp_runtime
;;
esac
Loading