Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

azure-sdk-for-cpp: core, identity, storage #23297

Merged
merged 26 commits into from
Aug 13, 2023

Conversation

jdblischak
Copy link
Member

@jdblischak jdblischak commented Jul 7, 2023

Checklist

  • Title of this PR is meaningful: e.g. "Adding my_nifty_package", not "updated meta.yaml".
  • License file is packaged (see here for an example).
  • Source is from official source.
  • Package does not vendor other packages. (If a package uses the source of another package, they should be separate packages or the licenses of all packages need to be packaged).
  • Package does not ship static libraries. If static libraries are needed, follow CFEP-18.
  • Build number is 0.
  • A tarball (url) rather than a repo (e.g. git_url) is used in your recipe (see here for more details).
  • GitHub users listed in the maintainer section have posted a comment confirming they are willing to be listed there.
  • When in trouble, please check our knowledge base documentation before pinging a team.

https://github.com/Azure/azure-sdk-for-cpp

@conda-forge-webservices
Copy link

Hi! This is the friendly automated conda-forge-linting service.

I just wanted to let you know that I linted all conda-recipes in your PR (recipes/azure-core-cpp, recipes/azure-identity-cpp, recipes/azure-storage-blobs-cpp, recipes/azure-storage-common-cpp, recipes/azure-storage-files-datalake-cpp, recipes/azure-storage-files-shares-cpp, recipes/azure-storage-queues-cpp) and found it was in an excellent condition.

@jdblischak
Copy link
Member Author

@xylar I'd appreciate a review of these Azure SDK C++ libraries. Also, please let me know if I can add you as a co-maintainer on these recipes

@Shelnutt2
Copy link
Contributor

I am willing to maintain these packages. Thanks @jdblischak !

Copy link
Member

@xhochy xhochy left a comment

Choose a reason for hiding this comment

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

Comments apply to all recipes but I limited them to the first.

Comment on lines 26 to 29
run:
- libcurl
- openssl # [not win]
- wil # [win]
Copy link
Member

Choose a reason for hiding this comment

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

This whole section shouldn't be needed. The first two come via run_exports and the last one is a header only library.

Copy link
Member

Choose a reason for hiding this comment

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

According to conda/conda-build#3796 (comment) adding wil as a run dependency in azure-core-cpp is the best way to propagate the dependency in downstream packages. Currently every package using azure-core-cpp has to depend on wil itself.

Copy link
Member Author

Choose a reason for hiding this comment

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

@teo-tsirpanis thanks for sharing the discussion in that Issue. @xhochy do you have a strong preference for either option?

  1. List the header only library wil as a runtime requirement for azure-core-cpp, so that wil will be automatically installed in the host environment (and thus be available at build time) for all its downstream dependencies
  2. Include the header only library wil alongside azure-core-cpp in the host requirements of all the dependencies

Copy link
Member

Choose a reason for hiding this comment

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

I don't think 2 is an option because it would make azure-core-cpp unusable by itself.

Copy link
Member Author

Choose a reason for hiding this comment

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

After discussing with an upstream Azure SDK developer, we decided to apply a patch to remove the exported dependency on wil in the config file for azure-core-cpp

For more context, see Azure/azure-sdk-for-cpp#4784 and Azure/azure-sdk-for-cpp#4785

@@ -0,0 +1,58 @@
{% set name = "azure-core-cpp" %}
Copy link
Member

Choose a reason for hiding this comment

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

To be consistent with other packages, we should name this li azure-core

Copy link
Member Author

Choose a reason for hiding this comment

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

What are you suggesting the name should be exactly? We can't call it azure-core because that is used by the Python SDK: https://anaconda.org/conda-forge/azure-core

Similarly with the other SDK libraries: https://anaconda.org/conda-forge/azure-storage-common

Copy link
Member Author

Choose a reason for hiding this comment

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

To be consistent with other packages, we should name this li azure-core

@xhochy Is your suggestion to name it lib-azure-core? If yes, what other packages follow this convention? The AWS SDK for C++ is named aws-sdk-cpp

And in general, I think it would be potentially confusing if the conda-forge recipes all used different names than upstream

Copy link
Member

Choose a reason for hiding this comment

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

I believe there is a typo in xhochy's comment. It should read

we should name this libazure-core

If the package is just headers, config, and libraries (no CLI tools or other binaries), then it should be named libazure-core because the package contains libazure-core.so/dylib.

