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

[curl] Use find_package c-ares provided by vcpkg #29350

Merged
merged 3 commits into from
Feb 3, 2023

Conversation

LilyWangLL
Copy link
Contributor

Fixes #29286
curl use its FindCARES.cmake to find c-ares, it missing iphlpapi.lib will cause the following error:

LINK: command "C:\PROGRA~1\MICROS~3\2022\ENTERP~1\VC\Tools\MSVC\1434~1.319\bin\Hostx64\x64\link.exe src\CMakeFiles\curl.dir\slist_wc.c.obj src\CMakeFiles\curl.dir\tool_binmode.c.obj src\CMakeFiles\curl.dir\tool_bname.c.obj src\CMakeFiles\curl.dir\tool_cb_dbg.c.obj src\CMakeFiles\curl.dir\tool_cb_hdr.c.obj src\CMakeFiles\curl.dir\tool_cb_prg.c.obj src\CMakeFiles\curl.dir\tool_cb_rea.c.obj src\CMakeFiles\curl.dir\tool_cb_see.c.obj src\CMakeFiles\curl.dir\tool_cb_wrt.c.obj src\CMakeFiles\curl.dir\tool_cfgable.c.obj src\CMakeFiles\curl.dir\tool_dirhie.c.obj src\CMakeFiles\curl.dir\tool_doswin.c.obj src\CMakeFiles\curl.dir\tool_easysrc.c.obj src\CMakeFiles\curl.dir\tool_filetime.c.obj src\CMakeFiles\curl.dir\tool_findfile.c.obj src\CMakeFiles\curl.dir\tool_formparse.c.obj src\CMakeFiles\curl.dir\tool_getparam.c.obj src\CMakeFiles\curl.dir\tool_getpass.c.obj src\CMakeFiles\curl.dir\tool_help.c.obj src\CMakeFiles\curl.dir\tool_helpers.c.obj src\CMakeFiles\curl.dir\tool_hugehelp.c.obj src\CMakeFiles\curl.dir\tool_libinfo.c.obj src\CMakeFiles\curl.dir\tool_listhelp.c.obj src\CMakeFiles\curl.dir\tool_main.c.obj src\CMakeFiles\curl.dir\tool_msgs.c.obj src\CMakeFiles\curl.dir\tool_operate.c.obj src\CMakeFiles\curl.dir\tool_operhlp.c.obj src\CMakeFiles\curl.dir\tool_panykey.c.obj src\CMakeFiles\curl.dir\tool_paramhlp.c.obj src\CMakeFiles\curl.dir\tool_parsecfg.c.obj src\CMakeFiles\curl.dir\tool_progress.c.obj src\CMakeFiles\curl.dir\tool_strdup.c.obj src\CMakeFiles\curl.dir\tool_setopt.c.obj src\CMakeFiles\curl.dir\tool_sleep.c.obj src\CMakeFiles\curl.dir\tool_urlglob.c.obj src\CMakeFiles\curl.dir\tool_util.c.obj src\CMakeFiles\curl.dir\tool_vms.c.obj src\CMakeFiles\curl.dir\tool_writeout.c.obj src\CMakeFiles\curl.dir\tool_writeout_json.c.obj src\CMakeFiles\curl.dir\tool_xattr.c.obj src\CMakeFiles\curl.dir\__\lib\strtoofft.c.obj src\CMakeFiles\curl.dir\__\lib\timediff.c.obj src\CMakeFiles\curl.dir\__\lib\nonblock.c.obj src\CMakeFiles\curl.dir\__\lib\warnless.c.obj src\CMakeFiles\curl.dir\__\lib\curl_multibyte.c.obj src\CMakeFiles\curl.dir\__\lib\version_win32.c.obj src\CMakeFiles\curl.dir\__\lib\dynbuf.c.obj src\CMakeFiles\curl.dir\curl.rc.res /out:src\curl.exe /implib:src\curl.lib /pdb:src\curl.pdb /version:0.0 /machine:x64 /MANIFEST:NO /nologo /debug /INCREMENTAL /subsystem:console lib\libcurl-d.lib winmm.lib ws2_32.lib C:\vcpkg\installed\x64-windows-static\debug\lib\cares.lib C:\vcpkg\installed\x64-windows-static\debug\lib\libssl.lib C:\vcpkg\installed\x64-windows-static\debug\lib\libcrypto.lib C:\vcpkg\installed\x64-windows-static\debug\lib\zlibd.lib C:\vcpkg\installed\x64-windows-static\debug\lib\libssh2.lib advapi32.lib crypt32.lib bcrypt.lib C:\vcpkg\installed\x64-windows-static\debug\lib\libssl.lib C:\vcpkg\installed\x64-windows-static\debug\lib\libcrypto.lib C:\vcpkg\installed\x64-windows-static\debug\lib\zlibd.lib ws2_32.lib crypt32.lib kernel32.lib user32.lib gdi32.lib winspool.lib shell32.lib ole32.lib oleaut32.lib uuid.lib comdlg32.lib advapi32.lib" failed (exit code 1120) with the following output:
cares.lib(ares__addrinfo_localhost.c.obj) : error LNK2019: unresolved external symbol __imp_GetUnicastIpAddressTable referenced in function ares__system_loopback_addrs
cares.lib(ares__addrinfo_localhost.c.obj) : error LNK2019: unresolved external symbol __imp_FreeMibTable referenced in function ares__system_loopback_addrs
src\curl.exe : fatal error LNK1120: 2 unresolved externals
ninja: build stopped: subcommand failed.

The related upstream issue: curl/curl#8068. Use find_package c-ares provided by vcpkg to fix this issue.

  • Changes comply with the maintainer guide
  • SHA512s are updated for each updated download
  • The "supports" clause reflects platforms that may be fixed by this new version
  • Any fixed CI baseline entries are removed from that file.
  • Any patches that are no longer applied are deleted from the port's directory.
  • The version database is fixed by rerunning ./vcpkg x-add-version --all and committing the result.
  • Only one version is added to each modified port's versions file.

@LilyWangLL LilyWangLL added category:port-bug The issue is with a library, which is something the port should already support info:internal This PR or Issue was filed by the vcpkg team. labels Feb 1, 2023
@@ -1,6 +1,7 @@
{
"name": "curl",
"version": "7.87.0",
"port-version": 1,
"description": "A library for transferring data with URLs",
"homepage": "https://curl.se/",
"license": null,
Copy link
Contributor

Choose a reason for hiding this comment

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

[No change requested.] Why does it have "license": null? I think the valid SPDX identifier would be "license": "CURL"

Copy link
Contributor

Choose a reason for hiding this comment

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

Because not all files in CURL are under CURL license. Maybe it is improving.
Cf. https://tracker.debian.org/media/packages/c/curl/copyright-7.87.0-2

@LilyWangLL LilyWangLL marked this pull request as ready for review February 2, 2023 02:48
@Cheney-W Cheney-W added the info:reviewed Pull Request changes follow basic guidelines label Feb 2, 2023
@BillyONeal BillyONeal merged commit c9eb3bd into microsoft:master Feb 3, 2023
@BillyONeal
Copy link
Member

Thanks!

@LilyWangLL LilyWangLL deleted the dev/LilyWang/issue29286 branch March 2, 2023 07:12
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:internal This PR or Issue was filed by the vcpkg team. info:reviewed Pull Request changes follow basic guidelines
Projects
None yet
Development

Successfully merging this pull request may close these issues.

curl build failure
5 participants