On 27. 6. 25 18:18, Timofei Zhakov wrote:
On Fri, Jun 27, 2025 at 9:59 AM Daniel Sahlberg <daniel.l.sahlb...@gmail.com> wrote:

    Den tors 26 juni 2025 kl 23:19 skrev Branko Čibej <br...@apache.org>:


        By the way, I noticed that the CMake build is consistently,
        intentionally behaving differently from the autotools build:
        autotools look for serf-2 before serf-1 and apr-2 before
        apr(-util)-1, CMake does the opposite. I have no idea why,
        except maybe stubbornness.


    "stubbornness" is a bit too hard in my book, it is very much
    uncalled for. I'd be happy to call it inconsistent...

    If I understand things correctly, FindSerf.cmake is looking for
    serf-2 before serf-1:

    [[[
    find_library(Serf_LIBRARY
      NAMES serf-2 serf-1
      PATH_SUFFIXES lib "${CMAKE_INSTALL_LIBDIR}"
    )
    ]]]

    But CMakelLists.txt, when using pkg-config, seems to look for
    serf-1 first:
    [[[
      if(SVN_USE_PKG_CONFIG)
        pkg_check_modules(serf1 IMPORTED_TARGET serf-1)

        if(serf1_FOUND)
          # serf-1
          add_library(external-serf ALIAS PkgConfig::serf1)
        else()
          # serf-2
          pkg_check_modules(serf2 REQUIRED IMPORTED_TARGET serf-2)
          add_library(external-serf ALIAS PkgConfig::serf2)
        endif()
    ]]]

    For APR I find it a bit more difficult to understand, but to me it
    looks like it is based on finding apr.h, so it would probably find
    apr-1 before apr-2:
    [[[
    find_path(APR_INCLUDE_DIR
      NAMES apr.h
      PATH_SUFFIXES
        include
        include/apr-1
        include/apr-1.0
        include/apr-2
        include/apr-2.0
    )
    ]]]

    When using pkg-config it seems to be the same as for Serf. It
    seems like easy enough to change, but I'd like to hear other
    opinions if there is a reason why it was done like this. @Timofei
    Zhakov <mailto:t...@chemodax.net>, I believe this was written by you?

    Cheers,
    Daniel



Hi,

IMHO, the first (stable) version should be prioritized over the second (unreleased trunk), because these are unstable, and half-supported by Subversion I'd say.

So I'd suggest adjusting the rest of the build script to do it in the same way for Serf.

Who will have unreleased trunk installed? Only developers. The build system should prioritise packagers and other users who have to build it for their own reasons. If and when apr-2/serf-2 are released, it's not unreasonable that both versions will be available; they are intentionally packaged so that both (probably ABI-incompatible) versions can co-exist on the same system. Subversion always wants to use the newer version. That is the logic behind looking for the newer version first.

-- Brane

Reply via email to