Examples:

  • libclang is libraries separate from clang the tool
  • libcurl is libraries separate from curl the tool
  • libopenvino just libs from the openvino project
  • libmad is libs from the mad project

Copy link
Member Author

Choose a reason for hiding this comment

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

I'm open to adding the prefix lib. My main concerns are consistency and transparency. I think there is an advantage to having the conda recipe names exactly match the upstream names

libclang is libraries separate from clang the tool

But for this example, the upstream maintainers have also named it libclang, right? Same with libcurl. This seems like a slightly different situation than what we are discussing here, where the lib prefix name would only exist in conda-forge

My understanding is that the prefixes -cpp (and -c) communicate that the software contains no CLI tools or other binaries. Looking across the conda-forge ecosystem, the many various AWS libraries either end in -cpp or start with aws-c- (including the very similar aws-sdk-cpp). There are also Azure C libraries that either start with azure-c or end in -c (see the recipe for azure-iot-sdk-c for various iterations on the naming scheme). I see that the lib prefix was added to libgoogle-cloud (conda-forge/google-cloud-cpp-feedstock#83), but the -cpp was also dropped.

Given the existence of the recipes for aws-c-*, aws-sdk-cpp, etc. already in conda-forge, I'd argue that a name like azure-core-cpp already communicates that it is only a C++ library, with the added benefit that it matches the official upstream name.

Is anyone somewhat convinced by my argument above? I don't feel that strongly about it, but I wanted to at least present the counter-argument before we deviate the name from upstream. And if we do decide to add the prefix lib, should we drop the suffix -cpp?

Copy link
Member

Choose a reason for hiding this comment

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

I agree that the lib prefix is excessive. Names like azure-core-cpp unquestionably refer to C++ libraries. Moreover this is the official name of the libraries, and we use the official names in the other cloud SDKs.

Copy link
Member

Choose a reason for hiding this comment

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

It's not immediately apparent that the official name of the component is 'azure-core-cpp' when the components are bundled together under a project called 'azure-sdk-for-cpp'.

The upstream project's docs indicate that both the CMake package and vcpkg names are azure-core-cpp, so let's go with that because it is explicit evidence in the upstream projects docs/source that the upstream maintainers have named these packages in that way. In the future, let's lead with links instead of researching whether or not it's conda-forge convention to name C/CXX libraries with a lib- prefix.

recipes/azure-core-cpp/meta.yaml Show resolved Hide resolved
recipes/azure-core-cpp/meta.yaml Outdated Show resolved Hide resolved
@xhochy
Copy link
Member

xhochy commented Jul 9, 2023

@h-vetinari please also have a look as this is third big cloud vendor C++ SDK

Copy link
Member

@h-vetinari h-vetinari left a comment

Choose a reason for hiding this comment

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

Thanks for the PR!

Aside from some general clean-up requests, I'd expect that we need some sort of azure-sdk metapackage that pulls everything together?

It would also be good to know what kind of ABI-stability (if any) these packages have. Migrating for every version is quite painful in the aws stack, for example.

To summarize the clean-ups:

  • add run-exports
  • don't pin (or lower-bound) packages where we will need to rebuild for new versions
  • remove run-requirements where we can rely on run-exports
  • don't special-case -DCMAKE_BUILD_TYPE=Release in build scripts
  • better document & structure the test sections
  • don't use {{ name }}
  • [preferable] put CMake metadata in $PREFIX/lib/cmake/<project> (resp. %LIBRARY_LIB%\cmake\<project>)
  • [optional] use ninja universally

recipes/azure-identity-cpp/build.sh Outdated Show resolved Hide resolved
recipes/azure-identity-cpp/meta.yaml Outdated Show resolved Hide resolved
recipes/azure-identity-cpp/meta.yaml Outdated Show resolved Hide resolved
recipes/azure-identity-cpp/meta.yaml Outdated Show resolved Hide resolved
recipes/azure-storage-blobs-cpp/meta.yaml Outdated Show resolved Hide resolved
recipes/azure-storage-common-cpp/build.sh Show resolved Hide resolved
recipes/azure-storage-common-cpp/meta.yaml Outdated Show resolved Hide resolved
@xylar
Copy link
Contributor

xylar commented Jul 10, 2023

@xylar I'd appreciate a review of these Azure SDK C++ libraries. Also, please let me know if I can add you as a co-maintainer on these recipes

@jdblischak, I'm sorry, I really don't feel qualified to help maintain these. I also have my hands full.

@jdblischak
Copy link
Member Author

@xhochy and @h-vetinari Thanks for the thorough review! I've applied your suggestions to the azure-core-cpp recipe. Once that is in good shape, I'll apply the changes to the remaining recipes. My biggest uncertainty is around what to set for the min_pin and max_pin for the run_exports.

@h-vetinari
Copy link
Member

My biggest uncertainty is around what to set for the min_pin and max_pin for the run_exports.

Leave out min_pin and set max_pin to 'x.x.x', unless you know that the ABI will not change between 1.2.x and 1.2.y.

@teo-tsirpanis
Copy link
Member

unless you know that the ABI will not change between 1.2.x and 1.2.y.

They declare compatibility within the same major version. (https://github.com/Azure/azure-sdk-for-cpp/blob/2f3e5de931c3f1c19551f6f58418c85aa410745b/cmake-modules/AzureVcpkg.cmake#L152-L156)

@jdblischak
Copy link
Member Author

@xochy @h-vetinari I removed the runtime requirements, but now I am getting the following errors. This was my initial motivation for adding them to the run requirements:

   INFO (azure-storage-blobs-cpp,lib/libazure-storage-blobs.so): Needed DSO lib/libazure-storage-common.so found in home/conda/staged-recipes/build_artifacts::azure-storage-common-cpp-12.3.2-heddee37_0
  ERROR (azure-storage-blobs-cpp,lib/libazure-storage-blobs.so): Needed DSO lib/libazure-core.so found in ['azure-core-cpp']
  ERROR (azure-storage-blobs-cpp,lib/libazure-storage-blobs.so): .. but ['azure-core-cpp'] not in reqs/run, (i.e. it is overlinking) (likely) or a missing dependency (less likely)

@h-vetinari
Copy link
Member

The warning sounds pretty clear to me. azure-storage-blobs-cpp needs to host-depend on azure-core-cpp, so it will inherit the correct run-export.

Comment on lines 18 to 19
run_exports:
- {{ pin_subpackage("azure-core-cpp", min_pin="x", max_pin="x") }}
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
run_exports:
- {{ pin_subpackage("azure-core-cpp", min_pin="x", max_pin="x") }}
run_exports:
- {{ pin_subpackage("azure-core-cpp", max_pin="x") }}

Please update all your exports to unspecify the min_pin. SameMajorVersion means backwards compatability, not forward and backward compatability.

Copy link
Member

Choose a reason for hiding this comment

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

Also, shouldn't we pin the minor version instead?

Suggested change
run_exports:
- {{ pin_subpackage("azure-core-cpp", min_pin="x", max_pin="x") }}
run_exports:
- {{ pin_subpackage("azure-core-cpp", min_pin="x", max_pin="x.x") }}

This suggestion also applies to the other libraries' recipe.

Copy link
Member Author

Choose a reason for hiding this comment

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

We currently have it set to pin to only the major version because the upstream CMake file declares SameMajorVersion compatibility. See also the previous comments #23297 (comment) and #23297 (comment). @jjerphan what do you think of this choice? Pinning to the minor version would be the more conservative route, but it would also require more maintenance when migrating the pins

Copy link
Member

Choose a reason for hiding this comment

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

I see. I think we better wait for an actual administrator of conda-forge. If you and another maintainer agreed on pinning on the major version already, just do ignore my comment.

@@ -0,0 +1,58 @@
{% set name = "azure-core-cpp" %}
Copy link
Member

Choose a reason for hiding this comment

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

I believe there is a typo in xhochy's comment. It should read

we should name this libazure-core

If the package is just headers, config, and libraries (no CLI tools or other binaries), then it should be named libazure-core because the package contains libazure-core.so/dylib.

Examples:

  • libclang is libraries separate from clang the tool
  • libcurl is libraries separate from curl the tool
  • libopenvino just libs from the openvino project
  • libmad is libs from the mad project

Copy link
Member

@jjerphan jjerphan left a comment

Choose a reason for hiding this comment

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

Thank you for bringing Azure SDK for C++ on conda-forge, @jdblischak!

Here are a few comments, the main important one being about pinning on minor versions rather than on major ones.

I also think we must prefix the names of those libraries with lib.

I volunteer to maintain feedstocks.

recipes/azure-core-cpp/meta.yaml Show resolved Hide resolved
recipes/azure-identity-cpp/meta.yaml Show resolved Hide resolved
recipes/azure-core-cpp/meta.yaml Outdated Show resolved Hide resolved
recipes/azure-storage-blobs-cpp/meta.yaml Show resolved Hide resolved
recipes/azure-storage-common-cpp/meta.yaml Show resolved Hide resolved
recipes/azure-storage-queues-cpp/meta.yaml Show resolved Hide resolved
recipes/azure-core-cpp/meta.yaml Show resolved Hide resolved
Comment on lines 18 to 19
run_exports:
- {{ pin_subpackage("azure-core-cpp", min_pin="x", max_pin="x") }}
Copy link
Member

Choose a reason for hiding this comment

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

Also, shouldn't we pin the minor version instead?

Suggested change
run_exports:
- {{ pin_subpackage("azure-core-cpp", min_pin="x", max_pin="x") }}
run_exports:
- {{ pin_subpackage("azure-core-cpp", min_pin="x", max_pin="x.x") }}

This suggestion also applies to the other libraries' recipe.

@jdblischak
Copy link
Member Author

@carterbox Thanks for the review!

Only if you think people would actually want to install all of the components in one go.

I like that advice. I don't need a single meta-package myself. If someone else needs it, they can request it or create it themselves

I prefer that related recipes are clumped together because it's easier to review them for consistency and interdependency, but 10 recipes in a PR is alot. Make a future PR to add more packages in this ecosystem.

Happy to comply with this. Updating 7 recipes at a time is cumbersome enough

As long as you (as the maintainer) trust the #23297 (comment). You're the one who primarily need to clean up the mess if there are ABI breaks.

Ok, let's see if all the maintainers agree. I know that the pinning migrations for the similar aws-* packages are non-trivial, so I'd prefer to minimize this as much as possible

Yes. Ensure that there is a global pinning added before you update to your next version of these packages. If there is only one version available, then the pinning isn't needed. Once there are multiple versions, that's when pinnings become relevant.

Wonderful. Thanks for the concise explanation. I will need to add the pins after the initial feedstock creation but prior to the first updates

Copy link
Member

@jjerphan jjerphan left a comment

Choose a reason for hiding this comment

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

Thank you for packaging those libraries from the Azure SDK for C++, @jdblischak! I believe this is useful for a lot of projects.

Regarding what's left on the todo list (#23297 (comment)): I think we can figure moving the CMake metadata to the canonical path in the feedstocks since the tests using CMake projects work.

Regarding packages' names: prefixing C++ and C library with lib is conventional for conda-forge. Yet, the developers of the Azure SDK for C++ chose to suffix them with -c or -cpp (which is also explicit). I am OK with using names that are suffixed with -c and cpp, especially if this prevent discrepancies between packages' names and identifiers to use for CMake.

I think we should also be careful about some packages being renamed. For instance azure-macro-utils-c was renamed macro-utils-c upstream but is published on conda-forge as azure-macro-utils-c. Republishing is an option I think, but better ones might exist for this situation.

@jdblischak
Copy link
Member Author

@conda-forge/help-c-cpp, ready for review!

@jdblischak
Copy link
Member Author

Higher-level questions that are still being actively discussed:

  • Do we maintain the official upstream library names, eg azure-core-cpp, or rename them in conda-forge, eg libazure-core-cpp or libazure-core? I am currently leaning towards keeping the official names. However, I'm willing to be convinced if provided examples that this sort of renaming is common in conda-forge. Given that the existing recipes for AWS and Azure C/C++ libraries have not been renamed, I think it would make sense to continue this tradition

  • Do we pin the run_exports to the major or minor pin? I'm currently leaning towards the major pin since 1) this is what the upstream maintainers say they will follow, and 2) this will reduce the maintenance burden from conda-forge-pinning migrations

Lastly, if anyone else would like to be added to the list of maintainers, please let me know

@jdblischak
Copy link
Member Author

Thanks all for your reviews! The recipes are much improved thanks to all of your feedback

@teo-tsirpanis
Copy link
Member

Great work! Small question: I see the packages are built only for x64 architectures. Is there a way to add support for linux-aarch64, macos-arm64 and linux-ppc64le?

@jjerphan
Copy link
Member

We need to assess whether the libraries have been designed for the support of those architectures. We can try their support via individual PRs.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

Successfully merging this pull request may close these issues.

8 participants