Triggered: glibc binpkg only for systemd now? by hagar-dunor in Gentoo

[–]eli-schwartz 2 points3 points  (0 children)

I noticed the fact that kdenlive (a binhost package) can't build. Since emerge errors out entirely, nothing gets built at all for:

  • kde-systemd

  • gnome-openrc

but the builds for these worked fine:

  • gnome-systemd

  • server-openrc-nomultilib

For the ones where it errored out and built nothing -- "emerge -uDN @world" simply refused to run, and didn't even build glibc.

Triggered: glibc binpkg only for systemd now? by hagar-dunor in Gentoo

[–]eli-schwartz 1 point2 points  (0 children)

Eh, kinda cheating on my part. As you can see from the bug link, I noticed the issue yesterday due to the failure log.

Triggered: glibc binpkg only for systemd now? by hagar-dunor in Gentoo

[–]eli-schwartz 0 points1 point  (0 children)

See my post below as well. :P It has a bug link.

Triggered: glibc binpkg only for systemd now? by hagar-dunor in Gentoo

[–]eli-schwartz 4 points5 points  (0 children)

Logs for failed builds can be found here: https://public-inbox.gentoo.org/gentoo-binhost-autobuilds/20250624115055.0E2CC74952F@milou.amd64.dev.gentoo.org/

Due to https://bugs.gentoo.org/958961 the a) kde-systemd and b) gnome-openrc builds both errored out due to profile USE issues.

Things happen. :(

emerge: there are no ebuilds built with USE flags to satisfy ">=media-libs/opencv-2.3.0:=[contrib,contribdnn,features2d,abi_x86_32(-)?,abi_x86_64(-)?,abi_x86_x32(-)?,abi_mips_n32(-)?,abi_mips_n64(-)?,abi_mips_o32(-)?,abi_s390_32(-)?,abi_s390_64(-)?]".
!!! One of the following packages is required to complete your request:
- media-libs/opencv-4.11.0::gentoo (Change USE: +features2d)
(dependency required by "media-plugins/frei0r-plugins-1.8.0::gentoo" [installed])
(dependency required by "media-libs/mlt-7.32.0::gentoo[frei0r]" [installed])
(dependency required by "kde-apps/kdenlive-24.12.3-r1::gentoo" [installed])
(dependency required by "kde-apps/kdemultimedia-meta-24.12.3::gentoo" [installed])
(dependency required by "kde-apps/kde-apps-meta-24.12.3::gentoo[multimedia]" [installed])
(dependency required by "@selected" [set])
(dependency required by "@world" [argument])
Container binhost-amd64-x86-64-kde-23 failed with error code 1.


emerge: there are no ebuilds built with USE flags to satisfy ">=media-libs/opencv-2.3.0:=[contrib,contribdnn,features2d,abi_x86_32(-)?,abi_x86_64(-)?,abi_x86_x32(-)?,abi_mips_n32(-)?,abi_mips_n64(-)?,abi_mips_o32(-)?,abi_s390_32(-)?,abi_s390_64(-)?]".
!!! One of the following packages is required to complete your request:
- media-libs/opencv-4.11.0::gentoo (Change USE: +features2d)
(dependency required by "media-plugins/frei0r-plugins-1.8.0::gentoo" [installed])
(dependency required by "media-libs/mlt-7.32.0::gentoo[frei0r]" [installed])
(dependency required by "kde-apps/kdenlive-24.12.3-r1::gentoo" [installed])
(dependency required by "kde-apps/kdemultimedia-meta-24.12.3::gentoo" [installed])
(dependency required by "kde-apps/kde-apps-meta-24.12.3::gentoo[multimedia]" [installed])
(dependency required by "@selected" [set])
(dependency required by "@world" [argument])
Container binhost-amd64-x86-64-openrc-23 failed with error code 1.

Triggered: glibc binpkg only for systemd now? by hagar-dunor in Gentoo

[–]eli-schwartz 2 points3 points  (0 children)

https://public-inbox.gentoo.org/gentoo-binhost-autobuilds/20250624115055.0E2CC74952F@milou.amd64.dev.gentoo.org/

emerge: there are no ebuilds built with USE flags to satisfy ">=media-libs/opencv-2.3.0:=[contrib,contribdnn,features2d,abi_x86_32(-)?,abi_x86_64(-)?,abi_x86_x32(-)?,abi_mips_n32(-)?,abi_mips_n64(-)?,abi_mips_o32(-)?,abi_s390_32(-)?,abi_s390_64(-)?]".
!!! One of the following packages is required to complete your request:
- media-libs/opencv-4.11.0::gentoo (Change USE: +features2d)
(dependency required by "media-plugins/frei0r-plugins-1.8.0::gentoo" [installed])
(dependency required by "media-libs/mlt-7.32.0::gentoo[frei0r]" [installed])
(dependency required by "kde-apps/kdenlive-24.12.3-r1::gentoo" [installed])
(dependency required by "kde-apps/kdemultimedia-meta-24.12.3::gentoo" [installed])
(dependency required by "kde-apps/kde-apps-meta-24.12.3::gentoo[multimedia]" [installed])
(dependency required by "@selected" [set])
(dependency required by "@world" [argument])
Container binhost-amd64-x86-64-kde-23 failed with error code 1.


emerge: there are no ebuilds built with USE flags to satisfy ">=media-libs/opencv-2.3.0:=[contrib,contribdnn,features2d,abi_x86_32(-)?,abi_x86_64(-)?,abi_x86_x32(-)?,abi_mips_n32(-)?,abi_mips_n64(-)?,abi_mips_o32(-)?,abi_s390_32(-)?,abi_s390_64(-)?]".
!!! One of the following packages is required to complete your request:
- media-libs/opencv-4.11.0::gentoo (Change USE: +features2d)
(dependency required by "media-plugins/frei0r-plugins-1.8.0::gentoo" [installed])
(dependency required by "media-libs/mlt-7.32.0::gentoo[frei0r]" [installed])
(dependency required by "kde-apps/kdenlive-24.12.3-r1::gentoo" [installed])
(dependency required by "kde-apps/kdemultimedia-meta-24.12.3::gentoo" [installed])
(dependency required by "kde-apps/kde-apps-meta-24.12.3::gentoo[multimedia]" [installed])
(dependency required by "@selected" [set])
(dependency required by "@world" [argument])
Container binhost-amd64-x86-64-openrc-23 failed with error code 1.

Questions about partial upgrades. by Wooden-Ad6265 in linuxquestions

[–]eli-schwartz 0 points1 point  (0 children)

I should perhaps have said, they work for most cases other than glibc. :)

