vcpkg icon indicating copy to clipboard operation
vcpkg copied to clipboard

[serf] new port (build using scons)

Open rinrab opened this issue 1 year ago • 15 comments

In this version on the port, we are going to use the official build system of the library, Scons. There is already a helper for getting it from the internet, but it wasn't actually working, and should be it with Python should be updated.

Included changes:

  • Update scons version to the latest.
  • Using Python3 instead of Python2 for scons.
  • Support scons for Unix
  • Add the port for Serf library

rinrab avatar Sep 17 '24 23:09 rinrab

It worked on my Linux VM, but fails on Azure Pipelines, due to missing scons on the system. I have a question: how to make it installed there? I've already specified apt_package_name and brew_package_name variables in the vcpkg_find_acquire_program(SCONS).cmake script and it suggests to install this tool.

rinrab avatar Sep 18 '24 21:09 rinrab

Oups... Didn't notice that little problem, failing the build. Sorry...

@Cheney-W Could you please answer the question above?

rinrab avatar Sep 21 '24 13:09 rinrab

It worked on my Linux VM, but fails on Azure Pipelines, due to missing scons on the system. I have a question: how to make it installed there? I've already specified apt_package_name and brew_package_name variables in the vcpkg_find_acquire_program(SCONS).cmake script and it suggests to install this tool.

By the way, if it is impossible, I am happy to drop Linux and MacOS support, since it is not that much important for me with apt-get working great there.

rinrab avatar Sep 21 '24 13:09 rinrab

It worked on my Linux VM, but fails on Azure Pipelines, due to missing scons on the system. I have a question: how to make it installed there? I've already specified apt_package_name and brew_package_name variables in the vcpkg_find_acquire_program(SCONS).cmake script and it suggests to install this tool.

By the way, if it is impossible, I am happy to drop Linux and MacOS support, since it is not that much important for me with apt-get working great there.

Also CMake is coming soon in the library and this could be done then.

rinrab avatar Sep 21 '24 13:09 rinrab

If the failures on Linux and macOS are only due to missing dependencies rather than the port not supporting these platforms, you can mark the corresponding triplets as failed in the ci.baseline for now.

Cheney-W avatar Sep 24 '24 10:09 Cheney-W

You might find the similar recipe for serf on ConanCenter useful to check for any missed config options and what not: https://github.com/conan-io/conan-center-index/blob/master/recipes/serf/all/conanfile.py

valgur avatar Sep 24 '24 11:09 valgur

I'm afraid it takes much more patching to make serf use the right link libs across platforms, linkage types, and debug/release. For example, this isn't matched with zlib.lib:

/debug/lib/zlibd.lib

It might be possible to query pc files (via x_vcpkg_pkgconfig_get_modules) to avoid hard coding.

Unfortunately, it requires a lot of patching, to allow passing the path to the libraries via command line. However, I fixed the debug libraries by patching scons files and checking for debug configuration.

rinrab avatar Sep 30 '24 16:09 rinrab

Well, you fixed the release/debug lib name aspect for Windows. I'm skeptical about cross-platform and static linkage being solved. But I don't want to learn scons now.

dg0yt avatar Oct 01 '24 03:10 dg0yt

In the latest local test, port also has an usage issue, the release mode file: \packages\serf_x64-windows\lib\pkgconfig\serf-1.pc includes the following contents:

libdir=${prefix}/debug/lib

Cheney-W avatar Oct 09 '24 02:10 Cheney-W

In the latest local test, port also has an usage issue, the release mode file: \packages\serf_x64-windows\lib\pkgconfig\serf-1.pc includes the following contents:

libdir=${prefix}/debug/lib

Thanks, I see.

https://github.com/microsoft/vcpkg/pull/41043/commits/9f0712302d90548d8c13d27d5f549f7349a201b9 seems to be resolving the issue. Additionally, pkgconfig module passes my local testing.

rinrab avatar Oct 16 '24 09:10 rinrab

Usage test passed with x64-windows.

Cheney-W avatar Oct 16 '24 10:10 Cheney-W

build release version before debug. Seems to be fixing the issue with incorrect pkfconfig modules somehow.

Suspicious.

dg0yt avatar Oct 17 '24 03:10 dg0yt

Azure pipelines worker seems to be stuck somewhere.

rinrab avatar Oct 17 '24 14:10 rinrab

arm64-windows failures:

   Creating library libserf-1.lib and object libserf-1.exp
auth_digest.obj : error LNK2019: unresolved external symbol __imp__apr_palloc@8 referenced in function _build_auth_header
auth_spnego.obj : error LNK2001: unresolved external symbol __imp__apr_palloc@8
auth_spnego_sspi.obj : error LNK2001: unresolved external symbol __imp__apr_palloc@8
allocator.obj : error LNK2001: unresolved external symbol __imp__apr_palloc@8
ssl_buckets.obj : error LNK2001: unresolved external symbol __imp__apr_palloc@8
auth.obj : error LNK2001: unresolved external symbol __imp__apr_palloc@8
auth_basic.obj : error LNK2001: unresolved external symbol __imp__apr_palloc@8
context.obj : error LNK2001: unresolved external symbol __imp__apr_palloc@8
incoming.obj : error LNK2001: unresolved external symbol __imp__apr_palloc@8
outgoing.obj : error LNK2001: unresolved external symbol __imp__apr_palloc@8
ssltunnel.obj : error LNK2001: unresolved external symbol __imp__apr_palloc@8
context.obj : error LNK2019: unresolved external symbol __imp__apr_array_make@12 referenced in function _serf_context_create
...

https://dev.azure.com/vcpkg/public/_build/results?buildId=108231&view=artifacts&pathAsName=false&type=publishedArtifacts

Cheney-W avatar Oct 18 '24 09:10 Cheney-W

https://github.com/microsoft/vcpkg/pull/41043/commits/4d761df509f91f86c5d791c4b0e251bbc831a556

[serf] this library doesn't support ARM.

See: https://github.com/apache/serf/blob/73f26fab7baca09c5257ac1da725589a639a44de/SConstruct#L143

ARM is not listed there, so there is no official support.

rinrab avatar Oct 18 '24 14:10 rinrab

Hey! What's about to merge it?

rinrab avatar Nov 04 '24 09:11 rinrab

Thanks!

rinrab avatar Nov 12 '24 14:11 rinrab