diff --git a/.azure-pipelines/azure-pipelines-linux.yml b/.azure-pipelines/azure-pipelines-linux.yml index fd96606e..3d052163 100755 --- a/.azure-pipelines/azure-pipelines-linux.yml +++ b/.azure-pipelines/azure-pipelines-linux.yml @@ -12,34 +12,18 @@ jobs: CONFIG: linux_64_openssl1.1.1 UPLOAD_PACKAGES: 'True' DOCKER_IMAGE: quay.io/condaforge/linux-anvil-cos7-x86_64 - linux_64_openssl3: - CONFIG: linux_64_openssl3 + linux_aarch64_: + CONFIG: linux_aarch64_ UPLOAD_PACKAGES: 'True' DOCKER_IMAGE: quay.io/condaforge/linux-anvil-cos7-x86_64 - linux_aarch64_openssl1.1.1: - CONFIG: linux_aarch64_openssl1.1.1 - UPLOAD_PACKAGES: 'True' - DOCKER_IMAGE: quay.io/condaforge/linux-anvil-cos7-x86_64 - linux_aarch64_openssl3: - CONFIG: linux_aarch64_openssl3 - UPLOAD_PACKAGES: 'True' - DOCKER_IMAGE: quay.io/condaforge/linux-anvil-cos7-x86_64 - linux_ppc64le_openssl1.1.1: - CONFIG: linux_ppc64le_openssl1.1.1 - UPLOAD_PACKAGES: 'True' - DOCKER_IMAGE: quay.io/condaforge/linux-anvil-cos7-x86_64 - linux_ppc64le_openssl3: - CONFIG: linux_ppc64le_openssl3 + linux_ppc64le_: + CONFIG: linux_ppc64le_ UPLOAD_PACKAGES: 'True' DOCKER_IMAGE: quay.io/condaforge/linux-anvil-cos7-x86_64 timeoutInMinutes: 360 + variables: {} steps: - - script: | - rm -rf /opt/ghc - df -h - displayName: Manage disk space - # configure qemu binfmt-misc running. This allows us to run docker containers # embedded qemu-static - script: | @@ -50,6 +34,9 @@ jobs: - script: | export CI=azure + export flow_run_id=azure_$(Build.BuildNumber).$(System.JobAttempt) + export remote_url=$(Build.Repository.Uri) + export sha=$(Build.SourceVersion) export GIT_BRANCH=$BUILD_SOURCEBRANCHNAME export FEEDSTOCK_NAME=$(basename ${BUILD_REPOSITORY_NAME}) if [[ "${BUILD_REASON:-}" == "PullRequest" ]]; then diff --git a/.azure-pipelines/azure-pipelines-osx.yml b/.azure-pipelines/azure-pipelines-osx.yml index efbf049f..556e7c51 100755 --- a/.azure-pipelines/azure-pipelines-osx.yml +++ b/.azure-pipelines/azure-pipelines-osx.yml @@ -5,7 +5,7 @@ jobs: - job: osx pool: - vmImage: macOS-10.15 + vmImage: macOS-11 strategy: matrix: osx_64_openssl1.1.1: @@ -21,11 +21,15 @@ jobs: CONFIG: osx_arm64_openssl3 UPLOAD_PACKAGES: 'True' timeoutInMinutes: 360 + variables: {} steps: # TODO: Fast finish on azure pipelines? - script: | export CI=azure + export flow_run_id=azure_$(Build.BuildNumber).$(System.JobAttempt) + export remote_url=$(Build.Repository.Uri) + export sha=$(Build.SourceVersion) export OSX_FORCE_SDK_DOWNLOAD="1" export GIT_BRANCH=$BUILD_SOURCEBRANCHNAME export FEEDSTOCK_NAME=$(basename ${BUILD_REPOSITORY_NAME}) diff --git a/.azure-pipelines/azure-pipelines-win.yml b/.azure-pipelines/azure-pipelines-win.yml index 27a1c100..70b2385c 100755 --- a/.azure-pipelines/azure-pipelines-win.yml +++ b/.azure-pipelines/azure-pipelines-win.yml @@ -5,7 +5,7 @@ jobs: - job: win pool: - vmImage: windows-2019 + vmImage: windows-2022 strategy: matrix: win_64_openssl1.1.1: @@ -17,97 +17,39 @@ jobs: timeoutInMinutes: 360 variables: CONDA_BLD_PATH: D:\\bld\\ + UPLOAD_TEMP: D:\\tmp steps: - - script: | - choco install vcpython27 -fdv -y --debug - condition: contains(variables['CONFIG'], 'vs2008') - displayName: Install vcpython27.msi (if needed) - - # Cygwin's git breaks conda-build. (See https://github.com/conda-forge/conda-smithy-feedstock/pull/2.) - # - script: rmdir C:\cygwin /s /q - # continueOnError: true - - - powershell: | - Set-PSDebug -Trace 1 - - $batchcontent = @" - ECHO ON - SET vcpython=C:\Program Files (x86)\Common Files\Microsoft\Visual C++ for Python\9.0 - - DIR "%vcpython%" - - CALL "%vcpython%\vcvarsall.bat" %* - "@ - - $batchDir = "C:\Program Files (x86)\Common Files\Microsoft\Visual C++ for Python\9.0\VC" - $batchPath = "$batchDir" + "\vcvarsall.bat" - New-Item -Path $batchPath -ItemType "file" -Force - - Set-Content -Value $batchcontent -Path $batchPath - - Get-ChildItem -Path $batchDir - - Get-ChildItem -Path ($batchDir + '\..') - - condition: contains(variables['CONFIG'], 'vs2008') - displayName: Patch vs2008 (if needed) - - task: CondaEnvironment@1 + - task: PythonScript@0 + displayName: 'Download Miniforge' inputs: - packageSpecs: 'python=3.9 conda-build conda "conda-forge-ci-setup=3" pip boa' # Optional - installOptions: "-c conda-forge" - updateConda: true - displayName: Install conda-build and activate environment + scriptSource: inline + script: | + import urllib.request + url = 'https://github.com/conda-forge/miniforge/releases/latest/download/Mambaforge-Windows-x86_64.exe' + path = r"$(Build.ArtifactStagingDirectory)/Miniforge.exe" + urllib.request.urlretrieve(url, path) - - script: set PYTHONUNBUFFERED=1 - displayName: Set PYTHONUNBUFFERED - - # Configure the VM - - script: | - call activate base - setup_conda_rc .\ ".\recipe" .\.ci_support\%CONFIG%.yaml - displayName: conda-forge CI setup - - # Configure the VM. - script: | - set "CI=azure" - call activate base - run_conda_forge_build_setup - displayName: conda-forge build setup - + start /wait "" %BUILD_ARTIFACTSTAGINGDIRECTORY%\Miniforge.exe /InstallationType=JustMe /RegisterPython=0 /S /D=C:\Miniforge + displayName: Install Miniforge - # Special cased version setting some more things! - - script: | - call activate base - conda.exe build "recipe" -m .ci_support\%CONFIG%.yaml - displayName: Build recipe (vs2008) - env: - VS90COMNTOOLS: "C:\\Program Files (x86)\\Common Files\\Microsoft\\Visual C++ for Python\\9.0\\VC\\bin" - PYTHONUNBUFFERED: 1 - condition: contains(variables['CONFIG'], 'vs2008') + - powershell: Write-Host "##vso[task.prependpath]C:\Miniforge\Scripts" + displayName: Add conda to PATH - script: | - call activate base - conda.exe mambabuild "recipe" -m .ci_support\%CONFIG%.yaml --suppress-variables - displayName: Build recipe + call ".scripts\run_win_build.bat" + displayName: Run Windows build env: PYTHONUNBUFFERED: 1 - condition: not(contains(variables['CONFIG'], 'vs2008')) - - script: | - set "FEEDSTOCK_NAME=%BUILD_REPOSITORY_NAME:*/=%" - call activate base - validate_recipe_outputs "%FEEDSTOCK_NAME%" - displayName: Validate Recipe Outputs - - - script: | - set "GIT_BRANCH=%BUILD_SOURCEBRANCHNAME%" - set "FEEDSTOCK_NAME=%BUILD_REPOSITORY_NAME:*/=%" - call activate base - upload_package --validate --feedstock-name="%FEEDSTOCK_NAME%" .\ ".\recipe" .ci_support\%CONFIG%.yaml - displayName: Upload package - env: + CONFIG: $(CONFIG) + CI: azure + flow_run_id: azure_$(Build.BuildNumber).$(System.JobAttempt) + remote_url: $(Build.Repository.Uri) + sha: $(Build.SourceVersion) + UPLOAD_PACKAGES: $(UPLOAD_PACKAGES) + UPLOAD_TEMP: $(UPLOAD_TEMP) BINSTAR_TOKEN: $(BINSTAR_TOKEN) FEEDSTOCK_TOKEN: $(FEEDSTOCK_TOKEN) STAGING_BINSTAR_TOKEN: $(STAGING_BINSTAR_TOKEN) - condition: and(succeeded(), not(eq(variables['UPLOAD_PACKAGES'], 'False')), not(eq(variables['Build.Reason'], 'PullRequest'))) \ No newline at end of file diff --git a/.ci_support/README b/.ci_support/README index e4e2dcec..a47316be 100644 --- a/.ci_support/README +++ b/.ci_support/README @@ -1 +1,6 @@ -This file is automatically generated by conda-smithy. To change any matrix elements, you should change conda-smithy's input conda_build_config.yaml and re-render the recipe, rather than editing these files directly. \ No newline at end of file +This file is automatically generated by conda-smithy. If any +particular build configuration is expected, but it is not found, +please make sure all dependencies are satisfiable. To add/modify any +matrix elements, you should create/change conda-smithy's input +recipe/conda_build_config.yaml and re-render the recipe, rather than +editing these files directly. diff --git a/.ci_support/linux_64_openssl1.1.1.yaml b/.ci_support/linux_64_openssl1.1.1.yaml index a5083d83..ea7275d5 100644 --- a/.ci_support/linux_64_openssl1.1.1.yaml +++ b/.ci_support/linux_64_openssl1.1.1.yaml @@ -1,9 +1,13 @@ -abseil_cpp: -- '20210324.2' +c_ares: +- '1' c_compiler: - gcc c_compiler_version: -- '11' +- '12' +c_stdlib: +- sysroot +c_stdlib_version: +- '2.12' cdt_name: - cos6 channel_sources: @@ -13,22 +17,43 @@ channel_targets: cxx_compiler: - gxx cxx_compiler_version: -- '11' +- '12' docker_image: - quay.io/condaforge/linux-anvil-cos7-x86_64 +libabseil: +- '20240116' libprotobuf: -- '3.19' +- 4.25.3 openssl: -- 1.1.1 +- '3' pin_run_as_build: - zlib: + python: + min_pin: x.x max_pin: x.x +python: +- 3.10.* *_cpython +- 3.11.* *_cpython +- 3.12.* *_cpython +- 3.8.* *_cpython +- 3.9.* *_73_pypy +- 3.9.* *_cpython +python_impl: +- cpython +- cpython +- cpython +- cpython +- pypy +- cpython re2: -- 2021.11.01 +- 2023.09.01 target_platform: - linux-64 zip_keys: - - c_compiler_version - cxx_compiler_version +- - c_stdlib_version + - cdt_name +- - python + - python_impl zlib: - '1.2' diff --git a/.ci_support/linux_aarch64_openssl1.1.1.yaml b/.ci_support/linux_aarch64_openssl1.1.1.yaml index f88ba1f5..1d4e33c0 100644 --- a/.ci_support/linux_aarch64_openssl1.1.1.yaml +++ b/.ci_support/linux_aarch64_openssl1.1.1.yaml @@ -1,11 +1,15 @@ BUILD: - aarch64-conda_cos7-linux-gnu -abseil_cpp: -- '20210324.2' +c_ares: +- '1' c_compiler: - gcc c_compiler_version: -- '11' +- '12' +c_stdlib: +- sysroot +c_stdlib_version: +- '2.17' cdt_arch: - aarch64 cdt_name: @@ -17,22 +21,43 @@ channel_targets: cxx_compiler: - gxx cxx_compiler_version: -- '11' +- '12' docker_image: - quay.io/condaforge/linux-anvil-cos7-x86_64 +libabseil: +- '20240116' libprotobuf: -- '3.19' +- 4.25.3 openssl: -- 1.1.1 +- '3' pin_run_as_build: - zlib: + python: + min_pin: x.x max_pin: x.x +python: +- 3.10.* *_cpython +- 3.11.* *_cpython +- 3.12.* *_cpython +- 3.8.* *_cpython +- 3.9.* *_73_pypy +- 3.9.* *_cpython +python_impl: +- cpython +- cpython +- cpython +- cpython +- pypy +- cpython re2: -- 2021.11.01 +- 2023.09.01 target_platform: - linux-aarch64 zip_keys: - - c_compiler_version - cxx_compiler_version +- - c_stdlib_version + - cdt_name +- - python + - python_impl zlib: - '1.2' diff --git a/.ci_support/linux_ppc64le_openssl1.1.1.yaml b/.ci_support/linux_ppc64le_openssl1.1.1.yaml index 3c26b49b..448093db 100644 --- a/.ci_support/linux_ppc64le_openssl1.1.1.yaml +++ b/.ci_support/linux_ppc64le_openssl1.1.1.yaml @@ -1,9 +1,13 @@ -abseil_cpp: -- '20210324.2' +c_ares: +- '1' c_compiler: - gcc c_compiler_version: -- '11' +- '12' +c_stdlib: +- sysroot +c_stdlib_version: +- '2.17' cdt_name: - cos7 channel_sources: @@ -13,22 +17,43 @@ channel_targets: cxx_compiler: - gxx cxx_compiler_version: -- '11' +- '12' docker_image: - quay.io/condaforge/linux-anvil-cos7-x86_64 +libabseil: +- '20240116' libprotobuf: -- '3.19' +- 4.25.3 openssl: -- 1.1.1 +- '3' pin_run_as_build: - zlib: + python: + min_pin: x.x max_pin: x.x +python: +- 3.10.* *_cpython +- 3.11.* *_cpython +- 3.12.* *_cpython +- 3.8.* *_cpython +- 3.9.* *_73_pypy +- 3.9.* *_cpython +python_impl: +- cpython +- cpython +- cpython +- cpython +- pypy +- cpython re2: -- 2021.11.01 +- 2023.09.01 target_platform: - linux-ppc64le zip_keys: - - c_compiler_version - cxx_compiler_version +- - c_stdlib_version + - cdt_name +- - python + - python_impl zlib: - '1.2' diff --git a/.ci_support/migrations/libabseil20230802_libgrpc157_libprotobuf4234.yaml b/.ci_support/migrations/libabseil20230802_libgrpc157_libprotobuf4234.yaml new file mode 100644 index 00000000..3781ea0c --- /dev/null +++ b/.ci_support/migrations/libabseil20230802_libgrpc157_libprotobuf4234.yaml @@ -0,0 +1,13 @@ +__migrator: + build_number: 1 + kind: version + migration_number: 1 +libabseil: +- 20230802 +libgrpc: +- "1.57" +libprotobuf: +- 4.23.4 +MACOSX_DEPLOYMENT_TARGET: # [osx and x86_64] +- "10.13" # [osx and x86_64] +migrator_ts: 1692632590.658328 diff --git a/.ci_support/migrations/libabseil20240116_libgrpc161_libprotobuf4252.yaml b/.ci_support/migrations/libabseil20240116_libgrpc161_libprotobuf4252.yaml new file mode 100644 index 00000000..6c01f355 --- /dev/null +++ b/.ci_support/migrations/libabseil20240116_libgrpc161_libprotobuf4252.yaml @@ -0,0 +1,23 @@ +__migrator: + build_number: 1 + commit_message: Rebuild for libabseil 20240116, libgrp 1.61, libprotobuf 4.25.2 + kind: version + migration_number: 1 + paused: True + exclude: + - abseil-cpp + - grpc-cpp + - libprotobuf + # this shouldn't attempt to modify the python feedstocks + - protobuf +libabseil: +- "20240116" +libgrpc: +- "1.61" +libprotobuf: +- 4.25.2 +# already covered by libabseil20230802_libgrpc157_libprotobuf4234, +# which we cannot delete yet, but keep for clarity +MACOSX_DEPLOYMENT_TARGET: # [osx and x86_64] +- "10.13" # [osx and x86_64] +migrator_ts: 1705991934.9119136 diff --git a/.ci_support/migrations/libgrpc162_libprotobuf4253.yaml b/.ci_support/migrations/libgrpc162_libprotobuf4253.yaml new file mode 100644 index 00000000..1d4c28fb --- /dev/null +++ b/.ci_support/migrations/libgrpc162_libprotobuf4253.yaml @@ -0,0 +1,24 @@ +__migrator: + build_number: 1 + commit_message: Rebuild for libprotobuf 4.25.3 + kind: version + migration_number: 1 + paused: true + exclude: + - abseil-cpp + - grpc-cpp + - libprotobuf + - protobuf +libgrpc: +- "1.62" +libprotobuf: +- 4.25.3 +# keep abseil bump from libabseil20240116_libgrpc161_libprotobuf4252; +# this ensures that this migration applies also without the previous one +libabseil: +- "20240116" +# already covered by libabseil20230802_libgrpc157_libprotobuf4234, +# which we cannot delete yet, but keep for clarity +MACOSX_DEPLOYMENT_TARGET: # [osx and x86_64] +- "10.13" # [osx and x86_64] +migrator_ts: 1709522594.9193177 diff --git a/.ci_support/migrations/libprotobuf319.yaml b/.ci_support/migrations/libprotobuf319.yaml deleted file mode 100644 index bafbe1ff..00000000 --- a/.ci_support/migrations/libprotobuf319.yaml +++ /dev/null @@ -1,7 +0,0 @@ -__migrator: - build_number: 1 - kind: version - migration_number: 1 -libprotobuf: -- '3.19' -migrator_ts: 1634806373.384677 diff --git a/.ci_support/migrations/openssl3.yaml b/.ci_support/migrations/openssl3.yaml deleted file mode 100644 index ae551c1e..00000000 --- a/.ci_support/migrations/openssl3.yaml +++ /dev/null @@ -1,8 +0,0 @@ -__migrator: - build_number: 1 - kind: version - migration_number: 1 -migrator_ts: 1631932209.13688 -openssl: -- 1.1.1 -- '3' diff --git a/.ci_support/migrations/pypy38.yaml b/.ci_support/migrations/pypy38.yaml new file mode 100644 index 00000000..065dae61 --- /dev/null +++ b/.ci_support/migrations/pypy38.yaml @@ -0,0 +1,41 @@ +migrator_ts: 1647123563 +__migrator: + migration_number: 1 + operation: key_add + primary_key: python + ordering: + python: + - 3.6.* *_cpython + - 3.7.* *_cpython + - 3.8.* *_cpython + - 3.9.* *_cpython + - 3.10.* *_cpython + - 3.11.* *_cpython + - 3.6.* *_73_pypy + - 3.7.* *_73_pypy + - 3.8.* *_73_pypy + - 3.9.* *_73_pypy + paused: False + longterm: True + use_local: False + check_solvable: True + exclude_pinned_pkgs: False + pr_limit: 10 + bump_number: 1 + commit_message: "Rebuild for PyPy3.9" + exclude: + # this shouldn't attempt to modify the python feedstocks + - python + - pypy3.6 + - pypy-meta + ignored_deps_per_node: + matplotlib: + - pyqt + +python: + - 3.9.* *_73_pypy # [not (osx and arm64)] +numpy: + # part of a zip_keys: python, python_impl, numpy + - 1.22 # [not (osx and arm64)] +python_impl: + - pypy # [not (osx and arm64)] diff --git a/.ci_support/migrations/python312.yaml b/.ci_support/migrations/python312.yaml new file mode 100644 index 00000000..89749ad6 --- /dev/null +++ b/.ci_support/migrations/python312.yaml @@ -0,0 +1,42 @@ +migrator_ts: 1695046563 +__migrator: + migration_number: 1 + operation: key_add + primary_key: python + ordering: + python: + - 3.6.* *_cpython + - 3.7.* *_cpython + - 3.8.* *_cpython + - 3.9.* *_cpython + - 3.10.* *_cpython + - 3.11.* *_cpython + - 3.12.* *_cpython # new entry + - 3.6.* *_73_pypy + - 3.7.* *_73_pypy + - 3.8.* *_73_pypy + - 3.9.* *_73_pypy + paused: false + longterm: True + pr_limit: 60 + max_solver_attempts: 3 # this will make the bot retry "not solvable" stuff 12 times + exclude: + # this shouldn't attempt to modify the python feedstocks + - python + - pypy3.6 + - pypy-meta + - cross-python + - python_abi + exclude_pinned_pkgs: false + additional_zip_keys: + - channel_sources + +python: + - 3.12.* *_cpython +channel_sources: + - conda-forge/label/python_rc,conda-forge +# additional entries to add for zip_keys +numpy: + - 1.26 +python_impl: + - cpython diff --git a/.ci_support/osx_64_openssl1.1.1.yaml b/.ci_support/osx_64_openssl1.1.1.yaml index a20e29ac..0d954be8 100644 --- a/.ci_support/osx_64_openssl1.1.1.yaml +++ b/.ci_support/osx_64_openssl1.1.1.yaml @@ -1,11 +1,15 @@ MACOSX_DEPLOYMENT_TARGET: -- '10.9' -abseil_cpp: -- '20210324.2' +- '10.13' +c_ares: +- '1' c_compiler: - clang c_compiler_version: -- '11' +- '16' +c_stdlib: +- macosx_deployment_target +c_stdlib_version: +- '10.13' channel_sources: - conda-forge channel_targets: @@ -13,22 +17,41 @@ channel_targets: cxx_compiler: - clangxx cxx_compiler_version: -- '11' +- '16' +libabseil: +- '20240116' libprotobuf: -- '3.19' +- 4.25.3 macos_machine: - x86_64-apple-darwin13.4.0 openssl: -- 1.1.1 +- '3' pin_run_as_build: - zlib: + python: + min_pin: x.x max_pin: x.x +python: +- 3.10.* *_cpython +- 3.11.* *_cpython +- 3.12.* *_cpython +- 3.8.* *_cpython +- 3.9.* *_73_pypy +- 3.9.* *_cpython +python_impl: +- cpython +- cpython +- cpython +- cpython +- pypy +- cpython re2: -- 2021.11.01 +- 2023.09.01 target_platform: - osx-64 zip_keys: - - c_compiler_version - cxx_compiler_version +- - python + - python_impl zlib: - '1.2' diff --git a/.ci_support/osx_arm64_openssl1.1.1.yaml b/.ci_support/osx_arm64_openssl1.1.1.yaml index 56f603f1..53ba5d50 100644 --- a/.ci_support/osx_arm64_openssl1.1.1.yaml +++ b/.ci_support/osx_arm64_openssl1.1.1.yaml @@ -1,11 +1,15 @@ MACOSX_DEPLOYMENT_TARGET: - '11.0' -abseil_cpp: -- '20210324.2' +c_ares: +- '1' c_compiler: - clang c_compiler_version: -- '11' +- '16' +c_stdlib: +- macosx_deployment_target +c_stdlib_version: +- '11.0' channel_sources: - conda-forge channel_targets: @@ -13,22 +17,39 @@ channel_targets: cxx_compiler: - clangxx cxx_compiler_version: -- '11' +- '16' +libabseil: +- '20240116' libprotobuf: -- '3.19' +- 4.25.3 macos_machine: - arm64-apple-darwin20.0.0 openssl: -- 1.1.1 +- '3' pin_run_as_build: - zlib: + python: + min_pin: x.x max_pin: x.x +python: +- 3.10.* *_cpython +- 3.11.* *_cpython +- 3.12.* *_cpython +- 3.8.* *_cpython +- 3.9.* *_cpython +python_impl: +- cpython +- cpython +- cpython +- cpython +- cpython re2: -- 2021.11.01 +- 2023.09.01 target_platform: - osx-arm64 zip_keys: - - c_compiler_version - cxx_compiler_version +- - python + - python_impl zlib: - '1.2' diff --git a/.ci_support/win_64_openssl1.1.1.yaml b/.ci_support/win_64_openssl1.1.1.yaml index 7bcdf35e..83e2b6c3 100644 --- a/.ci_support/win_64_openssl1.1.1.yaml +++ b/.ci_support/win_64_openssl1.1.1.yaml @@ -1,23 +1,45 @@ -abseil_cpp: -- '20210324.2' +c_ares: +- '1' c_compiler: -- vs2017 +- vs2019 +c_stdlib: +- vs channel_sources: - conda-forge channel_targets: - conda-forge main cxx_compiler: -- vs2017 +- vs2019 +libabseil: +- '20240116' libprotobuf: -- '3.19' +- 4.25.3 openssl: -- 1.1.1 +- '3' pin_run_as_build: - zlib: + python: + min_pin: x.x max_pin: x.x +python: +- 3.10.* *_cpython +- 3.11.* *_cpython +- 3.12.* *_cpython +- 3.8.* *_cpython +- 3.9.* *_73_pypy +- 3.9.* *_cpython +python_impl: +- cpython +- cpython +- cpython +- cpython +- pypy +- cpython re2: -- 2021.11.01 +- 2023.09.01 target_platform: - win-64 +zip_keys: +- - python + - python_impl zlib: - '1.2' diff --git a/.circleci/config.yml b/.circleci/config.yml index 6ad461b8..8b4ef2f9 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -1,13 +1,14 @@ # This file was generated automatically from conda-smithy. To update this configuration, # update the conda-forge.yml and/or the recipe/meta.yaml. -# -*- mode: yaml -*- +# -*- mode: jinja-yaml -*- version: 2 jobs: build: working_directory: ~/test - machine: true + machine: + image: ubuntu-2004:current steps: - run: # The Circle-CI build should not be active, but if this is not true for some reason, do a fast finish. diff --git a/.gitattributes b/.gitattributes index ce52713a..78f4c2ae 100644 --- a/.gitattributes +++ b/.gitattributes @@ -9,6 +9,7 @@ bld.bat text eol=crlf # github helper pieces to make some files not show up in diffs automatically .azure-pipelines/* linguist-generated=true .circleci/* linguist-generated=true +.ci_support/* linguist-generated=true .drone/* linguist-generated=true .drone.yml linguist-generated=true .github/* linguist-generated=true diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS index ab45b2b5..9ec9ed8f 100644 --- a/.github/CODEOWNERS +++ b/.github/CODEOWNERS @@ -1 +1 @@ -* @pitrou @wesm @xhochy \ No newline at end of file +* @JohanMabille @h-vetinari @jjerphan @mariusvniekerk @pitrou @wesm @xhochy \ No newline at end of file diff --git a/.github/workflows/automerge.yml b/.github/workflows/automerge.yml index f79fe856..da1368a1 100644 --- a/.github/workflows/automerge.yml +++ b/.github/workflows/automerge.yml @@ -10,10 +10,10 @@ jobs: name: automerge steps: - name: checkout - uses: actions/checkout@v2 + uses: actions/checkout@v3 - name: automerge-action id: automerge-action - uses: conda-forge/automerge-action@master + uses: conda-forge/automerge-action@main with: github_token: ${{ secrets.GITHUB_TOKEN }} rerendering_github_token: ${{ secrets.RERENDERING_GITHUB_TOKEN }} diff --git a/.github/workflows/webservices.yml b/.github/workflows/webservices.yml index 2e5fe71f..d6f06b5c 100644 --- a/.github/workflows/webservices.yml +++ b/.github/workflows/webservices.yml @@ -7,7 +7,7 @@ jobs: steps: - name: webservices id: webservices - uses: conda-forge/webservices-dispatch-action@master + uses: conda-forge/webservices-dispatch-action@main with: github_token: ${{ secrets.GITHUB_TOKEN }} rerendering_github_token: ${{ secrets.RERENDERING_GITHUB_TOKEN }} diff --git a/.gitignore b/.gitignore index c89ecb7d..f044c587 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,24 @@ -*.pyc +# User content belongs under recipe/. +# Feedstock configuration goes in `conda-forge.yml` +# Everything else is managed by the conda-smithy rerender process. +# Please do not modify + +# Ignore all files and folders in root +* +!/abs.yml + +# Don't ignore any files/folders if the parent folder is 'un-ignored' +# This also avoids warnings when adding an already-checked file with an ignored parent. +!/**/ +# Don't ignore any files/folders recursively in the following folders +!/recipe/** +!/.ci_support/** -build_artifacts +# Since we ignore files/folders recursively, any folders inside +# build_artifacts gets ignored which trips some build systems. +# To avoid that we 'un-ignore' all files/folders recursively +# and only ignore the root build_artifacts folder. +!/build_artifacts/** +/build_artifacts + +*.pyc diff --git a/.scripts/build_steps.sh b/.scripts/build_steps.sh index b3d5b819..899ba03c 100755 --- a/.scripts/build_steps.sh +++ b/.scripts/build_steps.sh @@ -24,13 +24,19 @@ export CONFIG_FILE="${CI_SUPPORT}/${CONFIG}.yaml" cat >~/.condarc <=24.1" +mamba update --update-specs --yes --quiet --channel conda-forge --strict-channel-priority \ + pip mamba conda-build conda-forge-ci-setup=4 "conda-build>=24.1" # set up the condarc setup_conda_rc "${FEEDSTOCK_ROOT}" "${RECIPE_ROOT}" "${CONFIG_FILE}" @@ -47,6 +53,10 @@ fi ( endgroup "Configuring conda" ) 2> /dev/null +if [[ -f "${FEEDSTOCK_ROOT}/LICENSE.txt" ]]; then + cp "${FEEDSTOCK_ROOT}/LICENSE.txt" "${RECIPE_ROOT}/recipe-scripts-license.txt" +fi + if [[ "${BUILD_WITH_CONDA_DEBUG:-0}" == 1 ]]; then if [[ "x${BUILD_OUTPUT_ID:-}" != "x" ]]; then EXTRA_CB_OPTIONS="${EXTRA_CB_OPTIONS:-} --output-id ${BUILD_OUTPUT_ID}" @@ -58,9 +68,10 @@ if [[ "${BUILD_WITH_CONDA_DEBUG:-0}" == 1 ]]; then # Drop into an interactive shell /bin/bash else - conda mambabuild "${RECIPE_ROOT}" -m "${CI_SUPPORT}/${CONFIG}.yaml" \ + conda-build "${RECIPE_ROOT}" -m "${CI_SUPPORT}/${CONFIG}.yaml" \ --suppress-variables ${EXTRA_CB_OPTIONS:-} \ - --clobber-file "${CI_SUPPORT}/clobber_${CONFIG}.yaml" + --clobber-file "${CI_SUPPORT}/clobber_${CONFIG}.yaml" \ + --extra-meta flow_run_id="${flow_run_id:-}" remote_url="${remote_url:-}" sha="${sha:-}" ( startgroup "Validating outputs" ) 2> /dev/null validate_recipe_outputs "${FEEDSTOCK_NAME}" diff --git a/.scripts/logging_utils.sh b/.scripts/logging_utils.sh index 57bc95c2..aff009f0 100644 --- a/.scripts/logging_utils.sh +++ b/.scripts/logging_utils.sh @@ -12,7 +12,7 @@ function startgroup { echo "##[group]$1";; travis ) echo "$1" - echo -en 'travis_fold:start:'"${1// /}"'\\r';; + echo -en 'travis_fold:start:'"${1// /}"'\r';; github_actions ) echo "::group::$1";; * ) @@ -28,7 +28,7 @@ function endgroup { azure ) echo "##[endgroup]";; travis ) - echo -en 'travis_fold:end:'"${1// /}"'\\r';; + echo -en 'travis_fold:end:'"${1// /}"'\r';; github_actions ) echo "::endgroup::";; esac diff --git a/.scripts/run_docker_build.sh b/.scripts/run_docker_build.sh index 0c6515fc..00f377a8 100755 --- a/.scripts/run_docker_build.sh +++ b/.scripts/run_docker_build.sh @@ -14,13 +14,19 @@ set -xeo pipefail THISDIR="$( cd "$( dirname "$0" )" >/dev/null && pwd )" PROVIDER_DIR="$(basename $THISDIR)" -FEEDSTOCK_ROOT=$(cd "$(dirname "$0")/.."; pwd;) +FEEDSTOCK_ROOT="$( cd "$( dirname "$0" )/.." >/dev/null && pwd )" RECIPE_ROOT="${FEEDSTOCK_ROOT}/recipe" if [ -z ${FEEDSTOCK_NAME} ]; then export FEEDSTOCK_NAME=$(basename ${FEEDSTOCK_ROOT}) fi +if [[ "${sha:-}" == "" ]]; then + pushd "${FEEDSTOCK_ROOT}" + sha=$(git rev-parse HEAD) + popd +fi + docker info # In order for the conda-build process in the container to write to the mounted @@ -91,6 +97,9 @@ docker run ${DOCKER_RUN_ARGS} \ -e CPU_COUNT \ -e BUILD_WITH_CONDA_DEBUG \ -e BUILD_OUTPUT_ID \ + -e flow_run_id \ + -e remote_url \ + -e sha \ -e BINSTAR_TOKEN \ -e FEEDSTOCK_TOKEN \ -e STAGING_BINSTAR_TOKEN \ diff --git a/.scripts/run_osx_build.sh b/.scripts/run_osx_build.sh index 6774b01e..492b692f 100755 --- a/.scripts/run_osx_build.sh +++ b/.scripts/run_osx_build.sh @@ -22,10 +22,13 @@ bash $MINIFORGE_FILE -b -p ${MINIFORGE_HOME} source ${MINIFORGE_HOME}/etc/profile.d/conda.sh conda activate base +export CONDA_SOLVER="libmamba" +export CONDA_LIBMAMBA_SOLVER_NO_CHANNELS_FROM_INSTALLED=1 -echo -e "\n\nInstalling conda-forge-ci-setup=3 and conda-build." -mamba install -n base --update-specs --quiet --yes "conda-forge-ci-setup=3" conda-build pip boa -mamba update -n base --update-specs --quiet --yes "conda-forge-ci-setup=3" conda-build pip boa +mamba install --update-specs --quiet --yes --channel conda-forge --strict-channel-priority \ + pip mamba conda-build conda-forge-ci-setup=4 "conda-build>=24.1" +mamba update --update-specs --yes --quiet --channel conda-forge --strict-channel-priority \ + pip mamba conda-build conda-forge-ci-setup=4 "conda-build>=24.1" @@ -44,6 +47,10 @@ else echo -e "\n\nNot mangling homebrew as we are not running in CI" fi +if [[ "${sha:-}" == "" ]]; then + sha=$(git rev-parse HEAD) +fi + echo -e "\n\nRunning the build setup script." source run_conda_forge_build_setup @@ -51,25 +58,44 @@ source run_conda_forge_build_setup ( endgroup "Configuring conda" ) 2> /dev/null - echo -e "\n\nMaking the build clobber file" make_build_number ./ ./recipe ./.ci_support/${CONFIG}.yaml -if [[ "${HOST_PLATFORM}" != "${BUILD_PLATFORM}" ]]; then - EXTRA_CB_OPTIONS="${EXTRA_CB_OPTIONS:-} --no-test" +if [[ -f LICENSE.txt ]]; then + cp LICENSE.txt "recipe/recipe-scripts-license.txt" fi -conda mambabuild ./recipe -m ./.ci_support/${CONFIG}.yaml --suppress-variables --clobber-file ./.ci_support/clobber_${CONFIG}.yaml ${EXTRA_CB_OPTIONS:-} -( startgroup "Validating outputs" ) 2> /dev/null +if [[ "${BUILD_WITH_CONDA_DEBUG:-0}" == 1 ]]; then + if [[ "x${BUILD_OUTPUT_ID:-}" != "x" ]]; then + EXTRA_CB_OPTIONS="${EXTRA_CB_OPTIONS:-} --output-id ${BUILD_OUTPUT_ID}" + fi + conda debug ./recipe -m ./.ci_support/${CONFIG}.yaml \ + ${EXTRA_CB_OPTIONS:-} \ + --clobber-file ./.ci_support/clobber_${CONFIG}.yaml -validate_recipe_outputs "${FEEDSTOCK_NAME}" + # Drop into an interactive shell + /bin/bash +else -( endgroup "Validating outputs" ) 2> /dev/null + if [[ "${HOST_PLATFORM}" != "${BUILD_PLATFORM}" ]]; then + EXTRA_CB_OPTIONS="${EXTRA_CB_OPTIONS:-} --no-test" + fi -( startgroup "Uploading packages" ) 2> /dev/null + conda-build ./recipe -m ./.ci_support/${CONFIG}.yaml \ + --suppress-variables ${EXTRA_CB_OPTIONS:-} \ + --clobber-file ./.ci_support/clobber_${CONFIG}.yaml \ + --extra-meta flow_run_id="$flow_run_id" remote_url="$remote_url" sha="$sha" + ( startgroup "Validating outputs" ) 2> /dev/null -if [[ "${UPLOAD_PACKAGES}" != "False" ]] && [[ "${IS_PR_BUILD}" == "False" ]]; then - upload_package --validate --feedstock-name="${FEEDSTOCK_NAME}" ./ ./recipe ./.ci_support/${CONFIG}.yaml -fi + validate_recipe_outputs "${FEEDSTOCK_NAME}" -( endgroup "Uploading packages" ) 2> /dev/null \ No newline at end of file + ( endgroup "Validating outputs" ) 2> /dev/null + + ( startgroup "Uploading packages" ) 2> /dev/null + + if [[ "${UPLOAD_PACKAGES}" != "False" ]] && [[ "${IS_PR_BUILD}" == "False" ]]; then + upload_package --validate --feedstock-name="${FEEDSTOCK_NAME}" ./ ./recipe ./.ci_support/${CONFIG}.yaml + fi + + ( endgroup "Uploading packages" ) 2> /dev/null +fi diff --git a/.scripts/run_win_build.bat b/.scripts/run_win_build.bat new file mode 100755 index 00000000..6d546976 --- /dev/null +++ b/.scripts/run_win_build.bat @@ -0,0 +1,125 @@ +:: PLEASE NOTE: This script has been automatically generated by conda-smithy. Any changes here +:: will be lost next time ``conda smithy rerender`` is run. If you would like to make permanent +:: changes to this script, consider a proposal to conda-smithy so that other feedstocks can also +:: benefit from the improvement. + +:: Note: we assume a Miniforge installation is available + +:: INPUTS (required environment variables) +:: CONFIG: name of the .ci_support/*.yaml file for this job +:: CI: azure, github_actions, or unset +:: UPLOAD_PACKAGES: true or false +:: UPLOAD_ON_BRANCH: true or false + +setlocal enableextensions enabledelayedexpansion + +call :start_group "Configuring conda" + +:: Activate the base conda environment +call activate base +:: Configure the solver +set "CONDA_SOLVER=libmamba" +if !errorlevel! neq 0 exit /b !errorlevel! +set "CONDA_LIBMAMBA_SOLVER_NO_CHANNELS_FROM_INSTALLED=1" + +:: Provision the necessary dependencies to build the recipe later +echo Installing dependencies +mamba.exe install "python=3.10" pip mamba conda-build conda-forge-ci-setup=4 "conda-build>=24.1" -c conda-forge --strict-channel-priority --yes +if !errorlevel! neq 0 exit /b !errorlevel! + +:: Set basic configuration +echo Setting up configuration +setup_conda_rc .\ ".\recipe" .\.ci_support\%CONFIG%.yaml +if !errorlevel! neq 0 exit /b !errorlevel! +echo Running build setup +CALL run_conda_forge_build_setup + + +if !errorlevel! neq 0 exit /b !errorlevel! + +if EXIST LICENSE.txt ( + echo Copying feedstock license + copy LICENSE.txt "recipe\\recipe-scripts-license.txt" +) +if NOT [%HOST_PLATFORM%] == [%BUILD_PLATFORM%] ( + if [%CROSSCOMPILING_EMULATOR%] == [] ( + set "EXTRA_CB_OPTIONS=%EXTRA_CB_OPTIONS% --no-test" + ) +) + +if NOT [%flow_run_id%] == [] ( + set "EXTRA_CB_OPTIONS=%EXTRA_CB_OPTIONS% --extra-meta flow_run_id=%flow_run_id% remote_url=%remote_url% sha=%sha%" +) + +call :end_group + +:: Build the recipe +echo Building recipe +conda-build.exe "recipe" -m .ci_support\%CONFIG%.yaml --suppress-variables %EXTRA_CB_OPTIONS% +if !errorlevel! neq 0 exit /b !errorlevel! + +:: Prepare some environment variables for the upload step +if /i "%CI%" == "github_actions" ( + set "FEEDSTOCK_NAME=%GITHUB_REPOSITORY:*/=%" + set "GIT_BRANCH=%GITHUB_REF:refs/heads/=%" + if /i "%GITHUB_EVENT_NAME%" == "pull_request" ( + set "IS_PR_BUILD=True" + ) else ( + set "IS_PR_BUILD=False" + ) + set "TEMP=%RUNNER_TEMP%" +) +if /i "%CI%" == "azure" ( + set "FEEDSTOCK_NAME=%BUILD_REPOSITORY_NAME:*/=%" + set "GIT_BRANCH=%BUILD_SOURCEBRANCHNAME%" + if /i "%BUILD_REASON%" == "PullRequest" ( + set "IS_PR_BUILD=True" + ) else ( + set "IS_PR_BUILD=False" + ) + set "TEMP=%UPLOAD_TEMP%" +) + +:: Validate +call :start_group "Validating outputs" +validate_recipe_outputs "%FEEDSTOCK_NAME%" +if !errorlevel! neq 0 exit /b !errorlevel! +call :end_group + +if /i "%UPLOAD_PACKAGES%" == "true" ( + if /i "%IS_PR_BUILD%" == "false" ( + call :start_group "Uploading packages" + if not exist "%TEMP%\" md "%TEMP%" + set "TMP=%TEMP%" + upload_package --validate --feedstock-name="%FEEDSTOCK_NAME%" .\ ".\recipe" .ci_support\%CONFIG%.yaml + if !errorlevel! neq 0 exit /b !errorlevel! + call :end_group + ) +) + +exit + +:: Logging subroutines + +:start_group +if /i "%CI%" == "github_actions" ( + echo ::group::%~1 + exit /b +) +if /i "%CI%" == "azure" ( + echo ##[group]%~1 + exit /b +) +echo %~1 +exit /b + +:end_group +if /i "%CI%" == "github_actions" ( + echo ::endgroup:: + exit /b +) +if /i "%CI%" == "azure" ( + echo ##[endgroup] + exit /b +) +exit /b \ No newline at end of file diff --git a/LICENSE.txt b/LICENSE.txt index ed3f451e..2ec51d75 100644 --- a/LICENSE.txt +++ b/LICENSE.txt @@ -1,13 +1,27 @@ -BSD 3-clause license -Copyright (c) 2015-2021, conda-forge contributors +BSD-3-Clause license +Copyright (c) 2015-2022, conda-forge contributors All rights reserved. -Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: -1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. + 1. Redistributions of source code must retain the above copyright notice, + this list of conditions and the following disclaimer. + 2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + 3. Neither the name of the copyright holder nor the names of its + contributors may be used to endorse or promote products derived from + this software without specific prior written permission. -2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. - -3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE FOR +ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH +DAMAGE. diff --git a/README.md b/README.md index fb7b4796..c07ed67e 100644 --- a/README.md +++ b/README.md @@ -1,14 +1,16 @@ -About grpc-cpp -============== +About grpc-cpp-feedstock +======================== + +Feedstock license: [BSD-3-Clause](https://github.com/conda-forge/grpc-cpp-feedstock/blob/main/LICENSE.txt) Home: https://grpc.io/ Package license: Apache-2.0 -Feedstock license: [BSD-3-Clause](https://github.com/conda-forge/grpc-cpp-feedstock/blob/master/LICENSE.txt) - Summary: gRPC - A high-performance, open-source universal RPC framework +Development: https://github.com/grpc/grpc + Documentation: https://grpc.io/docs/ gRPC is a modern, open source, high-performance remote procedure call @@ -31,8 +33,8 @@ Current build status
- - + + @@ -40,85 +42,43 @@ Current build status - - - - - - - - - - - - - - - - - - @@ -134,7 +94,8 @@ Current release info | Name | Downloads | Version | Platforms | | --- | --- | --- | --- | -| [![Conda Recipe](https://img.shields.io/badge/recipe-grpc--cpp-green.svg)](https://anaconda.org/conda-forge/grpc-cpp) | [![Conda Downloads](https://img.shields.io/conda/dn/conda-forge/grpc-cpp.svg)](https://anaconda.org/conda-forge/grpc-cpp) | [![Conda Version](https://img.shields.io/conda/vn/conda-forge/grpc-cpp.svg)](https://anaconda.org/conda-forge/grpc-cpp) | [![Conda Platforms](https://img.shields.io/conda/pn/conda-forge/grpc-cpp.svg)](https://anaconda.org/conda-forge/grpc-cpp) | +| [![Conda Recipe](https://img.shields.io/badge/recipe-grpcio-green.svg)](https://anaconda.org/conda-forge/grpcio) | [![Conda Downloads](https://img.shields.io/conda/dn/conda-forge/grpcio.svg)](https://anaconda.org/conda-forge/grpcio) | [![Conda Version](https://img.shields.io/conda/vn/conda-forge/grpcio.svg)](https://anaconda.org/conda-forge/grpcio) | [![Conda Platforms](https://img.shields.io/conda/pn/conda-forge/grpcio.svg)](https://anaconda.org/conda-forge/grpcio) | +| [![Conda Recipe](https://img.shields.io/badge/recipe-libgrpc-green.svg)](https://anaconda.org/conda-forge/libgrpc) | [![Conda Downloads](https://img.shields.io/conda/dn/conda-forge/libgrpc.svg)](https://anaconda.org/conda-forge/libgrpc) | [![Conda Version](https://img.shields.io/conda/vn/conda-forge/libgrpc.svg)](https://anaconda.org/conda-forge/libgrpc) | [![Conda Platforms](https://img.shields.io/conda/pn/conda-forge/libgrpc.svg)](https://anaconda.org/conda-forge/libgrpc) | Installing grpc-cpp =================== @@ -146,16 +107,41 @@ conda config --add channels conda-forge conda config --set channel_priority strict ``` -Once the `conda-forge` channel has been enabled, `grpc-cpp` can be installed with: +Once the `conda-forge` channel has been enabled, `grpcio, libgrpc` can be installed with `conda`: + +``` +conda install grpcio libgrpc +``` + +or with `mamba`: ``` -conda install grpc-cpp +mamba install grpcio libgrpc ``` -It is possible to list all of the versions of `grpc-cpp` available on your platform with: +It is possible to list all of the versions of `grpcio` available on your platform with `conda`: ``` -conda search grpc-cpp --channel conda-forge +conda search grpcio --channel conda-forge +``` + +or with `mamba`: + +``` +mamba search grpcio --channel conda-forge +``` + +Alternatively, `mamba repoquery` may provide more information: + +``` +# Search all versions available on your platform: +mamba repoquery search grpcio --channel conda-forge + +# List packages depending on `grpcio`: +mamba repoquery whoneeds grpcio --channel conda-forge + +# List dependencies of `grpcio`: +mamba repoquery depends grpcio --channel conda-forge ``` @@ -173,10 +159,12 @@ for each of the installable packages. Such a repository is known as a *feedstock A feedstock is made up of a conda recipe (the instructions on what and how to build the package) and the necessary configurations for automatic building using freely available continuous integration services. Thanks to the awesome service provided by -[CircleCI](https://circleci.com/), [AppVeyor](https://www.appveyor.com/) -and [TravisCI](https://travis-ci.com/) it is possible to build and upload installable -packages to the [conda-forge](https://anaconda.org/conda-forge) -[Anaconda-Cloud](https://anaconda.org/) channel for Linux, Windows and OSX respectively. +[Azure](https://azure.microsoft.com/en-us/services/devops/), [GitHub](https://github.com/), +[CircleCI](https://circleci.com/), [AppVeyor](https://www.appveyor.com/), +[Drone](https://cloud.drone.io/welcome), and [TravisCI](https://travis-ci.com/) +it is possible to build and upload installable packages to the +[conda-forge](https://anaconda.org/conda-forge) [anaconda.org](https://anaconda.org/) +channel for Linux, Windows and OSX respectively. To manage the continuous integration and simplify feedstock maintenance [conda-smithy](https://github.com/conda-forge/conda-smithy) has been developed. @@ -223,6 +211,10 @@ In order to produce a uniquely identifiable distribution: Feedstock Maintainers ===================== +* [@JohanMabille](https://github.com/JohanMabille/) +* [@h-vetinari](https://github.com/h-vetinari/) +* [@jjerphan](https://github.com/jjerphan/) +* [@mariusvniekerk](https://github.com/mariusvniekerk/) * [@pitrou](https://github.com/pitrou/) * [@wesm](https://github.com/wesm/) * [@xhochy](https://github.com/xhochy/) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 6b346f50..e5306da9 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -4,5 +4,5 @@ jobs: - template: ./.azure-pipelines/azure-pipelines-linux.yml - - template: ./.azure-pipelines/azure-pipelines-win.yml - - template: ./.azure-pipelines/azure-pipelines-osx.yml \ No newline at end of file + - template: ./.azure-pipelines/azure-pipelines-osx.yml + - template: ./.azure-pipelines/azure-pipelines-win.yml \ No newline at end of file diff --git a/build-locally.py b/build-locally.py index 8b743489..e0d408d0 100755 --- a/build-locally.py +++ b/build-locally.py @@ -22,10 +22,6 @@ def setup_environment(ns): os.environ["MINIFORGE_HOME"] = os.path.join( os.path.dirname(__file__), "miniforge3" ) - if "OSX_SDK_DIR" not in os.environ: - os.environ["OSX_SDK_DIR"] = os.path.join( - os.path.dirname(__file__), "SDKs" - ) def run_docker_build(ns): @@ -65,11 +61,13 @@ def verify_config(ns): raise ValueError( f"only Linux/macOS configs currently supported, got {ns.config}" ) - elif ns.config.startswith("osx") and platform.system() == "Darwin": + elif ns.config.startswith("osx"): if "OSX_SDK_DIR" not in os.environ: raise RuntimeError( - "Need OSX_SDK_DIR env variable set. Run 'export OSX_SDK_DIR=/opt'" - "to download the SDK automatically to '/opt/MacOSX.sdk'" + "Need OSX_SDK_DIR env variable set. Run 'export OSX_SDK_DIR=$PWD/SDKs' " + "to download the SDK automatically to '$PWD/SDKs/MacOSX.sdk'. " + "Note: OSX_SDK_DIR must be set to an absolute path. " + "Setting this variable implies agreement to the licensing terms of the SDK by Apple." ) @@ -89,12 +87,19 @@ def main(args=None): verify_config(ns) setup_environment(ns) - if ns.config.startswith("linux") or ( - ns.config.startswith("osx") and platform.system() == "Linux" - ): - run_docker_build(ns) - elif ns.config.startswith("osx"): - run_osx_build(ns) + try: + if ns.config.startswith("linux") or ( + ns.config.startswith("osx") and platform.system() == "Linux" + ): + run_docker_build(ns) + elif ns.config.startswith("osx"): + run_osx_build(ns) + finally: + recipe_license_file = os.path.join( + "recipe", "recipe-scripts-license.txt" + ) + if os.path.exists(recipe_license_file): + os.remove(recipe_license_file) if __name__ == "__main__": diff --git a/conda-forge.yml b/conda-forge.yml index 335ae968..7381537e 100644 --- a/conda-forge.yml +++ b/conda-forge.yml @@ -1,8 +1,15 @@ bot: - automerge: true + abi_migration_branches: + - 1.60.x + - 1.59.x build_platform: linux_aarch64: linux_64 linux_ppc64le: linux_64 osx_arm64: osx_64 +conda_build: + pkg_format: '2' conda_forge_output_validation: true -test_on_native_only: true +github: + branch_name: main + tooling_branch_name: main +test: native_and_emulated diff --git a/recipe/build-cpp.bat b/recipe/build-cpp.bat index 1be60694..18856bfb 100644 --- a/recipe/build-cpp.bat +++ b/recipe/build-cpp.bat @@ -1,45 +1,28 @@ @echo on -:: cmd -echo "Building %PKG_NAME%." - -set "CFLAGS=%CFLAGS% /permissive-" -set "CXXFLAGS=%CXXFLAGS% /permissive-" - echo %CFLAGS% echo %CXXFLAGS% mkdir build-cpp cd build-cpp -if errorlevel 1 exit 1 -cmake .. ^ - -GNinja ^ +cmake -GNinja ^ + -DBUILD_SHARED_LIBS=ON ^ -DCMAKE_CXX_STANDARD=17 ^ -DCMAKE_BUILD_TYPE=Release ^ -DCMAKE_PREFIX_PATH=%CONDA_PREFIX% ^ -DCMAKE_INSTALL_PREFIX=%LIBRARY_PREFIX% ^ + -DCMAKE_WINDOWS_EXPORT_ALL_SYMBOLS=ON ^ + -DgRPC_MSVC_STATIC_RUNTIME=OFF ^ -DgRPC_ABSL_PROVIDER="package" ^ -DgRPC_CARES_PROVIDER="package" ^ - -DgRPC_GFLAGS_PROVIDER="package" ^ -DgRPC_PROTOBUF_PROVIDER="package" ^ -DgRPC_SSL_PROVIDER="package" ^ -DgRPC_RE2_PROVIDER="package" ^ -DgRPC_ZLIB_PROVIDER="package" ^ - -DCMAKE_VERBOSE_MAKEFILE=ON -if errorlevel 1 exit 1 - -:: Build. -echo "Building..." -ninja -j%CPU_COUNT% -if errorlevel 1 exit /b 1 - -:: Install. -echo "Installing..." -ninja install -if errorlevel 1 exit /b 1 - + -DProtobuf_PROTOC_EXECUTABLE=%LIBRARY_BIN%\protoc.exe ^ + .. +if %ERRORLEVEL% neq 0 exit 1 -:: Error free exit. -echo "Error free exit!" -exit 0 \ No newline at end of file +cmake --build . --config Release --target install +if %ERRORLEVEL% neq 0 exit 1 diff --git a/recipe/build-cpp.sh b/recipe/build-cpp.sh index d6772ebe..453b1a2a 100755 --- a/recipe/build-cpp.sh +++ b/recipe/build-cpp.sh @@ -1,63 +1,89 @@ #!/bin/bash - set -ex -if [[ "${target_platform}" == osx* ]]; then - export CMAKE_ARGS="${CMAKE_ARGS} -DCMAKE_CXX_STANDARD=14" +export CMAKE_ARGS="${CMAKE_ARGS} -DCMAKE_CXX_STANDARD=17" - # See https://conda-forge.org/docs/maintainer/knowledge_base.html#newer-c-features-with-old-sdk - CXXFLAGS="${CXXFLAGS} -D_LIBCPP_DISABLE_AVAILABILITY" -else - # In Linux, absl-cpp is built on all platforms with C++17's features - # enabled. Specifically, absl::string_view is a typedef/alias of - # std::string_view. Calling a function that uses absl::string_view - # when the standard is below C++17 will result in a link time error - # (undefined reference). - export CMAKE_ARGS="${CMAKE_ARGS} -DCMAKE_CXX_STANDARD=17" +if [[ "$CONDA_BUILD_CROSS_COMPILATION" == 1 ]]; then + # use a separate scope here, so that changes to the compiler + # configuration in this branch don't leak out to the main build + ( + mkdir -p build-host + pushd build-host + + # overwrite default compiler configuration to compile for architecture of + # build agent, since that's where we'll need to execute grpc_cpp_plugin + export CC=$CC_FOR_BUILD + export CXX=$CXX_FOR_BUILD + export LDFLAGS=${LDFLAGS//$PREFIX/$BUILD_PREFIX} + export PKG_CONFIG_PATH=${PKG_CONFIG_PATH//$PREFIX/$BUILD_PREFIX} + export CMAKE_ARGS=${CMAKE_ARGS//$PREFIX/$BUILD_PREFIX} + + # Unset them as we're ok with a build-confined version of + # grpc_cpp_plugin that's either slow or non-portable + unset CFLAGS + unset CXXFLAGS + + cmake -GNinja \ + ${CMAKE_ARGS} \ + -DBUILD_SHARED_LIBS=OFF \ + -DCMAKE_BUILD_TYPE=Release \ + -DCMAKE_PREFIX_PATH=$BUILD_PREFIX \ + -DCMAKE_INSTALL_PREFIX=$BUILD_PREFIX \ + -DgRPC_CARES_PROVIDER="package" \ + -DgRPC_PROTOBUF_PROVIDER="package" \ + -DgRPC_SSL_PROVIDER="package" \ + -DgRPC_ZLIB_PROVIDER="package" \ + -DgRPC_ABSL_PROVIDER="package" \ + -DgRPC_RE2_PROVIDER="package" \ + -DgRPC_BUILD_CODEGEN=ON \ + -DgRPC_BUILD_GRPC_CSHARP_PLUGIN=OFF \ + -DgRPC_BUILD_GRPC_NODE_PLUGIN=OFF \ + -DgRPC_BUILD_GRPC_OBJECTIVE_C_PLUGIN=OFF \ + -DgRPC_BUILD_GRPC_PHP_PLUGIN=OFF \ + -DgRPC_BUILD_GRPC_PYTHON_PLUGIN=OFF \ + -DgRPC_BUILD_GRPC_RUBY_PLUGIN=OFF \ + -DProtobuf_ROOT=$BUILD_PREFIX \ + -DProtobuf_PROTOC_EXECUTABLE=$BUILD_PREFIX/bin/protoc \ + .. + ninja grpc_cpp_plugin + cp grpc_cpp_plugin $BUILD_PREFIX/bin/grpc_cpp_plugin + + popd + ) +elif [[ "${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 mkdir -p build-cpp pushd build-cpp -if [[ $target_platform == osx-* ]]; then - ln -s $BUILD_PREFIX/bin/${HOST}-ar ${HOST}-ar - ln -s $BUILD_PREFIX/bin/${HOST}-ranlib ${HOST}-ranlib -fi -cmake ${CMAKE_ARGS} .. \ - -GNinja \ - -DBUILD_SHARED_LIBS=ON \ - -DCMAKE_BUILD_TYPE=Release \ - -DCMAKE_CXX_FLAGS="$CXXFLAGS" \ - -DCMAKE_PREFIX_PATH=$PREFIX \ - -DCMAKE_INSTALL_PREFIX=$PREFIX \ - -DgRPC_CARES_PROVIDER="package" \ - -DgRPC_GFLAGS_PROVIDER="package" \ - -DgRPC_PROTOBUF_PROVIDER="package" \ - -DProtobuf_ROOT=$PREFIX \ - -DgRPC_SSL_PROVIDER="package" \ - -DgRPC_ZLIB_PROVIDER="package" \ - -DgRPC_ABSL_PROVIDER="package" \ - -DgRPC_RE2_PROVIDER="package" \ - -DCMAKE_AR=${AR} \ - -DCMAKE_RANLIB=${RANLIB} \ - -DCMAKE_VERBOSE_MAKEFILE=ON \ - -DProtobuf_PROTOC_EXECUTABLE=$BUILD_PREFIX/bin/protoc - -# Build. -echo "Building..." -ninja -j${CPU_COUNT} || exit 1 - -# Installing -echo "Installing..." -ninja install || exit 1 +# sanity-check that encapsulation above worked +echo CC="${CC}" +echo CFLAGS="${CFLAGS}" -popd +# point to right protoc +if [[ "$CONDA_BUILD_CROSS_COMPILATION" == 1 ]]; then + export CMAKE_ARGS="${CMAKE_ARGS} -DProtobuf_PROTOC_EXECUTABLE=$BUILD_PREFIX/bin/protoc" +else + export CMAKE_ARGS="${CMAKE_ARGS} -DProtobuf_PROTOC_EXECUTABLE=$PREFIX/bin/protoc" +fi -# These are in conflict with the re2 package. -rm -rf ${PREFIX}/include/re2 -rm -rf ${PREFIX}/lib/libre2.a -rm -rf ${PREFIX}/lib/pkgconfig/re2.pc +cmake -GNinja \ + ${CMAKE_ARGS} \ + -DBUILD_SHARED_LIBS=ON \ + -DCMAKE_BUILD_TYPE=Release \ + -DCMAKE_CXX_FLAGS="$CXXFLAGS" \ + -DCMAKE_PREFIX_PATH=$PREFIX \ + -DCMAKE_INSTALL_PREFIX=$PREFIX \ + -DgRPC_CARES_PROVIDER="package" \ + -DgRPC_PROTOBUF_PROVIDER="package" \ + -DgRPC_SSL_PROVIDER="package" \ + -DgRPC_ZLIB_PROVIDER="package" \ + -DgRPC_ABSL_PROVIDER="package" \ + -DgRPC_RE2_PROVIDER="package" \ + -DProtobuf_ROOT=$PREFIX \ + .. -# Error free exit! -echo "Error free exit!" -exit 0 +ninja install +popd diff --git a/recipe/build-grpcio.bat b/recipe/build-grpcio.bat index 108171dc..a0f80c45 100644 --- a/recipe/build-grpcio.bat +++ b/recipe/build-grpcio.bat @@ -4,14 +4,14 @@ set "GRPC_BUILD_WITH_BORING_SSL_ASM=" set "GRPC_PYTHON_BUILD_SYSTEM_ABSL=True" set "GRPC_PYTHON_BUILD_SYSTEM_CARES=True" set "GRPC_PYTHON_BUILD_SYSTEM_GRPC_CORE=True" +set "GRPC_PYTHON_BUILD_SYSTEM_OPENSSL=True" set "GRPC_PYTHON_BUILD_SYSTEM_RE2=True" -set "GRPC_PYTHON_BUILD_WITH_CYTHON=True" set "GRPC_PYTHON_BUILD_SYSTEM_ZLIB=True" -set "GRPC_PYTHON_BUILD_SYSTEM_OPENSSL=True" +set "GRPC_PYTHON_BUILD_WITH_CYTHON=True" set "GRPC_PYTHON_CFLAGS=/DPB_FIELD_16BIT /std:c++17" :: clearing this regenerates it with cython and fixes phtread usage del src\python\grpcio\grpc\_cython\cygrpc.cpp "%PYTHON%" -m pip install . --no-deps --no-build-isolation --ignore-installed --no-cache-dir -v -if errorlevel 1 exit 1 +if %ERRORLEVEL% neq 0 exit 1 diff --git a/recipe/build-grpcio.sh b/recipe/build-grpcio.sh index c429f71d..542e332d 100644 --- a/recipe/build-grpcio.sh +++ b/recipe/build-grpcio.sh @@ -1,32 +1,27 @@ #!/bin/bash export GRPC_BUILD_WITH_BORING_SSL_ASM="" -export GRPC_PYTHON_BUILD_SYSTEM_ZLIB="True" -export GRPC_PYTHON_BUILD_SYSTEM_OPENSSL="True" -export GRPC_PYTHON_BUILD_SYSTEM_RE2="True" export GRPC_PYTHON_BUILD_SYSTEM_CARES="True" export GRPC_PYTHON_BUILD_SYSTEM_GRPC_CORE="True" -export GRPC_PYTHON_USE_PREBUILT_GRPC_CORE="" +export GRPC_PYTHON_BUILD_SYSTEM_OPENSSL="True" +export GRPC_PYTHON_BUILD_SYSTEM_RE2="True" +export GRPC_PYTHON_BUILD_SYSTEM_ZLIB="True" export GRPC_PYTHON_BUILD_WITH_CYTHON="True" +export GRPC_PYTHON_USE_PREBUILT_GRPC_CORE="" if [[ "${target_platform}" == linux-* ]]; then # set these so the default in setup.py are not used # it seems that we need to link to pthread on linux or osx. export GRPC_PYTHON_LDFLAGS="-lpthread" - elif [[ "$target_platform" == osx-* ]]; then - export CC=$(basename "${CC}") +elif [[ "$target_platform" == osx-* ]]; then export GRPC_PYTHON_LDFLAGS=" -framework CoreFoundation" - # cp $RECIPE_DIR/clang_wrapper.sh $SRC_DIR/$CC - # chmod +x $SRC_DIR/$CC - export SYSTEM_VERSION_COMPAT=1 fi if [[ "$target_platform" == osx-64 ]]; then - export CFLAGS="$CFLAGS -DTARGET_OS_OSX=1 --sysroot ${CONDA_BUILD_SYSROOT} -Wno-unknown-warning-option -Wno-unused-command-line-argument -Wno-nullability-completeness" - export CXXFLAGS="$CXXFLAGS -DTARGET_OS_OSX=1 --sysroot ${CONDA_BUILD_SYSROOT} -Wno-unknown-warning-option -Wno-unused-command-line-argument -Wno-nullability-completeness" + export CFLAGS="$CFLAGS -DTARGET_OS_OSX=1" fi -[[ -f "${SRC_DIR}/cc" ]] || ln -sf "$(which $CC)" "$SRC_DIR/cc" +ln -sf "$(which $CC)" "$SRC_DIR/cc" export PATH="$SRC_DIR:$PATH" $PYTHON -m pip install . --no-deps --no-build-isolation --ignore-installed --no-cache-dir -v diff --git a/recipe/cmake_test/CMakeLists.txt b/recipe/cmake_test/CMakeLists.txt new file mode 100644 index 00000000..e37c63fa --- /dev/null +++ b/recipe/cmake_test/CMakeLists.txt @@ -0,0 +1,6 @@ +project(cf_dummy LANGUAGES C CXX) +cmake_minimum_required(VERSION 3.12) +find_package(gRPC REQUIRED) + +add_executable(grpc_example ${CMAKE_CURRENT_BINARY_DIR}/grpc_example.cc) +target_link_libraries(grpc_example PRIVATE gRPC::grpc++) diff --git a/recipe/cmake_test/grpc_example.cc b/recipe/cmake_test/grpc_example.cc new file mode 100644 index 00000000..a8ae4abd --- /dev/null +++ b/recipe/cmake_test/grpc_example.cc @@ -0,0 +1,18 @@ +// inspired by usage in arrow, see +// https://github.com/apache/arrow/blob/apache-arrow-12.0.0/cpp/src/arrow/flight/transport/grpc/grpc_client.cc#L620-L622 + +#include + +#include + +constexpr char kDummyRootCert[] = + "-----BEGIN CERTIFICATE-----\n" + "[snip]\n" + "-----END CERTIFICATE-----\n"; + +int main() +{ + auto certificate_provider = std::make_shared<::grpc::experimental::StaticDataCertificateProvider>( + kDummyRootCert); + return 0; +} diff --git a/recipe/conda_build_config.yaml b/recipe/conda_build_config.yaml index e0ccbf38..e54a8b03 100644 --- a/recipe/conda_build_config.yaml +++ b/recipe/conda_build_config.yaml @@ -1,13 +1,11 @@ -c_compiler_version: # [linux] - - 11 # [linux] -cxx_compiler_version: # [linux] - - 11 # [linux] cxx_compiler: # [win] - vs2019 # [win] c_compiler: # [win] - vs2019 # [win] CONDA_BUILD_SYSROOT: # [osx and x86] - - /opt/MacOSX10.13.sdk # [osx and x86] + - /opt/MacOSX10.15.sdk # [osx and x86] macos_min_version: # [osx and x86] - - 10.13 # [osx and x86] + - 10.15 # [osx and x86] +MACOSX_DEPLOYMENT_TARGET: # [osx and x86] + - 10.15 # [osx and x86] \ No newline at end of file diff --git a/recipe/tests/include/hello.proto b/recipe/hello.proto similarity index 100% rename from recipe/tests/include/hello.proto rename to recipe/hello.proto diff --git a/recipe/meta.yaml b/recipe/meta.yaml index ab371dd1..0443f4b4 100644 --- a/recipe/meta.yaml +++ b/recipe/meta.yaml @@ -1,78 +1,90 @@ -{% set name = "grpc" %} -{% set version = "1.48.2" %} +{% set version = "1.62.2" %} -{% set libext = '.dll' %} # [win] -{% set libext = '.so' %} # [linux] -{% set libext = '.dylib' %} # [osx] +# core package & vendored libs use different version scheme than CPP libs, see +# https://github.com/grpc/grpc/blob/v1.48.1/CMakeLists.txt#L28-L32 +# the difference of 23 is empirical and most recently changed with 1.54 +{% set core_major = version.split(".")[1] | int - 23 %} +{% set core_version = core_major | string ~ ".0.0" %} + +{% set core_libs = ["gpr", "grpc", "grpc_unsecure"] %} +{% set core_cpp_libs = ["grpc++", "grpc++_unsecure"] %} +{% set vendored_libs = ["address_sorting"] %} +{% set binaries_plugin_langs = [ + "cpp", "csharp", "node", "objective_c", "php", "python", "ruby" +] %} package: - name: {{ name | lower }}-suite + name: grpc-split version: {{ version }} source: - url: https://github.com/{{ name }}/{{ name }}/archive/v{{ version }}.tar.gz - sha256: bdb8e98145469d58c69ab9f2c9e0bd838c2836a99b5760bc0ebf658623768f52 + url: https://github.com/grpc/grpc/archive/v{{ version.replace(".pre", "-pre") }}.tar.gz + sha256: e5d5e0dd96fe9452fe24cc8c827381dca484c54d171fb512a198025fec81a3c8 patches: - patches/0001-windows-ssl-lib-names.patch - patches/0002-fix-win-setup-cmds.patch - patches/0003-Link-against-grpc.patch - patches/0004-force-protoc-executable.patch - - patches/0005-patch-tests-to-use-passed-CXX_STANDARD.patch - - patches/0006-switch-to-C-17-for-grpcio.patch - - patches/0007-fix-abseil-setup.patch + - patches/0005-switch-to-C-17-for-grpcio.patch + - patches/0006-fix-abseil-setup.patch + # mark c-ares, re2 & zlib as private, so they don't need to be found + # at runtime just to link to grp, see grpc/grpc#30838; + # not much point in marking baselibs or vendored libs (e.g. upb) as private + - patches/0007-mark-linkage-of-c-ares-re2-zlib-as-private.patch + - patches/0008-link-grpc-_unsecure-to-grpc.patch + # see https://github.com/grpc/grpc/issues/35794 + - patches/0009-fix-missing-DLL-exports-in-vendored-upb.patch + # fix symbol visibility regression on windows + - patches/0010-for-main-targets-set-_DLL_EXPORTS-when-building-and-.patch build: - number: 4 - #skip: true # [not win] + number: 0 + +requirements: + build: + - patch # [unix] + - m2-patch # [win] outputs: - - name: {{ name }}-cpp - script: build-cpp.sh # [not win] + - name: libgrpc + script: build-cpp.sh # [not win] script: build-cpp.bat # [win] build: - missing_dso_whitelist: # [s390x] - - '$RPATH/ld64.so.1' # [s390x] - script_env: - - LIB_EXT={{libext}} run_exports: - - {{ pin_subpackage('grpc-cpp', max_pin='x.x') }} + - {{ pin_subpackage('libgrpc', max_pin='x.x') }} + # grpc requires C11 aligned_alloc as of 1.56; + # ensure that all dependent packages reflect that to + # avoid the solver getting stuck in no-man's-land. + - __osx >={{ MACOSX_DEPLOYMENT_TARGET }} # [osx and x86_64] + missing_dso_whitelist: # [s390x] + - $RPATH/ld64.so.1 # [s390x] requirements: build: - {{ compiler('c') }} - {{ compiler('cxx') }} - - m2-patch # [win] - - patch # [not win] - - cmake >=3.5.1 - - pkg-config # [unix] - # `protoc` is also used for building - - libprotobuf {{ libprotobuf }} - - ninja + - cmake + - ninja-base + # During cross-compilation, we need to build the grpc_cpp_plugin for the + # architecture of the build agent (where it will be executed afterwards), + # thus we need the respective host dependencies also in the build env. + - c-ares # [build_platform != target_platform] + - libabseil # [build_platform != target_platform] + - libprotobuf # [build_platform != target_platform] + - openssl # [build_platform != target_platform] + - re2 # [build_platform != target_platform] + - zlib # [build_platform != target_platform] host: - - abseil-cpp 20230802.0 + - libabseil 20240116.2 - c-ares 1.19.1 - - libprotobuf {{ libprotobuf }} + - libprotobuf 4.25.3 - re2 2022.04.01 - openssl {{ openssl }} - zlib {{ zlib }} run: - # Need to pin libprotobuf to the same version used when building, - # otherwise we may get a different SO ABI version. - # For example 3.6.1 is ABI-incompatible with 3.6.0... - - {{ pin_compatible("libprotobuf", min_pin="x.x.x", max_pin="x.x.x") }} - - zlib >=1.2.13,<1.3.0a0 - - re2 - - openssl 3.* - - # core package & vendored libs use different version scheme than CPP libs, see - # https://github.com/grpc/grpc/blob/v1.48.1/CMakeLists.txt#L28-L32 - {% set core_version = "26.0.0" %} - - {% set core_libs = ["gpr", "grpc", "grpc_unsecure"] %} - {% set core_cpp_libs = ["grpc++", "grpc++_unsecure"] %} - {% set vendored_libs = ["address_sorting", "upb"] %} - {% set binaries_plugin_langs = [ - "cpp", "csharp", "node", "objective_c", "php", "python", "ruby" - ] %} + - __osx >={{ MACOSX_DEPLOYMENT_TARGET|default("10.9") }} # [osx and x86_64] + run_constrained: + # make sure we don't co-install with old version of previous package name + - grpc-cpp ={{ version }} test: requires: # protoc needs compiler; cmake also needs one to run package detection, see @@ -80,26 +92,26 @@ outputs: - {{ compiler('c') }} - {{ compiler('cxx') }} - cmake - - ninja + - ninja-base - pkg-config files: - - tests/include/* + - cmake_test/ + - hello.proto - test_grpc.sh - test_grpc.bat + source_files: + - examples/ commands: # libraries - - ls %LIBRARY_LIB% # [win] - {% for each_lib in core_libs + core_cpp_libs + vendored_libs %} - # presence of shared libs (unix) + # presence of shared libs - test -f $PREFIX/lib/lib{{ each_lib }}.so # [linux] - test -f $PREFIX/lib/lib{{ each_lib }}.dylib # [osx] + - if not exist %LIBRARY_BIN%\{{ each_lib }}.dll exit 1 # [win] + - if not exist %LIBRARY_LIB%\{{ each_lib }}.lib exit 1 # [win] # absence of static libs (unix) - test ! -f $PREFIX/lib/lib{{ each_lib }}.a # [unix] - - # static libs on windows - - if not exist %LIBRARY_LIB%\{{ each_lib }}.lib exit 1 # [win] {% endfor %} # binaries @@ -109,53 +121,57 @@ outputs: {% endfor %} # pkg-config (no metadata for vendored libs) - # should work on windows in principle, but our openssl builds don't have a .pc file + # a number of dependencies do not have pkgconfig files on windows. e.g. re2 {% for each_lib in core_libs %} - - pkg-config --print-errors --exact-version "{{ core_version }}" {{ each_lib }} # [unix] + - pkg-config --print-errors --exact-version "{{ core_version }}" {{ each_lib }} # [not win] {% endfor %} {% for each_lib in core_cpp_libs %} - - pkg-config --print-errors --exact-version "{{ version }}" {{ each_lib }} # [unix] + - pkg-config --print-errors --exact-version "{{ version }}" {{ each_lib }} # [not win] {% endfor %} + # CMake test: compile upstream example - ./test_grpc.sh # [unix] - ./test_grpc.bat # [win] - - name: {{ name }}io - script: build-grpcio.sh # [not win] + # test availability of symbol needed by arrow (esp. on windows) + - cd cmake_test + - cmake -GNinja -DCMAKE_CXX_STANDARD=17 $CMAKE_ARGS . # [unix] + - cmake -GNinja -DCMAKE_CXX_STANDARD=17 %CMAKE_ARGS% . # [win] + - cmake --build . + + - name: grpcio + script: build-grpcio.sh # [not win] script: build-grpcio.bat # [win] build: missing_dso_whitelist: # [s390x] - - '$RPATH/ld64.so.1' # [s390x] + - $RPATH/ld64.so.1 # [s390x] requirements: build: + - python # [build_platform != target_platform] + - cross-python_{{ target_platform }} # [build_platform != target_platform] + - cython <3 # [build_platform != target_platform] - {{ compiler('c') }} - {{ compiler('cxx') }} - - m2-patch # [win] - - patch # [not win] host: - - {{ pin_subpackage('grpc-cpp', exact=True) }} - python - - cython 0.29 - pip - - pthread-stubs 0.3 # [linux] - setuptools - - wheel >=0.29 - - abseil-cpp 20230802.0 - - c-ares 1.19.1 - - libprotobuf {{ libprotobuf }} - - re2 2022.04.01 - - openssl {{ openssl }} - - zlib {{ zlib }} + - cython <3 + - {{ pin_subpackage('libgrpc', exact=True) }} + - pthread-stubs 0.3 # [linux] run: - python - - {{ pin_subpackage('grpc-cpp', exact=True) }} - - six >=1.6.0 + - {{ pin_subpackage('libgrpc', exact=True) }} - __osx >={{ MACOSX_DEPLOYMENT_TARGET|default("10.9") }} # [osx and x86_64] test: + source_files: + - examples/ files: - grpcio_distribtest.py + - test_grpcio_helloworld.py requires: - pip + - protobuf imports: - grpc - grpc._cython @@ -168,8 +184,17 @@ outputs: - grpc.framework.interfaces.base - grpc.framework.interfaces.face commands: - - pip check + - python -m pip check - python grpcio_distribtest.py + # the following test is flaky on pypy + {% if not (aarch64 or ppc64le) or python_impl == "cpython" %} + # test actual RPC pattern (client & server); other tests did not catch + # https://github.com/conda-forge/grpc-cpp-feedstock/issues/281 + - cd examples/python/helloworld + # copy test defined in feedstock to where it needs to run + - cp ../../../test_grpcio_helloworld.py . + - python test_grpcio_helloworld.py + {% endif %} about: home: https://grpc.io/ @@ -193,4 +218,8 @@ extra: - pitrou - xhochy - wesm - - mingwandroid + - h-vetinari + - mariusvniekerk + - jjerphan + - JohanMabille + feedstock-name: grpc-cpp diff --git a/recipe/patches/0001-windows-ssl-lib-names.patch b/recipe/patches/0001-windows-ssl-lib-names.patch index 664b2b25..940abaa8 100644 --- a/recipe/patches/0001-windows-ssl-lib-names.patch +++ b/recipe/patches/0001-windows-ssl-lib-names.patch @@ -1,7 +1,7 @@ -From a9950ac14243a744bee3e4b1bdbe0aa527d4590e Mon Sep 17 00:00:00 2001 +From c6556038b1e913b84bd6427fa71457b2aa2f8577 Mon Sep 17 00:00:00 2001 From: Jonathan Helmus Date: Mon, 17 Feb 2020 15:45:06 -0600 -Subject: [PATCH 1/7] windows ssl lib names +Subject: [PATCH 01/10] windows ssl lib names Co-Authored-By: Julien Schueller Co-Authored-By: Nicholas Bollweg @@ -11,23 +11,21 @@ Co-Authored-By: Marius van Niekerk 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/setup.py b/setup.py -index ec27fe478f..bea7f92e15 100644 +index 6ebfae1811..07df8358d0 100644 --- a/setup.py +++ b/setup.py -@@ -329,10 +329,10 @@ if "win32" in sys.platform: - 'ws2_32', +@@ -350,10 +350,10 @@ if "win32" in sys.platform: + "ws2_32", ) if BUILD_WITH_SYSTEM_OPENSSL: - EXTENSION_LIBRARIES += ( -- 'ssl', -- 'crypto', +- "ssl", +- "crypto", - ) + if not "win32" in sys.platform: + EXTENSION_LIBRARIES += ('ssl', 'crypto',) + else: + EXTENSION_LIBRARIES += ('libssl', 'libcrypto',) if BUILD_WITH_SYSTEM_ZLIB: - EXTENSION_LIBRARIES += ('z',) - if BUILD_WITH_SYSTEM_CARES: --- -2.37.0.windows.1 + EXTENSION_LIBRARIES += ("z",) + if BUILD_WITH_SYSTEM_CARES: \ No newline at end of file diff --git a/recipe/patches/0002-fix-win-setup-cmds.patch b/recipe/patches/0002-fix-win-setup-cmds.patch index 41c70208..130bdfbd 100644 --- a/recipe/patches/0002-fix-win-setup-cmds.patch +++ b/recipe/patches/0002-fix-win-setup-cmds.patch @@ -1,30 +1,22 @@ -From 7e719c99e27562f31868e5d0fd1c455e6519bba3 Mon Sep 17 00:00:00 2001 +From ef1656b4c28aea56b64ddcbebc4d9b08f591b8d7 Mon Sep 17 00:00:00 2001 From: Mike Sarahan Date: Tue, 18 Feb 2020 13:53:05 -0600 -Subject: [PATCH 2/7] fix win setup cmds +Subject: [PATCH 02/10] fix win setup cmds Co-Authored-By: Julien Schueller Co-Authored-By: Nicholas Bollweg Co-Authored-By: Marius van Niekerk Co-Authored-By: H. Vetinari --- - setup.py | 9 ++++----- + setup.py | 6 +++--- src/python/grpcio/commands.py | 2 ++ - 2 files changed, 6 insertions(+), 5 deletions(-) + 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/setup.py b/setup.py -index bea7f92e15..a46c3ae795 100644 +index 07df8358d0..dfe4c9caa7 100644 --- a/setup.py +++ b/setup.py -@@ -24,7 +24,6 @@ from distutils.unixccompiler import UnixCCompiler - UnixCCompiler.src_extensions.append('.S') - del UnixCCompiler - --from distutils import cygwinccompiler - from distutils import extension as _extension - from distutils import util - import os -@@ -203,6 +202,9 @@ ENABLE_DOCUMENTATION_BUILD = _env_bool_value( +@@ -208,6 +208,9 @@ ENABLE_DOCUMENTATION_BUILD = _env_bool_value( def check_linker_need_libatomic(): @@ -32,32 +24,23 @@ index bea7f92e15..a46c3ae795 100644 + return False + """Test if linker on system needs libatomic.""" - code_test = (b'#include \n' + - b'int main() { return std::atomic{}; }') -@@ -247,10 +249,6 @@ if EXTRA_ENV_COMPILE_ARGS is None: - EXTRA_ENV_COMPILE_ARGS += ' -D_ftime=_ftime32 -D_timeb=__timeb32 -D_ftime_s=_ftime32_s' - else: - EXTRA_ENV_COMPILE_ARGS += ' -D_ftime=_ftime64 -D_timeb=__timeb64' -- else: -- # We need to statically link the C++ Runtime, only the C runtime is -- # available dynamically -- EXTRA_ENV_COMPILE_ARGS += ' /MT' + code_test = ( + b"#include \n" +@@ -249,9 +252,6 @@ if EXTRA_ENV_COMPILE_ARGS is None: + if "win32" in sys.platform: + # MSVC by defaults uses C++14 so C11 needs to be specified. + EXTRA_ENV_COMPILE_ARGS += " /std:c11" +- # We need to statically link the C++ Runtime, only the C runtime is +- # available dynamically +- EXTRA_ENV_COMPILE_ARGS += " /MT" elif "linux" in sys.platform: - EXTRA_ENV_COMPILE_ARGS += ' -fvisibility=hidden -fno-wrapv -fno-exceptions' - elif "darwin" in sys.platform: -@@ -263,6 +261,7 @@ if EXTRA_ENV_LINK_ARGS is None: - if check_linker_need_libatomic(): - EXTRA_ENV_LINK_ARGS += ' -latomic' - elif "win32" in sys.platform and sys.version_info < (3, 5): -+ from distutils import cygwinccompiler - msvcr = cygwinccompiler.get_msvcr()[0] - EXTRA_ENV_LINK_ARGS += ( - ' -static-libgcc -static-libstdc++ -mcrtdll={msvcr}' + # GCC by defaults uses C17 so only C++14 needs to be specified. + EXTRA_ENV_COMPILE_ARGS += " -std=c++14" diff --git a/src/python/grpcio/commands.py b/src/python/grpcio/commands.py -index d93b6c7039..024512624a 100644 +index 98324c955f..484aef0d8b 100644 --- a/src/python/grpcio/commands.py +++ b/src/python/grpcio/commands.py -@@ -226,6 +226,8 @@ class BuildExt(build_ext.build_ext): +@@ -252,6 +252,8 @@ class BuildExt(build_ext.build_ext): """Test if default compiler is okay with specifying c++ version when invoked in C mode. GCC is okay with this, while clang is not. """ @@ -65,6 +48,4 @@ index d93b6c7039..024512624a 100644 + return False try: # TODO(lidiz) Remove the generated a.out for success tests. - cc_test = subprocess.Popen(['cc', '-x', 'c', '-std=c++14', '-'], --- -2.37.0.windows.1 + cc = os.environ.get("CC", "cc") \ No newline at end of file diff --git a/recipe/patches/0003-Link-against-grpc.patch b/recipe/patches/0003-Link-against-grpc.patch index ddb25a27..62fe4e56 100644 --- a/recipe/patches/0003-Link-against-grpc.patch +++ b/recipe/patches/0003-Link-against-grpc.patch @@ -1,39 +1,41 @@ -From 4c9d33286be7619a5a083a330502522d8a43a348 Mon Sep 17 00:00:00 2001 +From 5957c91f83b93c550266761cedfbcd747bf9dc18 Mon Sep 17 00:00:00 2001 From: Marius van Niekerk Date: Mon, 13 Jun 2022 17:13:07 -0400 -Subject: [PATCH 3/7] Link against grpc +Subject: [PATCH 03/10] Link against grpc +Co-Authored-By: H. Vetinari --- - setup.py | 10 ++++++++++ - 1 file changed, 10 insertions(+) + setup.py | 11 +++++++++++ + 1 file changed, 11 insertions(+) diff --git a/setup.py b/setup.py -index a46c3ae795..4c06e38e95 100644 +index dfe4c9caa7..d410af9006 100644 --- a/setup.py +++ b/setup.py -@@ -171,6 +171,8 @@ BUILD_WITH_SYSTEM_ABSL = os.environ.get('GRPC_PYTHON_BUILD_SYSTEM_ABSL', False) - BUILD_WITH_STATIC_LIBSTDCXX = _env_bool_value( - 'GRPC_PYTHON_BUILD_WITH_STATIC_LIBSTDCXX', 'False') +@@ -179,6 +179,8 @@ BUILD_WITH_STATIC_LIBSTDCXX = _env_bool_value( + "GRPC_PYTHON_BUILD_WITH_STATIC_LIBSTDCXX", "False" + ) +BUILD_WITH_SYSTEM_GRPC_CORE = _env_bool_value('GRPC_PYTHON_BUILD_SYSTEM_GRPC_CORE', 'False') + # For local development use only: This skips building gRPC Core and its # dependencies, including protobuf and boringssl. This allows "incremental" # compilation by first building gRPC Core using make, then building only the -@@ -341,6 +343,11 @@ if BUILD_WITH_SYSTEM_RE2: - if BUILD_WITH_SYSTEM_ABSL: +@@ -364,6 +366,12 @@ if BUILD_WITH_SYSTEM_ABSL: EXTENSION_LIBRARIES += tuple( - lib.stem[3:] for lib in pathlib.Path('/usr').glob('lib*/libabsl_*.so')) + lib.stem[3:] for lib in pathlib.Path("/usr").glob("lib*/libabsl_*.so") + ) +if BUILD_WITH_SYSTEM_GRPC_CORE: + EXTENSION_LIBRARIES += ('gpr', 'grpc', ) + if "win32" in sys.platform: -+ EXTENSION_LIBRARIES += ('libprotoc', 'libprotobuf', 'libprotobuf-lite', 'upb', 'address_sorting', ) ++ EXTENSION_LIBRARIES += ('libprotoc', 'libprotobuf', 'address_sorting',) ++ EXTENSION_LIBRARIES += tuple(f'upb_{x}_lib' for x in ["base", "json", "mem", "message", "textformat"]) + EXTENSION_LIBRARIES += tuple(lib.stem for lib in pathlib.Path(os.environ['LIBRARY_LIB']).glob('absl_*.lib')) - DEFINE_MACROS = (('_WIN32_WINNT', 0x600),) + DEFINE_MACROS = (("_WIN32_WINNT", 0x600),) asm_files = [] -@@ -447,6 +454,9 @@ def cython_extensions_and_necessity(): - prefix + 'libgpr.a', prefix + 'libgrpc.a' +@@ -486,6 +494,9 @@ def cython_extensions_and_necessity(): + prefix + "libgrpc.a", ] core_c_files = [] + elif BUILD_WITH_SYSTEM_GRPC_CORE: @@ -41,6 +43,4 @@ index a46c3ae795..4c06e38e95 100644 + extra_objects = [] else: core_c_files = list(CORE_C_FILES) - extra_objects = [] --- -2.37.0.windows.1 + extra_objects = [] \ No newline at end of file diff --git a/recipe/patches/0004-force-protoc-executable.patch b/recipe/patches/0004-force-protoc-executable.patch index 7b8b434a..8939e4b7 100644 --- a/recipe/patches/0004-force-protoc-executable.patch +++ b/recipe/patches/0004-force-protoc-executable.patch @@ -1,17 +1,17 @@ -From e3bf11af71a8c374fa01ed509c0706fb47631285 Mon Sep 17 00:00:00 2001 +From 63db0bf5d058836da172ff9c3c7fc113e1bfd52c Mon Sep 17 00:00:00 2001 From: "Uwe L. Korn" Date: Fri, 11 Sep 2020 14:20:04 +0200 -Subject: [PATCH 4/7] force protoc executable +Subject: [PATCH 04/10] force protoc executable --- cmake/protobuf.cmake | 17 ++--------------- 1 file changed, 2 insertions(+), 15 deletions(-) diff --git a/cmake/protobuf.cmake b/cmake/protobuf.cmake -index f23f65d40e..574068017a 100644 +index fab2eb00e9..fd3f326247 100644 --- a/cmake/protobuf.cmake +++ b/cmake/protobuf.cmake -@@ -75,21 +75,8 @@ elseif(gRPC_PROTOBUF_PROVIDER STREQUAL "package") +@@ -71,21 +71,8 @@ elseif(gRPC_PROTOBUF_PROVIDER STREQUAL "package") set(_gRPC_PROTOBUF_PROTOC_LIBRARIES ${PROTOBUF_PROTOC_LIBRARIES}) set(_gRPC_PROTOBUF_WELLKNOWN_INCLUDE_DIR ${PROTOBUF_INCLUDE_DIRS}) endif() @@ -32,8 +32,6 @@ index f23f65d40e..574068017a 100644 - endif() + set(_gRPC_PROTOBUF_PROTOC_EXECUTABLE ${Protobuf_PROTOC_EXECUTABLE}) + set(_gRPC_PROTOBUF_PROTOC ${Protobuf_PROTOC_EXECUTABLE}) - set(_gRPC_FIND_PROTOBUF "if(NOT Protobuf_FOUND AND NOT PROTOBUF_FOUND)\n find_package(Protobuf ${gRPC_PROTOBUF_PACKAGE_TYPE})\nendif()") + set(_gRPC_FIND_PROTOBUF "include(CMakeFindDependencyMacro)\nfind_dependency(Protobuf CONFIG)") endif() - endif() --- -2.37.0.windows.1 + endif() \ No newline at end of file diff --git a/recipe/patches/0005-patch-tests-to-use-passed-CXX_STANDARD.patch b/recipe/patches/0005-patch-tests-to-use-passed-CXX_STANDARD.patch deleted file mode 100644 index 5e1e1dee..00000000 --- a/recipe/patches/0005-patch-tests-to-use-passed-CXX_STANDARD.patch +++ /dev/null @@ -1,26 +0,0 @@ -From 795a8dea3cba2958b01131bc9c9c68288bf7a5ce Mon Sep 17 00:00:00 2001 -From: "H. Vetinari" -Date: Wed, 31 Aug 2022 18:52:58 +0200 -Subject: [PATCH 5/7] patch tests to use passed CXX_STANDARD - ---- - examples/cpp/cmake/common.cmake | 4 +++- - 1 file changed, 3 insertions(+), 1 deletion(-) - -diff --git a/examples/cpp/cmake/common.cmake b/examples/cpp/cmake/common.cmake -index 3e12e2d6d4..1326a5be3a 100644 ---- a/examples/cpp/cmake/common.cmake -+++ b/examples/cpp/cmake/common.cmake -@@ -19,7 +19,9 @@ - - cmake_minimum_required(VERSION 3.5.1) - --set (CMAKE_CXX_STANDARD 14) -+if (NOT DEFINED CMAKE_CXX_STANDARD) -+ set (CMAKE_CXX_STANDARD 14) -+endif() - - if(MSVC) - add_definitions(-D_WIN32_WINNT=0x600) --- -2.37.0.windows.1 diff --git a/recipe/patches/0005-switch-to-C-17-for-grpcio.patch b/recipe/patches/0005-switch-to-C-17-for-grpcio.patch new file mode 100644 index 00000000..a995253b --- /dev/null +++ b/recipe/patches/0005-switch-to-C-17-for-grpcio.patch @@ -0,0 +1,51 @@ +From 80df2ca96a075552360b17ad4bc007be26f89d50 Mon Sep 17 00:00:00 2001 +From: "H. Vetinari" +Date: Sat, 3 Sep 2022 19:23:15 +0200 +Subject: [PATCH 05/10] switch to C++17 for grpcio + +--- + setup.py | 10 +++++----- + 1 file changed, 5 insertions(+), 5 deletions(-) + +diff --git a/setup.py b/setup.py +index d410af9006..62084b7800 100644 +--- a/setup.py ++++ b/setup.py +@@ -220,7 +220,7 @@ def check_linker_need_libatomic(): + ) + cxx = shlex.split(os.environ.get("CXX", "c++")) + cpp_test = subprocess.Popen( +- cxx + ["-x", "c++", "-std=c++14", "-"], ++ cxx + ["-x", "c++", "-std=c++17", "-"], + stdin=PIPE, + stdout=PIPE, + stderr=PIPE, +@@ -231,7 +231,7 @@ def check_linker_need_libatomic(): + # Double-check to see if -latomic actually can solve the problem. + # https://github.com/grpc/grpc/issues/22491 + cpp_test = subprocess.Popen( +- cxx + ["-x", "c++", "-std=c++14", "-", "-latomic"], ++ cxx + ["-x", "c++", "-std=c++17", "-", "-latomic"], + stdin=PIPE, + stdout=PIPE, + stderr=PIPE, +@@ -253,16 +253,16 @@ if EXTRA_ENV_COMPILE_ARGS is None: + EXTRA_ENV_COMPILE_ARGS = "" + if "win32" in sys.platform: + # MSVC by defaults uses C++14 so C11 needs to be specified. +- EXTRA_ENV_COMPILE_ARGS += " /std:c11" ++ EXTRA_ENV_COMPILE_ARGS += " /std:c11 /std:c++17" + elif "linux" in sys.platform: + # GCC by defaults uses C17 so only C++14 needs to be specified. +- EXTRA_ENV_COMPILE_ARGS += " -std=c++14" ++ EXTRA_ENV_COMPILE_ARGS += " -std=c++17" + EXTRA_ENV_COMPILE_ARGS += ( + " -fvisibility=hidden -fno-wrapv -fno-exceptions" + ) + elif "darwin" in sys.platform: + # AppleClang by defaults uses C17 so only C++14 needs to be specified. +- EXTRA_ENV_COMPILE_ARGS += " -std=c++14" ++ EXTRA_ENV_COMPILE_ARGS += " -std=c++17" + EXTRA_ENV_COMPILE_ARGS += ( + " -stdlib=libc++ -fvisibility=hidden -fno-wrapv -fno-exceptions" + " -DHAVE_UNISTD_H" diff --git a/recipe/patches/0006-fix-abseil-setup.patch b/recipe/patches/0006-fix-abseil-setup.patch new file mode 100644 index 00000000..9375f70a --- /dev/null +++ b/recipe/patches/0006-fix-abseil-setup.patch @@ -0,0 +1,40 @@ +From 3cd2e79d2963d5b351a3c2e1a0291eac59db9e87 Mon Sep 17 00:00:00 2001 +From: "H. Vetinari" +Date: Sun, 4 Sep 2022 14:34:52 +0200 +Subject: [PATCH 06/10] fix abseil setup + +--- + setup.py | 15 +++++++++++---- + 1 file changed, 11 insertions(+), 4 deletions(-) + +diff --git a/setup.py b/setup.py +index 62084b7800..aa70b88cf9 100644 +--- a/setup.py ++++ b/setup.py +@@ -363,15 +363,22 @@ if BUILD_WITH_SYSTEM_CARES: + if BUILD_WITH_SYSTEM_RE2: + EXTENSION_LIBRARIES += ("re2",) + if BUILD_WITH_SYSTEM_ABSL: +- EXTENSION_LIBRARIES += tuple( +- lib.stem[3:] for lib in pathlib.Path("/usr").glob("lib*/libabsl_*.so") +- ) ++ if "win32" in sys.platform: ++ absl_libs = ( ++ 'abseil_dll', 'absl_log_flags', 'absl_flags_commandlineflag', 'absl_flags_commandlineflag_internal', ++ 'absl_flags_config', 'absl_flags_internal', 'absl_flags_marshalling', 'absl_flags_parse', ++ 'absl_flags_private_handle_accessor', 'absl_flags_program_name', 'absl_flags_reflection', ++ 'absl_flags_usage', 'absl_flags_usage_internal', ++ ) ++ else: ++ absl_glob = pathlib.Path(os.environ['PREFIX']).glob('lib/libabsl_*.so') ++ absl_libs = tuple(lib.stem[3:] for lib in absl_glob) ++ EXTENSION_LIBRARIES += absl_libs + if BUILD_WITH_SYSTEM_GRPC_CORE: + EXTENSION_LIBRARIES += ('gpr', 'grpc', ) + if "win32" in sys.platform: + EXTENSION_LIBRARIES += ('libprotoc', 'libprotobuf', 'address_sorting',) + EXTENSION_LIBRARIES += tuple(f'upb_{x}_lib' for x in ["base", "json", "mem", "message", "textformat"]) +- EXTENSION_LIBRARIES += tuple(lib.stem for lib in pathlib.Path(os.environ['LIBRARY_LIB']).glob('absl_*.lib')) + + DEFINE_MACROS = (("_WIN32_WINNT", 0x600),) + asm_files = [] diff --git a/recipe/patches/0006-switch-to-C-17-for-grpcio.patch b/recipe/patches/0006-switch-to-C-17-for-grpcio.patch deleted file mode 100644 index a2dedaf3..00000000 --- a/recipe/patches/0006-switch-to-C-17-for-grpcio.patch +++ /dev/null @@ -1,42 +0,0 @@ -From 3767f8153b6c1bf06e4eea9289af39fd4c08124f Mon Sep 17 00:00:00 2001 -From: "H. Vetinari" -Date: Sat, 3 Sep 2022 19:23:15 +0200 -Subject: [PATCH 6/7] switch to C++17 for grpcio - ---- - setup.py | 6 +++--- - 1 file changed, 3 insertions(+), 3 deletions(-) - -diff --git a/setup.py b/setup.py -index 4c06e38e95..6265b7c0ae 100644 ---- a/setup.py -+++ b/setup.py -@@ -211,7 +211,7 @@ def check_linker_need_libatomic(): - code_test = (b'#include \n' + - b'int main() { return std::atomic{}; }') - cxx = shlex.split(os.environ.get('CXX', 'c++')) -- cpp_test = subprocess.Popen(cxx + ['-x', 'c++', '-std=c++14', '-'], -+ cpp_test = subprocess.Popen(cxx + ['-x', 'c++', '-std=c++17', '-'], - stdin=PIPE, - stdout=PIPE, - stderr=PIPE) -@@ -221,7 +221,7 @@ def check_linker_need_libatomic(): - # Double-check to see if -latomic actually can solve the problem. - # https://github.com/grpc/grpc/issues/22491 - cpp_test = subprocess.Popen( -- [cxx, '-x', 'c++', '-std=c++14', '-', '-latomic'], -+ [cxx, '-x', 'c++', '-std=c++17', '-', '-latomic'], - stdin=PIPE, - stdout=PIPE, - stderr=PIPE) -@@ -239,7 +239,7 @@ def check_linker_need_libatomic(): - EXTRA_ENV_COMPILE_ARGS = os.environ.get('GRPC_PYTHON_CFLAGS', None) - EXTRA_ENV_LINK_ARGS = os.environ.get('GRPC_PYTHON_LDFLAGS', None) - if EXTRA_ENV_COMPILE_ARGS is None: -- EXTRA_ENV_COMPILE_ARGS = ' -std=c++14' -+ EXTRA_ENV_COMPILE_ARGS = ' -std=c++17' - if 'win32' in sys.platform: - if sys.version_info < (3, 5): - EXTRA_ENV_COMPILE_ARGS += ' -D_hypot=hypot' --- -2.37.0.windows.1 diff --git a/recipe/patches/0007-fix-abseil-setup.patch b/recipe/patches/0007-fix-abseil-setup.patch deleted file mode 100644 index 2911411e..00000000 --- a/recipe/patches/0007-fix-abseil-setup.patch +++ /dev/null @@ -1,35 +0,0 @@ -From e5a74d16a7a6ad41dbc40cee6f000fa23eeb9d55 Mon Sep 17 00:00:00 2001 -From: "H. Vetinari" -Date: Sun, 4 Sep 2022 14:34:52 +0200 -Subject: [PATCH 7/7] fix abseil setup - ---- - setup.py | 9 ++++++--- - 1 file changed, 6 insertions(+), 3 deletions(-) - -diff --git a/setup.py b/setup.py -index 6265b7c0ae..aa80cacdb1 100644 ---- a/setup.py -+++ b/setup.py -@@ -341,13 +341,16 @@ if BUILD_WITH_SYSTEM_CARES: - if BUILD_WITH_SYSTEM_RE2: - EXTENSION_LIBRARIES += ('re2',) - if BUILD_WITH_SYSTEM_ABSL: -- EXTENSION_LIBRARIES += tuple( -- lib.stem[3:] for lib in pathlib.Path('/usr').glob('lib*/libabsl_*.so')) -+ if "win32" in sys.platform: -+ absl_libs = ('abseil_dll', 'absl_flags',) -+ else: -+ absl_glob = pathlib.Path(os.environ['PREFIX']).glob('lib/libabsl_*.so') -+ absl_libs = tuple(lib.stem[3:] for lib in absl_glob) -+ EXTENSION_LIBRARIES += absl_libs - if BUILD_WITH_SYSTEM_GRPC_CORE: - EXTENSION_LIBRARIES += ('gpr', 'grpc', ) - if "win32" in sys.platform: - EXTENSION_LIBRARIES += ('libprotoc', 'libprotobuf', 'libprotobuf-lite', 'upb', 'address_sorting', ) -- EXTENSION_LIBRARIES += tuple(lib.stem for lib in pathlib.Path(os.environ['LIBRARY_LIB']).glob('absl_*.lib')) - - DEFINE_MACROS = (('_WIN32_WINNT', 0x600),) - asm_files = [] --- -2.37.0.windows.1 diff --git a/recipe/patches/0007-mark-linkage-of-c-ares-re2-zlib-as-private.patch b/recipe/patches/0007-mark-linkage-of-c-ares-re2-zlib-as-private.patch new file mode 100644 index 00000000..dc4642ec --- /dev/null +++ b/recipe/patches/0007-mark-linkage-of-c-ares-re2-zlib-as-private.patch @@ -0,0 +1,140 @@ +From c627a532deba9fa62c6406473807339eeb12b3df Mon Sep 17 00:00:00 2001 +From: "H. Vetinari" +Date: Tue, 23 Aug 2022 11:45:20 +0200 +Subject: [PATCH 07/10] mark linkage of c-ares/re2/zlib as private + +See also: https://github.com/grpc/grpc/issues/30838 + +Co-Authored-By: Mark Harfouche +--- + CMakeLists.txt | 106 +++++++++++++++++++++++++++---------------------- + 1 file changed, 58 insertions(+), 48 deletions(-) + +diff --git a/CMakeLists.txt b/CMakeLists.txt +index c5123edadf..a63a81a755 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -2617,33 +2617,38 @@ target_include_directories(grpc + ${_gRPC_ZLIB_INCLUDE_DIR} + ) + target_link_libraries(grpc +- ${_gRPC_ALLTARGETS_LIBRARIES} +- upb_json_lib +- upb_textformat_lib +- ${_gRPC_RE2_LIBRARIES} +- ${_gRPC_ZLIB_LIBRARIES} +- absl::algorithm_container +- absl::config +- absl::cleanup +- absl::flat_hash_map +- absl::flat_hash_set +- absl::inlined_vector +- absl::bind_front +- absl::function_ref +- absl::hash +- absl::type_traits +- absl::random_bit_gen_ref +- absl::random_distributions +- absl::statusor +- absl::span +- absl::utility +- ${_gRPC_CARES_LIBRARIES} +- gpr +- ${_gRPC_SSL_LIBRARIES} +- ${_gRPC_ADDRESS_SORTING_LIBRARIES} ++ # core libs ++ PUBLIC ${_gRPC_ALLTARGETS_LIBRARIES} ++ # vendored libs ++ PUBLIC ${_gRPC_ADDRESS_SORTING_LIBRARIES} ++ PUBLIC upb_json_lib ++ PUBLIC upb_textformat_lib ++ # external dependencies used within grpc ++ PRIVATE ${_gRPC_CARES_LIBRARIES} ++ PRIVATE ${_gRPC_RE2_LIBRARIES} ++ PRIVATE ${_gRPC_ZLIB_LIBRARIES} ++ # external dependencies that need to available at runtime ++ PUBLIC ${_gRPC_SSL_LIBRARIES} ++ PUBLIC absl::algorithm_container ++ PUBLIC absl::config ++ PUBLIC absl::cleanup ++ PUBLIC absl::flat_hash_map ++ PUBLIC absl::flat_hash_set ++ PUBLIC absl::inlined_vector ++ PUBLIC absl::bind_front ++ PUBLIC absl::function_ref ++ PUBLIC absl::hash ++ PUBLIC absl::type_traits ++ PUBLIC absl::random_bit_gen_ref ++ PUBLIC absl::random_distributions ++ PUBLIC absl::statusor ++ PUBLIC absl::span ++ PUBLIC absl::utility ++ # targets which belong to grpc anyway ++ PUBLIC gpr + ) + if(_gRPC_PLATFORM_IOS OR _gRPC_PLATFORM_MAC) +- target_link_libraries(grpc "-framework CoreFoundation") ++ target_link_libraries(grpc PUBLIC "-framework CoreFoundation") + endif() + + foreach(_hdr +@@ -3323,31 +3328,36 @@ target_include_directories(grpc_unsecure + ${_gRPC_ZLIB_INCLUDE_DIR} + ) + target_link_libraries(grpc_unsecure +- ${_gRPC_ALLTARGETS_LIBRARIES} +- upb_message_lib +- utf8_range_lib +- ${_gRPC_ZLIB_LIBRARIES} +- absl::algorithm_container +- absl::config +- absl::cleanup +- absl::flat_hash_map +- absl::flat_hash_set +- absl::inlined_vector +- absl::bind_front +- absl::function_ref +- absl::hash +- absl::type_traits +- absl::random_bit_gen_ref +- absl::random_distributions +- absl::statusor +- absl::span +- absl::utility +- ${_gRPC_CARES_LIBRARIES} +- gpr +- ${_gRPC_ADDRESS_SORTING_LIBRARIES} ++ # core libs ++ PUBLIC ${_gRPC_ALLTARGETS_LIBRARIES} ++ # vendored libs ++ PUBLIC ${_gRPC_ADDRESS_SORTING_LIBRARIES} ++ PUBLIC upb_message_lib ++ PUBLIC utf8_range_lib ++ # external dependencies used within grpc ++ PRIVATE ${_gRPC_CARES_LIBRARIES} ++ PRIVATE ${_gRPC_ZLIB_LIBRARIES} ++ # external dependencies that need to available at runtime ++ PUBLIC absl::algorithm_container ++ PUBLIC absl::config ++ PUBLIC absl::cleanup ++ PUBLIC absl::flat_hash_map ++ PUBLIC absl::flat_hash_set ++ PUBLIC absl::inlined_vector ++ PUBLIC absl::bind_front ++ PUBLIC absl::function_ref ++ PUBLIC absl::hash ++ PUBLIC absl::type_traits ++ PUBLIC absl::random_bit_gen_ref ++ PUBLIC absl::random_distributions ++ PUBLIC absl::statusor ++ PUBLIC absl::span ++ PUBLIC absl::utility ++ # targets which belong to grpc anyway ++ PUBLIC gpr + ) + if(_gRPC_PLATFORM_IOS OR _gRPC_PLATFORM_MAC) +- target_link_libraries(grpc_unsecure "-framework CoreFoundation") ++ target_link_libraries(grpc_unsecure PUBLIC "-framework CoreFoundation") + endif() + + foreach(_hdr diff --git a/recipe/patches/0008-link-grpc-_unsecure-to-grpc.patch b/recipe/patches/0008-link-grpc-_unsecure-to-grpc.patch new file mode 100644 index 00000000..8faea1ca --- /dev/null +++ b/recipe/patches/0008-link-grpc-_unsecure-to-grpc.patch @@ -0,0 +1,22 @@ +From 6483539e6fd893c26d7b53986f5758844c74d5b3 Mon Sep 17 00:00:00 2001 +From: "H. Vetinari" +Date: Fri, 9 Jun 2023 20:11:22 +1100 +Subject: [PATCH 08/10] link grpc++_unsecure to grpc++ + +which is where FileWatcherCertificateProvider etc. live +--- + CMakeLists.txt | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/CMakeLists.txt b/CMakeLists.txt +index a63a81a755..6136bbaa10 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -4868,6 +4868,7 @@ target_link_libraries(grpc++_unsecure + ${_gRPC_ALLTARGETS_LIBRARIES} + grpc_unsecure + ${_gRPC_PROTOBUF_LIBRARIES} ++ grpc++ + ) + + foreach(_hdr diff --git a/recipe/patches/0009-fix-missing-DLL-exports-in-vendored-upb.patch b/recipe/patches/0009-fix-missing-DLL-exports-in-vendored-upb.patch new file mode 100644 index 00000000..8cc1104d --- /dev/null +++ b/recipe/patches/0009-fix-missing-DLL-exports-in-vendored-upb.patch @@ -0,0 +1,128 @@ +From f06e5ce0a8e548dc47248de2d84a48e6bb1f08c3 Mon Sep 17 00:00:00 2001 +From: "H. Vetinari" +Date: Tue, 6 Feb 2024 16:09:08 +0100 +Subject: [PATCH 09/10] fix missing DLL-exports in vendored upb + +--- + CMakeLists.txt | 12 +++++++++ + third_party/upb/upb/mem/alloc.c | 2 +- + third_party/upb/upb/mem/alloc.h | 2 +- + .../upb/upb/mini_table/internal/message.c | 2 +- + .../upb/upb/mini_table/internal/message.h | 2 +- + third_party/upb/upb/port/def.inc | 27 +++++++++++++++++++ + 6 files changed, 43 insertions(+), 4 deletions(-) + +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 6136bbaa10..e4394061d3 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -3689,6 +3689,12 @@ if(WIN32 AND MSVC) + DESTINATION ${gRPC_INSTALL_LIBDIR} OPTIONAL + ) + endif() ++ # More details in third_party/upb/upb/port_def.inc; ++ # needs to be separate from gRPC_DLL_{IM,EX}PORTS ++ set_target_properties(upb_mem_lib PROPERTIES DEFINE_SYMBOL "UPB_DLL_EXPORTS") ++ if(BUILD_SHARED_LIBS) ++ target_compile_definitions(upb_mem_lib INTERFACE UPB_DLL_IMPORTS) ++ endif() + endif() + + target_include_directories(upb_mem_lib +@@ -3748,6 +3754,12 @@ if(WIN32 AND MSVC) + DESTINATION ${gRPC_INSTALL_LIBDIR} OPTIONAL + ) + endif() ++ # More details in third_party/upb/upb/port_def.inc; ++ # needs to be separate from gRPC_DLL_{IM,EX}PORTS ++ set_target_properties(upb_message_lib PROPERTIES DEFINE_SYMBOL "UPB_DLL_EXPORTS") ++ if(BUILD_SHARED_LIBS) ++ target_compile_definitions(upb_message_lib INTERFACE UPB_DLL_IMPORTS) ++ endif() + endif() + + target_include_directories(upb_message_lib +diff --git a/third_party/upb/upb/mem/alloc.c b/third_party/upb/upb/mem/alloc.c +index d103f98f30..397be37907 100644 +--- a/third_party/upb/upb/mem/alloc.c ++++ b/third_party/upb/upb/mem/alloc.c +@@ -24,4 +24,4 @@ static void* upb_global_allocfunc(upb_alloc* alloc, void* ptr, size_t oldsize, + } + } + +-upb_alloc upb_alloc_global = {&upb_global_allocfunc}; ++UPB_DLL upb_alloc upb_alloc_global = {&upb_global_allocfunc}; +diff --git a/third_party/upb/upb/mem/alloc.h b/third_party/upb/upb/mem/alloc.h +index 441731d2d8..5e743dedf3 100644 +--- a/third_party/upb/upb/mem/alloc.h ++++ b/third_party/upb/upb/mem/alloc.h +@@ -52,7 +52,7 @@ UPB_INLINE void upb_free(upb_alloc* alloc, void* ptr) { + + // The global allocator used by upb. Uses the standard malloc()/free(). + +-extern upb_alloc upb_alloc_global; ++UPB_DLL extern upb_alloc upb_alloc_global; + + /* Functions that hard-code the global malloc. + * +diff --git a/third_party/upb/upb/mini_table/internal/message.c b/third_party/upb/upb/mini_table/internal/message.c +index b25edacca7..05da188fc7 100644 +--- a/third_party/upb/upb/mini_table/internal/message.c ++++ b/third_party/upb/upb/mini_table/internal/message.c +@@ -7,7 +7,7 @@ + + #include "upb/mini_table/internal/message.h" + +-const struct upb_MiniTable _kUpb_MiniTable_Empty = { ++UPB_DLL const struct upb_MiniTable _kUpb_MiniTable_Empty = { + .subs = NULL, + .fields = NULL, + .size = 0, +diff --git a/third_party/upb/upb/mini_table/internal/message.h b/third_party/upb/upb/mini_table/internal/message.h +index 3457ea2cd6..8fa3325911 100644 +--- a/third_party/upb/upb/mini_table/internal/message.h ++++ b/third_party/upb/upb/mini_table/internal/message.h +@@ -65,7 +65,7 @@ extern "C" { + #endif + + // A MiniTable for an empty message, used for unlinked sub-messages. +-extern const struct upb_MiniTable _kUpb_MiniTable_Empty; ++UPB_DLL extern const struct upb_MiniTable _kUpb_MiniTable_Empty; + + // Computes a bitmask in which the |l->required_count| lowest bits are set, + // except that we skip the lowest bit (because upb never uses hasbit 0). +diff --git a/third_party/upb/upb/port/def.inc b/third_party/upb/upb/port/def.inc +index f320821384..3f4d7e3cec 100644 +--- a/third_party/upb/upb/port/def.inc ++++ b/third_party/upb/upb/port/def.inc +@@ -326,3 +326,30 @@ void __asan_unpoison_memory_region(void const volatile *addr, size_t size); + #else + #define UPB_DESC(sym) google_protobuf_##sym + #endif ++ ++// UPB_DLL ++// inspired by https://github.com/abseil/abseil-cpp/blob/20220623.1/absl/base/config.h#L730-L747 ++// ++// When building upb as a DLL, this macro expands to `__declspec(dllexport)` ++// so we can annotate symbols appropriately as being exported. When used in ++// headers consuming a DLL, this macro expands to `__declspec(dllimport)` so ++// that consumers know the symbol is defined inside the DLL. In all other cases, ++// the macro expands to nothing. ++// Note: UPB_DLL_EXPORTS is set in CMakeLists.txt when building shared upb ++// UPB_DLL_IMPORTS is set by us as part of the interface for consumers of the DLL ++#if defined(UPB_DLL_EXPORTS) ++#define UPB_DLL __declspec(dllexport) ++#elif defined(UPB_DLL_IMPORTS) ++#define UPB_DLL __declspec(dllimport) ++#else ++#define UPB_DLL ++#endif // defined(UPB_DLL_EXPORTS) ++ ++// same for gRPC ++#if defined(gRPC_DLL_EXPORTS) ++#define GRPC_DLL __declspec(dllexport) ++#elif defined(gRPC_DLL_IMPORTS) ++#define GRPC_DLL __declspec(dllimport) ++#else ++#define GRPC_DLL ++#endif // defined(gRPC_DLL_EXPORTS) diff --git a/recipe/patches/0010-for-main-targets-set-_DLL_EXPORTS-when-building-and-.patch b/recipe/patches/0010-for-main-targets-set-_DLL_EXPORTS-when-building-and-.patch new file mode 100644 index 00000000..29030d3f --- /dev/null +++ b/recipe/patches/0010-for-main-targets-set-_DLL_EXPORTS-when-building-and-.patch @@ -0,0 +1,85 @@ +From 2e9f78b486dff6f3184f85f91193a4e71725b053 Mon Sep 17 00:00:00 2001 +From: "H. Vetinari" +Date: Thu, 29 Feb 2024 20:31:21 +1100 +Subject: [PATCH 10/10] for main targets, set *_DLL_EXPORTS when building and + *_DLL_IMPORTS in interface + +--- + CMakeLists.txt | 36 ++++++++++-------------------------- + 1 file changed, 10 insertions(+), 26 deletions(-) + +diff --git a/CMakeLists.txt b/CMakeLists.txt +index e4394061d3..1f4a0a4b3e 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -1670,10 +1670,8 @@ if(WIN32 AND MSVC) + COMPILE_PDB_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}" + ) + if(BUILD_SHARED_LIBS) +- target_compile_definitions(gpr +- PRIVATE +- "GPR_DLL_EXPORTS" +- ) ++ set_target_properties(gpr PROPERTIES DEFINE_SYMBOL "GPR_DLL_EXPORTS") ++ target_compile_definitions(gpr INTERFACE "GPR_DLL_IMPORTS") + endif() + if(gRPC_INSTALL) + install(FILES ${CMAKE_CURRENT_BINARY_DIR}/gpr.pdb +@@ -2590,11 +2588,8 @@ if(WIN32 AND MSVC) + COMPILE_PDB_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}" + ) + if(BUILD_SHARED_LIBS) +- target_compile_definitions(grpc +- PRIVATE +- "GRPC_DLL_EXPORTS" +- "GPR_DLL_IMPORTS" +- ) ++ set_target_properties(grpc PROPERTIES DEFINE_SYMBOL "GRPC_DLL_EXPORTS") ++ target_compile_definitions(grpc INTERFACE "GRPC_DLL_IMPORTS") + endif() + if(gRPC_INSTALL) + install(FILES ${CMAKE_CURRENT_BINARY_DIR}/grpc.pdb +@@ -3301,11 +3296,8 @@ if(WIN32 AND MSVC) + COMPILE_PDB_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}" + ) + if(BUILD_SHARED_LIBS) +- target_compile_definitions(grpc_unsecure +- PRIVATE +- "GRPC_DLL_EXPORTS" +- "GPR_DLL_IMPORTS" +- ) ++ set_target_properties(grpc_unsecure PROPERTIES DEFINE_SYMBOL "GRPC_DLL_EXPORTS") ++ target_compile_definitions(grpc_unsecure INTERFACE "GRPC_DLL_IMPORTS") + endif() + if(gRPC_INSTALL) + install(FILES ${CMAKE_CURRENT_BINARY_DIR}/grpc_unsecure.pdb +@@ -4102,12 +4094,8 @@ if(WIN32 AND MSVC) + COMPILE_PDB_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}" + ) + if(BUILD_SHARED_LIBS) +- target_compile_definitions(grpc++ +- PRIVATE +- "GRPCXX_DLL_EXPORTS" +- "GPR_DLL_IMPORTS" +- "GRPC_DLL_IMPORTS" +- ) ++ set_target_properties(grpc++ PROPERTIES DEFINE_SYMBOL "GRPCXX_DLL_EXPORTS") ++ target_compile_definitions(grpc++ INTERFACE "GRPCXX_DLL_IMPORTS") + endif() + if(gRPC_INSTALL) + install(FILES ${CMAKE_CURRENT_BINARY_DIR}/grpc++.pdb +@@ -4848,12 +4836,8 @@ if(WIN32 AND MSVC) + COMPILE_PDB_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}" + ) + if(BUILD_SHARED_LIBS) +- target_compile_definitions(grpc++_unsecure +- PRIVATE +- "GRPCXX_DLL_EXPORTS" +- "GPR_DLL_IMPORTS" +- "GRPC_DLL_IMPORTS" +- ) ++ set_target_properties(grpc++_unsecure PROPERTIES DEFINE_SYMBOL "GRPCXX_DLL_EXPORTS") ++ target_compile_definitions(grpc++_unsecure INTERFACE "GRPCXX_DLL_IMPORTS") + endif() + if(gRPC_INSTALL) + install(FILES ${CMAKE_CURRENT_BINARY_DIR}/grpc++_unsecure.pdb diff --git a/recipe/test_grpc.bat b/recipe/test_grpc.bat index 33b3ed72..632d0f37 100644 --- a/recipe/test_grpc.bat +++ b/recipe/test_grpc.bat @@ -1,12 +1,29 @@ @echo on -grpc_cpp_plugin < NUL - @rem Compile a trivial service definition to C++ - -protoc -Itests/include --plugin=protoc-gen-grpc=%LIBRARY_PREFIX%/bin/grpc_cpp_plugin.exe --grpc_out=. hello.proto || exit /B - -if errorlevel 1 exit 1 +protoc -I. --plugin=protoc-gen-grpc=%LIBRARY_PREFIX%/bin/grpc_cpp_plugin.exe --grpc_out=. hello.proto || exit /B +if %ERRORLEVEL% neq 0 exit 1 if not exist hello.grpc.pb.h exit 1 if not exist hello.grpc.pb.cc exit 1 + +:: taken from cd examples/cpp/helloworld +cd examples/cpp/helloworld + +:: folder already contains a file called BUILD +mkdir build-cpp +cd build-cpp + +:: CMake does not like paths with \ characters +set LIBRARY_PREFIX="%LIBRARY_PREFIX:\=/%" + +cmake -G "Ninja" ^ + -DCMAKE_CXX_STANDARD=17 ^ + -DCMAKE_BUILD_TYPE=Release ^ + -DCMAKE_PREFIX_PATH="%LIBRARY_PREFIX%" ^ + -DCMAKE_MODULE_PATH="%LIBRARY_PREFIX%/lib/cmake" ^ + .. +if %ERRORLEVEL% neq 0 exit 1 + +cmake --build . --config Release +if %ERRORLEVEL% neq 0 exit 1 diff --git a/recipe/test_grpc.sh b/recipe/test_grpc.sh index c0189c03..7f2788cd 100755 --- a/recipe/test_grpc.sh +++ b/recipe/test_grpc.sh @@ -1,12 +1,24 @@ #!/bin/bash - set -ex -grpc_cpp_plugin < /dev/null - # Compile a trivial service definition to C++ if [[ "${build_platform}" == "${target_platform}" ]]; then - protoc -I./tests/include --plugin=protoc-gen-grpc=$PREFIX/bin/grpc_cpp_plugin --grpc_out=. hello.proto + protoc -I. --plugin=protoc-gen-grpc=$PREFIX/bin/grpc_cpp_plugin --grpc_out=. hello.proto test -f hello.grpc.pb.h test -f hello.grpc.pb.cc fi + +# taken from cd examples/cpp/helloworld +cd examples/cpp/helloworld + +# folder already contains a file called BUILD +mkdir build-cpp +cd build-cpp + +cmake -G "Ninja" \ + -DCMAKE_CXX_STANDARD=17 \ + -DCMAKE_PREFIX_PATH="$PREFIX" \ + -DCMAKE_MODULE_PATH="$PREFIX/lib/cmake" \ + .. + +cmake --build . diff --git a/recipe/test_grpcio_helloworld.py b/recipe/test_grpcio_helloworld.py new file mode 100644 index 00000000..fa135058 --- /dev/null +++ b/recipe/test_grpcio_helloworld.py @@ -0,0 +1,31 @@ +import os +import signal +import subprocess +import sys +import time + +# this test assumes it is being run in examples/python/helloworld, +# after having generated the helloworld_pb2{,_grpc} modules (see meta.yaml) +import grpc +import helloworld_pb2 +import helloworld_pb2_grpc + + +# start server (and wait a little) +print('Starting server...') +pid = subprocess.Popen([sys.executable, "greeter_server.py"]).pid +time.sleep(5) + +# run this a couple times because it happens randomly, see +# https://github.com/conda-forge/grpc-cpp-feedstock/issues/281 +print('Running client...') +for _ in range(1000): + with grpc.insecure_channel('localhost:50051') as channel: + stub = helloworld_pb2_grpc.GreeterStub(channel) + response = stub.SayHello(helloworld_pb2.HelloRequest(name='you')) + +# tear down server +print('Terminating server...') +os.kill(pid, signal.SIGTERM) + +print('Success!')
linux_64_openssl1.1.1 - - variant + + variant
linux_64_openssl3 - - variant + + variant
linux_aarch64_openssl1.1.1 - - variant + + variant
linux_aarch64_openssl3 - - variant + + variant
linux_ppc64le_openssl1.1.1 - - variant + + variant
linux_ppc64le_openssl3 - - variant - -
osx_64_openssl1.1.1 - - variant - -
osx_64_openssl3 - - variant - -
osx_arm64_openssl1.1.1 - - variant - -
osx_arm64_openssl3 - - variant - -
win_64_openssl1.1.1 - - variant - -
win_64_openssl3 - - variant + + variant