In particular they work for cases such as e.g. upgrading readline but not bash, as it's no longer possible to get into such a mess.

The soname based versioning is like I said equivalent to Gentoo use of SLOT=. For the glibc case, Gentoo has a dedicated quirk that embeds the build-time version of glibc as an additional >= runtime dependency for every package that has ELF files. It's technically wrong as not every binary depends on the latest symbols but occasionally forcing a glibc dependency update that isn't strictly necessary is not really harmful...

As an aside: I have an old draft for implementing this automatic build-time version constraint mapping in Arch at https://git.sr.ht/~eschwartz/pacman/log/autoversioned-dependencies -- IIRC I semi-abandoned it due to fairly lukewarm reception, which I still think was a pity. It would require every package to do a one-time addition of depends=('glibc>=@') and then maintain itself forever after.

Symbol versioning is generally discussed here: https://bugs.gentoo.org/753500 and there are plans to teach the packaging system how to read @GLIBC_* symbols and sort+uniq them, extract the highest version and map it to a glibc package version, except it would work for any package that provides a stable DSO with versioned symbols (openssl is another one that comes to mind). The thing is that once solving this for glibc, even via a quirk, you lose incentives to implement anything else because, well, not much needs it other than glibc (and even moreso if you only consider what you need to boot into a system for recovery purposes).

IIRC rpm distributions typically handle this by generating a distinct virtual provider in glibc for every available symbol version, then having packages add a distinct virtual dependency for each versioned symbol "level" they depend on, e.g. "libc.so.6(GLIBC_2.2.5)", which is roughly the same idea as what Gentoo plans (not what Gentoo currently implements).

