git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: ./configure fails to link test program due to missing dependencies

From
Patrick Steinhardt <ps@pks.im>
Date
Sep 25, 2024, 06:04 UTC
Message-ID
<ZvOn_wChzEgXtpMd@pks.im>
In-Reply-To
<1f002f86-9212-4639-8804-898bc62726e5@gentoo.org>
On Wed, Sep 25, 2024 at 02:02:34AM -0400, Eli Schwartz wrote:
Show 84 quoted lines
> On 9/25/24 12:36 AM, Patrick Steinhardt wrote:
> > On Tue, Sep 24, 2024 at 09:59:52AM -0400, Eli Schwartz wrote:
> >> On 9/24/24 8:10 AM, Patrick Steinhardt wrote:
> >> Still I would prefer meson over autotools any day of the week. I'd also
> >> prefer autotools over cmake, mind you.
> > 
> > Is that a typo or do you really prefer autotools over CMake? :)
> 
> 
> POSIX sh (used by autotools) has a more powerful and capable type system
> than CMakeLists.txt (this is not a typo either! compare CMake's
> "semicolon;delimited;string" type to POSIX sh's "$@" type)
> 
> 
> m4 is less painful to debug than successfully configuring, spending 4
> hours compiling a ginormous project, then failing at the end with (this
> is because of the type system again, since there is no type for
> dependency-was-not-found they smuggle it along as a string value with
> special meaning):
> ld: cannot find -lCURL-NOTFOUND: No such file or directory
> 
> 
> If you enable cmake's test system, but you do it inside a subdir e.g.
> inside tests/CMakeLists.txt, you cannot run "ctest" (or make test)
> except inside that subdir. ctest will exit 0, and no rules will be
> generated to descend into the correct directory instead. This has bitten
> me a *bunch* of times in Gentoo packaging and it always throws me for a
> loop. I don't understand the point of such a design.
> 
> 
> I have never had autotools refuse point-blank to detect that another
> package is installed and usable for ***shared linkage*** because my
> distro automatically removes static libraries when a corresponding
> shared library exists, and
> 
> CMake Error at /usr/lib64/cmake/libssh2/Libssh2Config.cmake:92 (message):
>   The imported target "Libssh2::libssh2_static" references the file
> 
>      "/usr/lib64/libssh2.a"
> 
>   but this file does not exist.  Possible reasons include:
> 
>   * The file was deleted, renamed, or moved to another location.
> 
>   * An install or uninstall procedure did not complete successfully.
> 
>   * The installation package was faulty and contained
> 
>      "/usr/lib64/cmake/libssh2/Libssh2Config-relwithdebinfo.cmake"
> 
>   but not all the files it references.
> 
> 
> autotools projects have never harmed me by running the square of my make
> -j$(nproc) count due to recursively running cmake inside of generated
> Makefiles -- perhaps that isn't strictly the fault of CMake but cmake
> does very little to discourage it: https://bugs.gentoo.org/921309
> 
> 
> autotools doesn't have much in the way of built-in tooling for detecting
> "packages" instead of "libraries" for arbitrary system dependencies. It
> allows you to use pkg-config or code your own (foo-config scripts were
> popular once and in some circles still are). You might think this is a
> negative, but it's actually a positive compared to cmake, which includes
> builtin dependency finders for e.g. zlib that break on a simple version
> update because they locate the header file, open it up and use regular
> expressions to extract a #define for the package version instead of
> asking the preprocessor... a very brittle regex, too:
> https://gitlab.kitware.com/cmake/cmake/-/issues/25200
> 
> 
> autotools projects don't automatically detect your end-to-end
> integration test's dummy project, integrate its results into your build,
> and install some of your project files twice, once with bad values, but
> only when you run the project tests (this one was very fun):
> https://github.com/nlohmann/json/issues/2907#issuecomment-890580081
> 
> 
> ...
> 
> 
> I'm probably biased, but some of these failure modes are *weird*. And
> they basically never require the CMakeLists.txt to do something
> considered non-idiomatic in order to trigger the issue.

All of this is very valuable data to make my case for Meson instead of CMake. Appreciated, thanks!

Patrick
Previous: Eli SchwartzNext: Phillip Wood
Message 12 of 31 in “./configure fails to link test program due to missing dependencies”
  1. Henrik HolstSep 14, 2024
  2. Junio C HamanoSep 15, 2024
  3. brian m. carlsonSep 15, 2024
  4. Patrick SteinhardtSep 16, 2024
  5. Phillip WoodSep 18, 2024
  6. Junio C HamanoSep 18, 2024
  7. Patrick SteinhardtSep 24, 2024
  8. Eli SchwartzSep 24, 2024
  9. Paul SmithSep 24, 2024
  10. Patrick SteinhardtSep 25, 2024
  11. Eli SchwartzSep 25, 2024
  12. Patrick SteinhardtSep 25, 2024
  13. Phillip WoodSep 26, 2024
  14. Patrick SteinhardtSep 26, 2024
  15. Phillip WoodSep 27, 2024
  16. Eli SchwartzSep 26, 2024
  17. phillip.wood123@gmail.comSep 27, 2024
  18. Junio C HamanoSep 26, 2024
  19. Johannes SchindelinSep 29, 2024
  20. Eli SchwartzSep 29, 2024
  21. Phillip WoodSep 30, 2024
  22. Eli SchwartzSep 30, 2024
  23. Junio C HamanoSep 30, 2024
  24. Johannes SchindelinSep 30, 2024
  25. Patrick SteinhardtSep 25, 2024
  26. Patrick SteinhardtSep 25, 2024
  27. Junio C HamanoSep 24, 2024
  28. Paul SmithSep 25, 2024
  29. Eli SchwartzSep 26, 2024
  30. Paul SmithSep 26, 2024
  31. Eli SchwartzSep 24, 2024

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.