#15470·meson

cannot use Boost headers-only libraries if no runtime library is installed

Author: yoursunnyCreated Jan 15, 2026Updated Sep 23, 2026
Labelsdependenciesboost

Describe the bug

In a Debian/Ubuntu system with only libboost-dev package but no other Boost runtime libraries installed, dependency('boost') function fails to detect Boost header-only libraries.

To Reproduce

This bug can be reproduced in a clean Debian container. Launch the container with docker run -it --rm gcc:14-trixie command. Type the following commands into the container shell to reproduce the bug:

bash
apt update
apt install -y --no-install-recommends libboost-dev ninja-build python3-pip
pip install --break-system-packages -U meson

mkdir /app
cd /app

cat >meson.build <<EOT
project('demo', 'cpp',
  default_options: [
    'warning_level=2',
    'cpp_std=c++11',
    'cpp_eh=none',
    'cpp_rtti=false'
  ]
)
boost = dependency('boost')
EOT

meson setup build

Actual Behavior

root@152cb6babc53:/app# meson setup build
The Meson build system
Version: 1.10.0
Source dir: /app
Build dir: /app/build
Build type: native build
Project name: demo
Project version: undefined
C++ compiler for the host machine: c++ (gcc 14.3.0 "c++ (GCC) 14.3.0")
C++ linker for the host machine: c++ ld.bfd 2.44
Host machine cpu family: x86_64
Host machine cpu: x86_64
Found pkg-config: YES (/usr/bin/pkg-config) 1.8.1
Run-time dependency Boost found: NO (tried system)

meson.build:9:8: ERROR: Dependency "boost" not found, tried system

A full log can be found at /app/build/meson-logs/meson-log.txt

meson-log.txt

The setup would complete successfully, if any Boost runtime library is installed. For example, apt install -y --no-install-recommends libboost-system-dev would be a workaround. Nevertheless, this shouldn't have been necessary.

Expected behavior

In Meson version 1.8.4 and earlier (install with pip install --break-system-packages -U meson==1.8.4), this meson.build file works as expected. Its output is:

oot@152cb6babc53:/app# meson setup build
The Meson build system
Version: 1.8.4
Source dir: /app
Build dir: /app/build
Build type: native build
Project name: demo
Project version: undefined
C++ compiler for the host machine: c++ (gcc 14.3.0 "c++ (GCC) 14.3.0")
C++ linker for the host machine: c++ ld.bfd 2.44
Host machine cpu family: x86_64
Host machine cpu: x86_64
Found pkg-config: YES (/usr/bin/pkg-config) 1.8.1
Run-time dependency Boost found: YES 1.83.0 (/usr/include)
Build targets in project: 0

Found ninja-1.12.1 at /usr/bin/ninja

system parameters

  • plain native build
  • Debian 13
  • Python 3.13.5
  • Meson 1.1.0
  • Ninja 1.12.1