Skip to content

build: Disable libstdc++ TBB backend to avoid unnecessary dependency#14509

Merged
Ericson2314 merged 1 commit intoNixOS:masterfrom
Mic92:no-tbb
Nov 7, 2025
Merged

build: Disable libstdc++ TBB backend to avoid unnecessary dependency#14509
Ericson2314 merged 1 commit intoNixOS:masterfrom
Mic92:no-tbb

Conversation

@Mic92
Copy link
Member

@Mic92 Mic92 commented Nov 7, 2025

boost::concurrent_flat_map (used in libutil and libstore) includes the C++17 header. GCC's libstdc++ implements parallel algorithms using Intel TBB as the backend, which creates a link-time dependency on libtbb even though we don't actually use any parallel algorithms.

Disable the TBB backend for libstdc++ by setting
_GLIBCXX_USE_TBB_PAR_BACKEND=0. This makes parallel algorithms fall back to serial execution, which is acceptable since we don't use them anyway.

This only affects libstdc++ (GCC's standard library); other standard libraries like libc++ (LLVM) are unaffected.

Motivation

Context


Add 👍 to pull requests you find important.

The Nix maintainer team uses a GitHub project board to schedule and track reviews.

@Mic92 Mic92 requested a review from edolstra as a code owner November 7, 2025 19:28
@Mic92 Mic92 added backport 2.31-maintenance Automatically creates a PR against the branch backport 2.32-maintenance Automatically creates a PR against the branch labels Nov 7, 2025
boost::concurrent_flat_map (used in libutil and libstore) includes the
C++17 <execution> header. GCC's libstdc++ implements parallel algorithms
using Intel TBB as the backend, which creates a link-time dependency on
libtbb even though we don't actually use any parallel algorithms.

Disable the TBB backend for libstdc++ by setting
_GLIBCXX_USE_TBB_PAR_BACKEND=0. This makes parallel algorithms fall back
to serial execution, which is acceptable since we don't use them anyway.

This only affects libstdc++ (GCC's standard library); other standard
libraries like libc++ (LLVM) are unaffected.
@Ericson2314 Ericson2314 enabled auto-merge November 7, 2025 20:05
@Ericson2314 Ericson2314 added this pull request to the merge queue Nov 7, 2025
Merged via the queue into NixOS:master with commit 479b6b7 Nov 7, 2025
16 checks passed
@internal-nix-ci
Copy link

Backport failed for 2.31-maintenance, because it was unable to cherry-pick the commit(s).

Please cherry-pick the changes locally and resolve any conflicts.

git fetch origin 2.31-maintenance
git worktree add -d .worktree/backport-14509-to-2.31-maintenance origin/2.31-maintenance
cd .worktree/backport-14509-to-2.31-maintenance
git switch --create backport-14509-to-2.31-maintenance
git cherry-pick -x 2f3ec16793b4ad029254be1ae25e7824ec0c1a71

@internal-nix-ci
Copy link

Successfully created backport PR for 2.32-maintenance:

uninsane added a commit to uninsane/nix that referenced this pull request Dec 8, 2025
NixOS#14509 configured meson to not use any
onetbb features. nixpkgs exposes an option to blake3 to remove onetbb
from the runtime closure as well, so enable that.
uninsane added a commit to uninsane/nix that referenced this pull request Dec 8, 2025
NixOS#14509 configured meson to not use any
onetbb features. nixpkgs exposes an option to blake3 to remove onetbb
from the runtime closure as well, so enable that.

Co-authored-by: Philip Taron <philip.taron@gmail.com>
uninsane added a commit to uninsane/nix that referenced this pull request Dec 8, 2025
NixOS#14509 configured meson to not use any
onetbb features. nixpkgs exposes an option to blake3 to remove onetbb
from the runtime closure as well, so enable that.

Co-authored-by: Philip Taron <philip.taron@gmail.com>
@edolstra edolstra mentioned this pull request Dec 9, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backport 2.31-maintenance Automatically creates a PR against the branch backport 2.32-maintenance Automatically creates a PR against the branch

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants