Skip to content

Conversation

@bredelings
Copy link
Contributor

This PR suggests that meson temporarily revert some changes to the Boost dependency, pending a future fix.

As discussed in issue #15154, these changes don't work on Debian, Ubuntu, Red Hat, Arch, Gentoo, and Alpine. That is a lot of Linux distributions.

With this PR, some systems fail to configure until meson.build is edited. Without the PR, some systems incorrectly configure and then fail to build until some packages are installed. Neither is great -- what to do? 🤷‍♂️

@bredelings bredelings requested a review from jpakkane as a code owner October 31, 2025 17:48
@bredelings
Copy link
Contributor Author

Another approach would be to special-case Boost.system instead of Boost.python. This might work better since the list of library-modules-that-became-header-only should be short and not change very fast.

@eli-schwartz
Copy link
Member

As discussed in issue #15154, these changes don't work on Debian, Ubuntu, Red Hat, Arch, Gentoo, and Alpine. That is a lot of Linux distributions.

It is a bit ironic you say that, given your PR doesn't work on Arch (or macOS), and Fedora has boost 1.83, Gentoo has boost 1.88, and Ubuntu has boost 1.88 as well. So both places boost 1.89 is installed in CI, the

revert of changes that don't work

is what breaks the CI. (It is expected that it would break the CI. The CI upgrading to boost 1.89 and breaking, is the original reason these changes were originally made.)

And...

Another approach would be to special-case Boost.system instead of Boost.python. This might work better since the list of library-modules-that-became-header-only should be short and not change very fast.

That would, I believe, be a more accurate summary of "As discussed in issue #15154" than claiming the summary "these changes don't work". Yes, I acknowledge that the real difference is that some people think issue #15154 proves one thing, while others believe it proves something else at a 90 degree angle.

...

But... at the end of the day, CI doesn't lie. It can't lie, because it's the arbiter of truth: CI can't be made to start failing, because that makes CI worthless for detecting anything else, which means it is impossible to merge any PRs at all as it becomes exceedingly difficult to tell what changes are valid to make.

This PR cannot be merged until CI passes. If someone were to merge it anyway, it will be unconditionally reverted directly from git master pursuant to the contributing docs at https://mesonbuild.com/Contributing.html#a-green-ci-run-is-mandatory-for-merging

Please try to update this PR to use the method that we already discussed in the issue. In your words:

Another approach would be to special-case Boost.system instead of Boost.python. This might work better since the list of library-modules-that-became-header-only should be short and not change very fast.

And in my words:

Meanwhile the ONLY solution I can see for meson is for meson to contain a version-by-version list of boost modules that are exempt from needing a library component. Whenever a boost module transitions from being a library to being header-only, we add a min version. Whenever a boost module transitions from being header-only to being a library, we add a max version. Yes, this means boost users will need to wait for a new version of Meson every time boost upstream changes its approach.

Given that this was already discussed before the PR was opened, I cannot at all see us accepting a simple revert "pending a future fix". Especially if the PR description agrees that it's not a real fix and calls itself "temporary".

Even if the contribution docs didn't prevent a simple revert from being merged, the goal is to get the change into a release, not into git. And I won't backport a change into a stable release that fixes one use case and breaks another -- if it's going to be broken anyway, better that the shape of the breakage itself stays the same until there's a real fix, rather than toggling back and forth. At least then one could predictably pin their version. And that means there would be no urgency to merge a simple revert, and we should first try to figure out a proper fix.

I would love to see this fixed, and I would be happy to backport it to stable. But, we do need that future fix to be the one that gets merged.

@bredelings
Copy link
Contributor Author

bredelings commented Nov 3, 2025

I'll plan to work on that approach as I have time.

However, it seems part of the problem is that

  • your CI contains tests that you want to continue to work -- so you don't want to change the tests to remove boost "system" from being a "module"
  • but on the other hand, there are no CI tests that assess the failure that I'm seeing. That is, there are no tests that check that boost fails to configure when it will fail to link.

So, there are two types of failures here, and the current tests only check for one kind of failure. So, yes, CI can definitely lie. (Or, more accurately, CI doesn't directly speak -- it must be interpreted.)

That said, I think the approach I outlined can solve my problem and also pass the existing tests.

@eli-schwartz
Copy link
Member

Thanks, looking forward to reviewing it. Again, I agree the current situation isn't great.

And yes -- adding more tests to cover more cases is always good. Removing tests once they start failing is not so good, though it can technically happen if for some reason it's deemed there is no other choice, and has the advantage of not rendering status checks useless overall. :D

@bonzini bonzini added this to the 1.10 milestone Nov 18, 2025
@bonzini
Copy link
Collaborator

bonzini commented Nov 18, 2025

So right now detecting boost is completely broken. If there's no way to keep CI green here, it should at least be in release notes.

Stupid question, why can't the new behavior of looking only for headers be applied to a small set of modules? That would at least make the situation more bearable.

@eli-schwartz
Copy link
Member

eli-schwartz commented Nov 18, 2025

So right now detecting boost is completely broken. If there's no way to keep CI green here, it should at least be in release notes.

CI is green if you don't care about Debian. :)

(Or you make sure to install all boost packages on Debian. It's a matter of an incomplete package splitting causing misdetection.)

Stupid question, why can't the new behavior of looking only for headers be applied to a small set of modules? That would at least make the situation more bearable.

Not a stupid question.

That is exactly the behavior I suggested a month ago as the "only" solution, in #15154 (comment)

The original change simply didn't anticipate that Debian would break the naive approach.

@bredelings
Copy link
Contributor Author

bredelings commented Nov 18, 2025

CI is green if you don't care about Debian. :)

This has nothing to do with Debian specifically. Detecting boost is broken on Debian, Ubuntu, Red Hat, Arch, Gentoo, and Alpine.

The underlying idea that a library will be present if its headers are present is simply not true on any of the distributions I checked except Suse.

CI is green because there are no tests that test the problem.

Stupid question, why can't the new behavior of looking only for headers be applied to a small set of modules? That would at least make the situation more bearable.

I am hoping to do this, but haven't had time yet.

# Use one without a library dependency and one with it.

linkdep = dependency('boost', static: s, modules : ['thread', 'system', 'date_time'])
linkdep = dependency('boost', static: s, modules : ['thread', 'date_time'])
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Commit message should probably say "tests: ..." if it is test-only.

But this change shouldn't be made at all, I think. We want to test that the (eventual) new handling correctly handles cases where existing meson.build files still specify Boost.system. Otherwise we won't be exercising the proposed new codepaths.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah, and Bionic has saved us by explicitly failing. Its boost is old enough that libboost_system.so isn't a stub at all, it has genuine required symbols and the testcase fails to compile due to not asking for system.

@eli-schwartz
Copy link
Member

CI is green if you don't care about Debian. :)

This has nothing to do with Debian specifically. Detecting boost is broken on Debian, Ubuntu, Red Hat, Arch, Gentoo, and Alpine.

The underlying idea that a library will be present if its headers are present is simply not true on any of the distributions I checked except Suse.

CI is green because there are no tests that test the problem.

It... I keep saying this and I'm not sure why it keeps needing to be said.

For boost 1.88, a library WILL be present if its headers are present, on Red Hat, Arch, Gentoo, and Fedora.

For boost 1.89, Suse cannot have a library be present if its headers are present, because there is no library for Boost.system. By the same rule, neither can the other four.

Debian is the ONLY distribution (and Ubuntu is a Debian clone so it does not qualify to be listed separately) where it is not true that a library will be present if its headers are present, as a general rule.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants