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

[drogon:x64-windows-static] build failure (v1.4.1) #17192

Closed
O-Tom opened this issue Apr 10, 2021 · 7 comments
Closed

[drogon:x64-windows-static] build failure (v1.4.1) #17192

O-Tom opened this issue Apr 10, 2021 · 7 comments
Assignees
Labels
category:port-bug The issue is with a library, which is something the port should already support

Comments

@O-Tom
Copy link

O-Tom commented Apr 10, 2021

Host Environment

  • OS: Windows 10 build 1607
  • Compiler: Visual C++ 2017 00370-20001-21499-AA108 / VisualStudio.15.Release/15.9.29+28307.1300
  • Vcpkg version: 2021-01-13-d67989bce1043b98092ac45996a8230a059a2d7e

To Reproduce
Steps to reproduce the behavior:
./vcpkg install drogon --triplet=x64-windows-static

Failure logs
install-x64-windows-static-dbg-out.log

Additional context
Port dependencies compile and install without any trouble
It looks like drogon is also almost successful and only fails at linking the drogon_ctl.exe tool
x64-windows triplet installs fine on the same machine/same configuration

@O-Tom O-Tom changed the title [<drogon:x64-windows-static>] build failure (v1.4.1) [drogon:x64-windows-static] build failure (v1.4.1) Apr 10, 2021
@O-Tom
Copy link
Author

O-Tom commented Apr 11, 2021

Well, this issue is actually a duplicate of drogonframework/drogon#510

As I also found out, the [c-ares:w64-windows-static] port does not switch the source to static mode correctly.
The portfile.cmake should be modified to define CARES_STATICLIB, not CARES_STATIC or CARES_SHARED that are unknown to the current c-ares code.
I modified my local copy of the port with the following code and solved the c-ares missing symbols issues.

set(OPTIONS)
if(VCPKG_LIBRARY_LINKAGE STREQUAL static)
    list(APPEND OPTIONS -DCARES_STATICLIB=1)
endif()

vcpkg_configure_cmake(
    SOURCE_PATH ${SOURCE_PATH}
    PREFER_NINJA
    OPTIONS
        ${OPTIONS}
)

Drogon still fails on libpq.lib though
install-x64-windows-static-dbg-out.log

@O-Tom
Copy link
Author

O-Tom commented Apr 11, 2021

Digging a little more around libpq, I found jtv/libpqxx#431 then #16968
These really look like the same issue and may fix drogon along with the c-ares patch.

@JackBoosY JackBoosY added the category:port-bug The issue is with a library, which is something the port should already support label Apr 12, 2021
@JackBoosY
Copy link
Contributor

Confirmed.

@O-Tom
Copy link
Author

O-Tom commented Apr 12, 2021

Sorry @JackBoosY, but I was wrong with c-ares, as the actual problem is in the trantor makefiles.
trantor includes c-ares headers but does not define CARES_STATICLIB when it is itself in static mode.
The trantor static lib is therefore linked to shared definitions of c-ares functions that are not satisfied by the static version of c-ares.
This is what the drogon fail log was telling in a first place...

I created the following patch for the trantor port and applied it in my local copy of vcpkg.
Not only did this solve the drogon port build failure but it also solved linking issues in drogon dependant executables

c-ares_static.patch for trantor

c-ares_static patch

@JackBoosY
Copy link
Contributor

@O-Tom #17230 and #17232 will fix this issue.

@Coderx7
Copy link

Coderx7 commented Apr 25, 2021

When will this be merged? I noticed its been 13 days already and seemingly all is fine

@JackBoosY
Copy link
Contributor

Should be fixed.

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
Projects
None yet
Development

No branches or pull requests

3 participants