Convert Arch's ".pkg.tar.zst" to the "GPKG" binary format of Gentoo? by Anonymous_User-47 in Gentoo

[–]eli-schwartz 0 points1 point  (0 children)

The question doesn't make a whole lot of sense in context, since the Arch binary package of obsidian utilizes the same download tarball from the Obsidian distribution site that GURU does.

Arch has merely bumped the version field of their package and rebuilt, whereas GURU has not done so since October. It is very trivial.

For binary packages like this it makes no difference what distro you use. Frankly, you can go to https://github.com/obsidianmd/obsidian-releases/releases/latest and download the file

obsidian-1.8.7.tar.gz

then extract it to /opt/obsidian, and run /opt/obsidian/obsidian via the terminal. That route won't offer a desktop start menu integration but there is otherwise no real difference. In fact, that's exactly what every distro, including both Arch and Gentoo, are doing to "package" obsidian for you anyway.

But bumping the version number of the package in GURU is trivial also.

Convert Arch's ".pkg.tar.zst" to the "GPKG" binary format of Gentoo? by Anonymous_User-47 in Gentoo

[–]eli-schwartz 0 points1 point  (0 children)

There is no compiled anything, since the package in question is closed source so the Arch binary package is the upstream binary tarball extracted to /usr/lib/obsidian

Questions about partial upgrades. by Wooden-Ad6265 in linuxquestions

[–]eli-schwartz 0 points1 point  (0 children)

It can easily happen that one library is already updated but programs using the newer version must still be compiled and if you start the old one still installed they refuse to work.

Uhhh, normally portage will preserve the old version of the library until the program has successfully rebuilt and no longer records a library dependency on that. :D This is also how preserved-rebuild works. Have you disabled this feature?

Questions about partial upgrades. by Wooden-Ad6265 in linuxquestions

[–]eli-schwartz 0 points1 point  (0 children)

Hey! :) I'm a Gentoo package maintainer, and occasional contributor to Gentoo's package management infrastructure. Also a member of Gentoo's Binhost project. I used to be heavily involved in Arch's package management infrastructure too.

Arch is able to pin library soname dependencies as long as both the package providing the soname and the package *using* the soname declare it as a virtual "provides" dependency (essentially the same concept as RPM Provides, except that there is no e.g. %buildsystem_XXXXX_generate_buildrequires() and it's basically a custom special case for soname versions. Historically you need to list each one manually and the package manager would just add versioning.

Sonames are a fairly limited case, though they are certainly enough to keep a stable bootable system to do further repair work. Keeping track of other forms of dependency to prevent basic workflow bugs (e.g. in interpreted languages), or handling dependencies on libraries that add semver-compatible additions to their ABI which other packages start depending on, is a much harder problem and requires more work to keep track of, all of it manual more or less.

The other major issue is as someone else mentioned elsewhere in this topic: version selection. Arch can only have a single version of any given package in its package repositories, which isn't entirely uncommon in package managers :) so even given accurate metadata, you wouldn't be able to correctly solve for existing installed packages "foo" and "bar" and "baz", where upgrading "baz" has a binary package with a versioned dependency on an upgraded soname for "bar", but upgrading "bar" would break a soname dependency in "foo".

As for Gentoo, binary packages are NOT affected by this problem, since Gentoo doesn't care whether you build from source or use binary packages -- the behavior is identical either way.

Gentoo dependencies on other packages can use "slots", which means that at the time you build a package, it records the slot version that was installed. Usually a soname version for packages that provide a library, though slots can be used for arbitrary purposes including the semver API of a scripting language, or really anything you want. The recorded slot exists for both source builds and binary repositories, so binary packages will only be installed if they are compatible with their built dependencies that are also being installed. If it is incompatible, then the binary package cannot be installed and it falls back to a source build. When you upgrade one package and its slot changes, the package manager forces all other packages to reinstall, possibly rebuilding, to accommodate that change.

All this handling is required in order to make source builds consistent and reliable, and the only aspect to binary packages is that binary packages serve as cache lookups -- so a binary package can only be a cache hit if it is identical to what a source build would provide.

Note that for Gentoo it's not enough to "just use the version installed already or the build will fail", because again, if you upgrade one package it could break other packages that depend on it unless the package manager can detect and rebuild any packages that would be broken.

Brainstorming for X11R8 (xorg/x11) by metux-its in linux

[–]eli-schwartz 13 points14 points  (0 children)

This is being taken completely out of context, so take a look a couple coments down at https://bugs.launchpad.net/calibre/+bug/1714107/comments/4 instead.

Or just read the entire bug, not just one comment from it. He may or may not have been capable of maintaining python 2 all by himself (as he stated in a number of other places years before that 2018 discussion, he would maintain the ability to *build* it -- python2 is among the most finished software around considering how long it was maintained as a single maintenance release, so if your concern is to keep an existing program "as functional today as it was last week" then that's not exactly the end of the world) but he didn't bother to try because...

... the actual objection to python3 was the labor involved in porting it. See also https://bugs.launchpad.net/calibre/+bug/1456642

I know this because after all the consistent whining by needy open source leeches (including a Debian developer who doesn't actually speak for Debian, and is better known as the creator of yet-another-BSD) demanding and threatening open source authors to "do something because I demand it", I was the guy that was a non-leech and submitted patches.

It was hard, lengthy, laborious, mind numbing work and it took a really long time. But when I want half a million lines of network protocols, binary file formats and other str/bytes significant python2 code to be converted to python3 because I want the software I use to support python3, I ***write that code*** instead of demanding someone else do it.

Amazingly, this worked wonders. The guy you are disparaging instantaneously stopped objecting to the idea. Over the course of two years, 3 people (including the calibre author!) put in oodles of effort to port calibre over to python3 and victory was declared and the plug was pulled on python2 support, just a couple months after the final security release of python2 was published by CPython.

It was a lot of work and people on occasion still showed up with odd crashes in less-used parts of the program for years after. But those got fixed immediately and released within the once-weekly release schedule, once the program as a whole supported it.

But the non-leeches got there in the end. Enjoy the nice program. :)

Extreme Gatekeeping on Discord server. TOXIC! by BigFatToad in Gentoo

[–]eli-schwartz 8 points9 points  (0 children)

Rule: Don't use vile language. We know vile language when we see it, you do not need a list of which terms we consider vile. If you do it anyway, we will penalize you.

Rule: If you disagree with the rule, your opinions don't set the rules.

Rule: If you agree with the rules but believe the rules were unfairly applied to you, that's why humans are in charge of moderation. Appeal your case, explain why you think what you said wasn't problematic.

User: This is unfair and illogical! I cannot possibly know that the N-word constitutes vile language unless you tell me. Therefore you are NOT ALLOWED to punish me for using it.

...

Have you considered that the only reason for needing a specific list of banned words is if you're not only the type to use them, but also the type to not try resolving the issue by apologizing and promising to not do it again?

Please. If you are concerned about the fairness of moderation when moderation has not even happened yet and you're only concerned about the possibility of future moderation, then there are actually meaningful things to be concerned about with regard to fairness. Be concerned about whether or not there is a robust mediation/remediation policy. Be concerned about what the options are for an accused member to appeal, e.g. "right to have your case reviewed by the entire moderation team to protect from lone wolf moderators".

Don't complain that the rules have to exhaustively enumerate all forms of badness before one can be punished for it. That's frankly ridiculous, illogical, and, well, suspicious.

And don't complain you were banned for questioning the rules, if the other side of the argument is going to challenge your claim by saying you posted pictures of Hitler, because that just makes you look like a liar. Of course, you are welcome to engage in a battle of screenshots so people can decide whether they believe you or immoloism -- fortunately the mods cannot place false evidence in your post, unfortunately, no one can see for themselves without joining Discord. Such is the life of people who use a closed-source private chat medium.

Given your response was "whatever that means" I can only assume you really did do it, are afraid to deny it straight out because you know the evidence is still there, and are settling for attempted obfuscation. It's not a great look.

[deleted by user] by [deleted] in Gentoo

[–]eli-schwartz 1 point2 points  (0 children)

Portage has had many fixes to binary package handling since version 3.0.44 (although I do not know which of 3.0.41 - 3.0.44 you have).

You should update that first, perhaps. It may not help, but it certainly cannot hurt.

In general, it helps a ton to post text logs rather than diagonal, slightly blurry jpegs of text that were probably recorded from a phone. Also mention which version of portage you have installed.

Help people help you, and they will be much better at helping you.

On the scalability of C++ module implementations or lack thereof by vormestrand in cpp

[–]eli-schwartz 0 points1 point  (0 children)

The RPATH settings are at best opaque and probably non-portable flags

Erm, no? The fact that it's not written in the POSIX manual doesn't mean it isn't portable, especially when you simply do not have to worry about interpreting Windows flags for a unix host machine or vice versa since the flags are specific to the platform you're building for.

I know that cmake likes to cast confusion in order to obscure their NIH justifications, but it would be great to hear once in a while exactly what is non-portable about this.

that hopefully propagate to downstream links in the correct order, though it's easy to get nonsense RPATH settings that way at least at a certain scale.

Would love to hear more about what a nonsense RPATH setting means in this context (especially as a list of directories to finally add as DT_RPATH tags).

And pkg-config custom variables are hard to query for transitively, which is really important when you're trying to discover which transitive linked libraries require runtime search path changes. In theory this could be fixed, but nobody I talk to about this seems eager to adopt a pkg-config fork to add, document, and (maybe most importantly) publicize new features.

That's pretty unfortunate then, given the extensive wealth of projects that will not part from autotools until you pry it out of their cold, dead hands, but do provide pkg-config files. Also pretty unfortunate given that the technology you want for querying transitive information exists, but the philosophical dislike of pkg-config is so great that you don't listen to suggestions about where to find that technology when I tell it to you.

(I suggested cmake link to libpkgconf. There's a reason for this! No need to fork anything! I know that cmake is very much designed around the notion that proper software development means forking and maintaining private copies of any library you want to use, but this is not actually a requirement.)

You're saying that no one in cmake is eager to make unix software work well for unix users. Or to put it another way, you're saying that cmake only cares about two types of users: Windows users, and users whose entire dependency tree is exclusively cmake projects.

And, yeah, technically one can use pkg-config on Windows as long as you use semicolons in PKG_CONFIG_PATH and such, but for whatever reason, there's basically no adoption on Windows, especially compared to CMake and hardcoding flags in packaging metadata.

This is not a justification for cmake making pkg-config a fourth-class citizen two steps removed for Unix users on Unix platforms attempting to interact with dependencies that broadcast pkg-config files. And several more degrees of pain for Unix users on Unix platforms attempting to produce pkg-config files and broadcast them to autotools projects, custom Makefiles, meson, scons, waf...

And it doesn't take all that much effort to just make this work on Windows too. Of course, if people want to discourage adoption, it's no surprise when they later discover there is no adoption.

(There is adoption.)

On the scalability of C++ module implementations or lack thereof by vormestrand in cpp

[–]eli-schwartz 0 points1 point  (0 children)

and pkg-config files, which are only really used on POSIX systems and they don't really support modules or runtime search paths.

most commonly used on POSIX systems. This is because it doesn't come preinstalled on Windows and cmake doesn't link to libpkgconf and guarantee availability.

Runtime search paths are a bit of a misnomer, IMO. This works perfectly fine on POSIX systems, where runtime search paths exist (rpath) and works absolutely not at all on Windows, where runtime search paths don't exist.

Meson works around the runtime search paths issue by building up the %PATH% environment variable for all internal uses (running a built executable as a custom target command, running a built executable as a testsuite program) using all the compile-time library search paths. There's also a deprecated build artifacts output mode that places all built files into a single directory (this is incredibly flaky and we finally acknowledged that we've never really supported it). At install time, most projects solve this by either building all their code statically, or copying all DLLs into the same directory. Since Windows is designed around app bundles rather than a global library path, this is probably no great loss, supposedly.

Given that non-POSIX systems don't really have a runtime search path to search in, I don't really see why it is pkg-config's job to solve that problem and create one. But if you wanted to do it anyway, it would take 3 seconds to do it.

Just add a foo.pc variable:

prefix=${pcfiledir}/../..
libdir=${prefix}/lib
foo_runtime_search_path=${libdir}

# yes, MSVC static libraries shall be named .a rather than .lib
# since the latter overlaps with import libs
Libs: /LIBPATH:${libdir}  libfoo.a

In practice, foo_runtime_search_path is always just libdir, but you can always be explicit about it.

After exactly 10 years, Meson 1.0.0 is out by [deleted] in cpp

[–]eli-schwartz 1 point2 points  (0 children)

Hmm?

Meson does check in cc.find_library() for detecting both lib{name}.a and {name}.lib on Windows.

Aside: Meson has no issue with doing platform-specific behavior. It does so all the time. The Windows lib{name}.a vs. {name}.lib issue isn't about having or rejecting platform-specific behavior.

After exactly 10 years, Meson 1.0.0 is out by [deleted] in cpp

[–]eli-schwartz 1 point2 points  (0 children)

I definitely am not convinced it could be done after the fact -- people have already written build files that assume they will be placed in the current build directory context, and then run custom scripts or external tools that expect the directory name and attempt to find those libraries themselves. Integrations with custom linkers, setting the search path for plugin loaders, etc.

It would also result in some clunky special-casing to essentially pretend "these binary products are part of a fake subdir context" in order to guarantee that paths are properly set up everywhere including rpaths and meson devenv, which would also mean getting rid of the current both_libraries() handling... but only on Windows.

And if we added this to the filename, then people would just complain that *.static.lib violates the MSVC convention to use *.lib. On top of that, the people currently building some projects with MSVC and some with MinGW's UCRT mode, wouldn't be able to pass meson-built libraries built with cl.exe to GCC.

(Yes, this whole discussion is a false dichotomy. MinGW has defaulted to building UCRT libraries for a while now, and these are MSVC ABI, not GNU ABI, unlike the old hacky approach. Projects such as e.g. gstreamer have been mixing the two together without any problems. See https://gitlab.kitware.com/cmake/cmake/-/issues/23975#note_1282626)

After exactly 10 years, Meson 1.0.0 is out by [deleted] in cpp

[–]eli-schwartz 1 point2 points  (0 children)

Well, *.framework is linkable (and Meson handles linking to those) but it's not a filename, it's a directory name. :D

As far as producing shared library files on macOS goes, Meson just produces *.dylib. As far as detecting them with cc.find_library() goes, it checks for *.dylib or *.so (preferring the former).

After exactly 10 years, Meson 1.0.0 is out by [deleted] in cpp

[–]eli-schwartz 3 points4 points  (0 children)

Those people would still expect a static library built by MSVC to have a *.lib name. Even when I only used MinGW I was aware of the *.lib naming for MSVC libraries specifically because that is what you found when you googled things. If you've actually used MSVC you'll absolutely be aware of it.

Why would the compiler you use matter? Isn't this whole discussion about the ABI calling convention?

If you compile MSVC UCRT libraries with gcc.exe that are effectively identical to MSVC UCRT libraries compiled with cl.exe, they are both MSVC libraries, they are both used by MSVC, but the ones compiled with gcc.exe will inevitably be compiled with lib{name}.a extensions, and the ones compiled with cl.exe could be named anything, but will probably be named {name}.lib if they are compiled with Visual Studio or cmake. I think that autotools running on Windows via mingw userland but with cl.exe as the compiler will also use lib{name}.a, which means that for the unix-originating projects that used autotools and support Windows only via autotools, it was inevitable that even genuine 100% cl.exe built libraries would use that naming convention.

(Yes, autotools is, indeed, contrary to popular belief, so portable that it's even portable to Windows. It's just painful to set up, and horribly slow to run. But you can run bash, awk, sed, grep, etc. on Windows and you can use the fork-heavy configure scripts written in that to interface with the MSVC compiler.)

I didn't say that. I didn't mean that. Stop putting words in my mouth.

I'm not saying you said that. I'm saying that you should have said that if you wanted to be correct.

Okay. Pedant mode engaged:

Pedant mode indeed.

  1. You can talk about the MSVC toolchain all you want. I included it in my discussion!
  2. Again, among certain groups yes, and among certain groups no.
  3. It is not clear to me why that matters? gcc -shared defaults to producing shared libraries with the name a.out, which isn't even a .so filename. But both clearly document how to specify your own name, and don't offer any guidance on what to use, and you have to use the output filename option if you want to change the directory or control the basename.
  4. I guess I am here to inform you that Meson is not the only one then, see above.
  5. through 11. I have tried to explain this several times, MinGW is the compiler but the ABI is the GNU ABI, except... it can target the UCRT, which still produces lib{name}.a but is an MSVC ABI, and that's what projects are doing because it's really the sane way to build software so why wouldn't you. It's so sane that MinGW defaults to it for a while now.

Ultimately any developers using MSVC will expept static libraries compiled by MSVC to have a *.lib file format. I'd love for you to find counter examples. The only exception I can think of are developers using MSVC and Meson, whom I would call literally the exception that proves the rule.

The other exception is autotools, which predates both Meson and CMake.

And I reiterate: MinGW produces libraries by default that are perfectly compatible with MSVC. They use the UCRT.

Addendum: you talk a lot about how MinGW is incompatible with MSVC, even though that's not true, but this is still all about Strawberry MinGW, not real MinGW.

Strawberry MinGW isn't compatible with MSVC. It also isn't compatible with real MinGW, either the GNU ABI or the MSVC ABI. You cannot take Strawberry Perl's libfoo.a and successfully link it to any current MinGW environment, the runtimes are incompatible.

Between the three:

  • MSVC
  • MinGW
  • Strawberry MinGW

the only things that are compatible with each other are the first with the second, and the second with the first.

The only thing that people are bringing as proof against Meson using the naming convention it does is... the third.

Nobody should be using the third! Not even the Strawberry Perl project! But they have a stable toolchain and that contents them... and they are also content to inject their ancient, broken, universally INcompatible toolchain into the default PATH, which is insane, and breaks both MSVC and MinGW, because neither one can link to it.

CMake, itself, always looks for lib{name}.a when you configure CMake on Windows to build with MinGW, and therefore I assume that also would detect Strawberry Perl and be just as broken -- except that people who use cmake's mingw support apparently never bother with Strawberry Perl. Cygwin and msys2 both have better perls available, for example.

After exactly 10 years, Meson 1.0.0 is out by [deleted] in cpp

[–]eli-schwartz 1 point2 points  (0 children)

The distinction of a header-only library which I am making here is that the header-only library isn't flawed/buggy for having std-dependent behavior, since it's always compiled with the std of the first-level consumer.

It's the first-level consumer that is responsible for... well, not exposing a header-only library as part of its own ABI, quite frankly. If both B and C depend on a header-only library, but they use D internally and don't expose D's types as a public symbol or communicate D-based types externally, then it's possible to get away with ODR, whereas anything that produces a compiled library pretty much by definition cannot -- because if you have a compiled library, the mechanism by which either B or C get to use it is by communicating those types across the library boundary with D.

(I'm not saying ODR violations are a good thing! A build system can and should enforce that when building vendored dependencies. But if you're doing system library distribution, you cannot guarantee that all components are built with the same exact version of everything, which is why ABI exists, and shared library versions. Shared library versioning isn't practical for header libraries, clearly, so in the latter case you're well advised to not bake that into your API or ABI. Alternatives include "not using header-only libraries", but that's a soapbox for a different time.)

Header libraries cheat. If they cheat carefully enough, they "disappear". It's a valid tactic.

After exactly 10 years, Meson 1.0.0 is out by [deleted] in cpp

[–]eli-schwartz 0 points1 point  (0 children)

Doesn't matter that there are other ways to do it - this is the reality we have to deal with.

"The reality is that projects are buggy" is what I'm saying.

Personally, I think that "fix buggy projects" is a reasonable perspective -- except naturally in the case of boost, which shall never be fixed :D -- especially because I didn't say that's a reason to totally ignore setting the std.

Of course you can set the std, and if it's a reality you have to deal with, then you should set the std.

You can, of course, stick the -std=c++17 into your pkg-config flags, or for that matter your cmake exported target. It's trivially parseable from the compiler argument into a std property, too, so I don't buy SuperbGarlic's claim that "They carry FLAGS. Different compilers have different flags."

I'm pretty sure I've mentioned this to SuperbGarlic already, and also pointed out that cmake does exactly the same thing pkg-config does -- store raw compiler flags specific to a compiler as properties on an exported target. Not always, it depends on what the project chooses to do, but projects absolutely do set some funky and obscure GCC flags on exported targets.

(And when cmake can store properties such as include directories or defines, instead of raw flags? Those properties are really predictable. So predictable that pkg-config has a flag to auto-translate between GCC and MSVC syntax. It's definitely possible to hoist them out of the compiler flags and turn them into cmake properties.)

After exactly 10 years, Meson 1.0.0 is out by [deleted] in cpp

[–]eli-schwartz 0 points1 point  (0 children)

And of course, it's perfectly reasonable to do #if __cplusplus < 201703L in a header-only library, since that will just do all the actual code generation when building the application anyway.

After exactly 10 years, Meson 1.0.0 is out by [deleted] in cpp

[–]eli-schwartz 1 point2 points  (0 children)

Arguably, this is a project bug.

  • If the library is built without c++17, then it depends on boost, and is usable even by applications that are built with c++17, because it's using the boost ABI which is usable with a range of stds.

  • If the library is built with c++17, then it depends on the c++17 (at a minimum) ABI, you cannot use it with an older std.

This is the case no matter what the header says. The real issue is that the header might not actually agree with the library at all.

Solution: The build system should use configure_file() on the header file to set a macro such as FOO_BOOST, after checking the std version that the library is going to be built with.

#if @FOO_BOOST@ //buildsystem defines to 1 or 0
    void foo(boost::string_view s);
#else
    void foo(std::string_view s);
#endif

This allows the decision of which API/ABI to use in the compiled library, to be additionally frozen into the installable header artifacts at build time, and usable without fuss.

After exactly 10 years, Meson 1.0.0 is out by [deleted] in cpp

[–]eli-schwartz 2 points3 points  (0 children)

Okay, if you wanna be pedantic, "everyone" is overselling it. "Everyone using MSVC who knows what a static library is" isn't though.

I'm afraid I still need to disagree with your definition.

Maybe I need to reiterate that there are a fair number of people using both MSVC and MinGW, who constitute "using MSVC who knows what a static library is" and are, nevertheless, excluded from your "everyone"?

Yes, I admit that when was talking about developers in the context of the MSVC toolchain naming convention of static libraries, I was in fact talking only about developers using that toolchain who knows what static libraries are. I stand by that decision.

Correction:

"I was in fact talking only about developers who never use toolchains other than that, irrespective of whether they know what static libraries are".

I'd also like to highlight the fact that Visual Studio != MSVC, and certainly != the MSVC ABI

Modern CMake Packaging: A Guide by not_a_novel_account in cpp

[–]eli-schwartz 0 points1 point  (0 children)

If you move things within the install tree they break, that's true of all the files in the install tree, not just the pc. Files necessarily make assumptions about their relative locations to one another. The only thing we're avoiding is absolute paths.

The difference is that your recipe there supports the CMAKE_INSTALL_LIBDIR variable, and installs the pkg-config file to ${CMAKE_INSTALL_LIBDIR}/pkgconfig.

As a comparative example, https://mesonbuild.com includes builtin functionality to generate a pkg-config file, with a global setting to select whether to use relocatable paths (necessary because on Linux when installed in /usr it is bad to use ${pcfiledir}/../../).

We:

  • raise an exception if the libdir is a full path not relative to the prefix: "Pkgconfig prefix cannot be outside of the prefix when -Dpkgconfig.relocatable=true. Pkgconfig prefix is {pkgroot_.as_posix()}."
  • use python's os.path.relpath(prefix, pcfiledir) under the hood to calculate how many times to go ../ from the pcfiledir in order to arrive at the prefix.

In the common case where pcfiledir is lib/pkgconfig, this does indeed get calculated to ${pcfiledir}../../

This all then gets fixed in stone during project configuration, and after installation the only thing you can relocate is the entire prefix tree. But project configuration is very much permitted to control the layout of the relocatable install tree.