google / google/eclipsa-audio-plugin

Bundled Boost 1.86.0 fails to compile under recent Clang - `template` keyword misuse in `boost::qvm`, fixed upstream in 1.87.0+

Open Beginner friendly
#128 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
C++
Stars
90
Forks
16
Avg merge
1d 18h
Merged PRs (30d)
1

Description

## Summary

`cmake/boost.cmake` pins Boost to 1.86.0. That version's bundled `qvm` library (used by this plugin's own room/speaker-geometry code, via `common/components/src/room_views/Coordinates.h`) fails to compile under a sufficiently recent Clang:

```
build/_deps/boost-src/libs/qvm/include/boost/qvm/quat_traits.hpp:82:30: error: a template argument list is expected after a name prefixed by the template keyword [-Wmissing-template-arg-list-after-template-kw]
quat_traits::template write_element_idx(i, q) = s;
^
build/_deps/boost-src/libs/qvm/include/boost/qvm/quat_traits.hpp:92:30: error: a template argument list is expected after a name prefixed by the template keyword [-Wmissing-template-arg-list-after-template-kw]
quat_traits::template write_element_idx(i, q, s);
^
```

I hit this independently a while back (documented [here](https://gist.github.com/mormegil6/65f94cd804b924531ec9ac135cd2b09b), alongside the unrelated #10 and #20 workarounds needed at the time) and worked around it by hand-patching the fetched source post-configure:

```
sed -i '' '82s/template //;92s/template //' build/_deps/boost-src/libs/qvm/include/boost/qvm/quat_traits.hpp
```

That works, but it's a manual step that has to be redone on every clean `build/` directory. There's a real fix available instead.

## Root cause

This is [boostorg/qvm#54](https://github.com/boostorg/qvm/issues/54) - `template` used as a disambiguator before a name that isn't followed by an explicit template argument list, which newer Clang correctly rejects per the standard (see the linked [LLVM discussion](https://github.com/llvm/llvm-project/issues/101079)). It's not an Eclipsa bug and not a JUCE bug - purely upstream Boost, in a header this plugin's own code pulls in transitively through `boost/qvm.hpp`.

It was fixed upstream in [boostorg/qvm@c4b9c063a0](https://github.com/boostorg/qvm/commit/c4b9c063a0) ("Fix for issue 54") - the fix is exactly the same one-line-per-site change as the manual patch above, just applied at the source. Boost 1.86.0's bundled `qvm` submodule commit predates that fix by about a month; **Boost 1.87.0 is the first release whose bundled `qvm` includes it** (confirmed by comparing the pinned `qvm` submodule commit at each Boost release tag against the fix commit - 1.86.0 is behind it, 1.87.0/1.88.0/1.89.0 are all ahead of it).

I isolated this from the rest of the build to confirm precisely: compiling `quat_traits.hpp` standalone against the exact `qvm` commit Boost 1.86.0 bundles reproduces the error verbatim (same file, same lines, same columns); compiling it against the `qvm` commit Boost 1.87.0 bundles produces zero errors or warnings.

## Suggested fix

One line, in `cmake/boost.cmake`:

```diff
- URL "https://github.com/boostorg/boost/releases/download/boost-1.86.0/boost-1.86.0-cmake.tar.gz"
+ URL "https://github.com/boostorg/boost/releases/download/boost-1.89.0/boost-1.89.0-cmake.tar.gz"
```

(`find_package(Boost 1.86.0 ...)` immediately below doesn't need to change - it's a minimum-version check, and 1.89.0 satisfies it.)

1.87.0 is the *earliest* release that includes the fix (confirmed by comparing each release tag's bundled `qvm` submodule commit against the upstream fix commit - 1.86.0 predates it, 1.87.0/1.88.0/1.89.0 all postdate it), but I'd suggest going straight to 1.89.0, the current release, rather than the minimum - no reason to pin an intermediate version on purpose.

I confirmed this fully end-to-end, not just the isolated header, and not just one candidate version: with `third_party/JUCE` repointed at upstream JUCE 8.0.2 (the fix for #10), I built the full project against both 1.87.0 and 1.89.0 separately. Both complete with zero errors and zero `FAILED:` lines across the full build (1436 and 1457 steps respectively), and both produce a real, valid installed AU component (`Eclipsa Audio Renderer.component`, Mach-O arm64, verified with `file`). No other issues surfaced with either version once JUCE was also fixed.

Happy to open the `cmake/boost.cmake` PR if useful.

Contributor guide

Open the contributing guide

Research direction

Start in cmake/boost.cmake, where the Boost archive URL is pinned, and review the existing find_package minimum-version requirement. Update the pinned release to a version containing the qvm fix, then perform a clean build with recent Clang and verify that the project completes without failures and produces the installed AU component.

Written by the indexing model from the issue text.

Assessment

Tech stack
cmake, cpp
Domain
build-system
Issue type
Bug
Difficulty
1/5
Estimated time
Under an hour
Activity status
Quiet
Clarity
Clearly specified
Newbie friendliness
88/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.