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

[abseil] Fix missing #include <random> for std::uniform_int_distribution #39522

Conversation

therselman
Copy link
Contributor

@therselman therselman commented Jun 25, 2024

Please forgive me, but this is my first PR for vcpkg.

What I'm trying to do, is create a patch for a very simple known and fixed bug for abseil.
This issue has already been fixed by this commit in the abseil repo:
abseil/abseil-cpp@c025a93

I experienced the issue when compiling a Protobuf (protoc) generated .pb.cc file (on VS2022), there is an error:
"\absl\algorithm\container.h(797,14): error C2039: 'uniform_int_distribution': is not a member of 'std'"

The issue is not actually in Protobuf, but in the abseil dependancy, and is resolved simply by including a missing file: #include <random>

I've tried my best to create a port and patch for vcpkg, I tried to follow every instruction, but I can't get past error: no version database entry for abseil at 20240116.2#2. Even though I believe I've created the versions file enty correctly. Maybe it's just my local setup.

Thanks for your time.

  • Changes comply with the maintainer guide.
  • The name of the port matches an existing name for this component on https://repology.org/ if possible, and/or is strongly associated with that component on search engines.
  • Optional dependencies are resolved in exactly one way. For example, if the component is built with CMake, all find_package calls are REQUIRED, are satisfied by vcpkg.json's declared dependencies, or disabled with CMAKE_DISABLE_FIND_PACKAGE_Xxx.
  • The versioning scheme in vcpkg.json matches what upstream says.
  • The license declaration in vcpkg.json matches what upstream says.
  • The installed as the "copyright" file matches what upstream says.
  • The source code of the component installed comes from an authoritative source.
  • The generated "usage text" is accurate. See adding-usage for context.
  • The version database is fixed by rerunning ./vcpkg x-add-version --all and committing the result.
  • Only one version is in the new port's versions file.
  • Only one version is added to each modified port's versions file.

@therselman
Copy link
Contributor Author

@microsoft-github-policy-service agree

@JonLiu1993 JonLiu1993 changed the title [PATCH] Fix missing #include <random> for std::uniform_int_distribution [abseil] Fix missing #include <random> for std::uniform_int_distribution Jun 26, 2024
@JonLiu1993 JonLiu1993 added the category:port-bug The issue is with a library, which is something the port should already support label Jun 26, 2024
@JonLiu1993 JonLiu1993 added info:reviewed Pull Request changes follow basic guidelines labels Jun 26, 2024
@BillyONeal BillyONeal merged commit 513ccfb into microsoft:master Jun 27, 2024
17 checks passed
@BillyONeal
Copy link
Member

Thanks for the fix and ensuring that it was already fixed upstream!

Nemirtingas pushed a commit to Nemirtingas/vcpkg that referenced this pull request Aug 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
category:port-bug The issue is with a library, which is something the port should already support info:reviewed Pull Request changes follow basic guidelines
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants