Skip to content

Fix Apple & c-ares DNS Resolver Factories#18690

Merged
mattklein123 merged 1 commit intoenvoyproxy:mainfrom
jpsim:fix-dns-factories
Oct 20, 2021
Merged

Fix Apple & c-ares DNS Resolver Factories#18690
mattklein123 merged 1 commit intoenvoyproxy:mainfrom
jpsim:fix-dns-factories

Conversation

@jpsim
Copy link
Copy Markdown
Contributor

@jpsim jpsim commented Oct 20, 2021

Commit Message: Fix Apple & c-ares DNS Resolver Factories
Additional Description: By convention these don't have an "Impl" suffix
Risk Level: Low. Since the factory registration wasn't correct, no downstream consumers have already integrated this successfully.
Testing:
Docs Changes:
Release Notes:
Platform Specific Features:
[Optional Runtime guard:]
[Optional Fixes #Issue]
[Optional Fixes commit #PR or SHA]
[Optional Deprecated:]
[Optional API Considerations:]

@repokitteh-read-only
Copy link
Copy Markdown

As a reminder, PRs marked as draft will not be automatically assigned reviewers,
or be handled by maintainer-oncall triage.

Please mark your PR as ready when you want it to be reviewed!

🐱

Caused by: #18690 was opened by jpsim.

see: more, trace.

By convention these don't have an "Impl" suffix

Signed-off-by: JP Simard <[email protected]>
@jpsim jpsim marked this pull request as ready for review October 20, 2021 15:24
jpsim added a commit to jpsim/envoy-mobile that referenced this pull request Oct 20, 2021
@jpsim
Copy link
Copy Markdown
Contributor Author

jpsim commented Oct 20, 2021

macos test failure appears unrelated:

ERROR: /private/var/tmp/_bazel_runner/3d1a7f52fd47fc9a8db71770aacd13e5/external/bazel_tools/tools/cpp/BUILD:469:14: Target '@bazel_tools//tools/cpp:compiler' depends on toolchain '@local_config_cc//:cc-compiler-darwin', which cannot be found: error loading package '@local_config_cc//':***@local_config_cc_toolchains//:osx_archs.bzl': no such file'

@mattklein123 mattklein123 self-assigned this Oct 20, 2021
Copy link
Copy Markdown
Member

@mattklein123 mattklein123 left a comment

Choose a reason for hiding this comment

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

Sorry why is this change needed?

/wait-any

@jpsim
Copy link
Copy Markdown
Contributor Author

jpsim commented Oct 20, 2021

Sorry why is this change needed?

These factories were registered with the suffix "Impl" but declared without the suffix:

  • REGISTER_FACTORY(AppleDnsResolverFactoryImpl, DnsResolverFactory); / DECLARE_FACTORY(AppleDnsResolverFactory);
  • REGISTER_FACTORY(CaresDnsResolverFactoryImpl, DnsResolverFactory); / DECLARE_FACTORY(CaresDnsResolverFactory);

This was my mistake when adding the declarations in #18646, since I went based off of the convention of other factories being declared without the "Impl" suffix and didn't notice that the registration was using a different name.

This manifested as a linker error when attempting to link anything using the extension because that symbol wasn't being emitted in the binary:

Undefined symbols for architecture x86_64:
  "Envoy::Network::forceRegisterAppleDnsResolverFactory()", referenced from:
      Envoy::ExtensionRegistryPlatformAdditions::registerFactories() in libextension_registry_platform_additions.lo(extension_registry_apple.o)
ld: symbol(s) not found for architecture x86_64

@mattklein123
Copy link
Copy Markdown
Member

Ah OK got it, thanks. LGTM.

Copy link
Copy Markdown
Member

@mattklein123 mattklein123 left a comment

Choose a reason for hiding this comment

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

Thanks!

@mattklein123 mattklein123 merged commit c687308 into envoyproxy:main Oct 20, 2021
@jpsim jpsim deleted the fix-dns-factories branch October 20, 2021 17:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants