Skip to content

[VALIDATE #9392] disable WITH_THERMO_RAW on macOS — DO NOT MERGE - #9393

Closed
timosachsenberg wants to merge 24 commits into
developfrom
validate/disable-thermo-raw-macos
Closed

timosachsenberg wants to merge 24 commits into
developfrom
validate/disable-thermo-raw-macos

Conversation

@timosachsenberg

Copy link
Copy Markdown
Contributor

Do not merge. This PR exists only to validate the hypothesis in issue #9392.

What this PR changes

One line in CMakeLists.txt: defaults WITH_THERMO_RAW=OFF on APPLE, on top of the full PR #9389 changeset.

What we're testing

Issue #9392 hypothesizes that linking openms-thermo-bridge into libOpenMS.dylib causes a typeinfo/visibility mismatch on macOS, which makes catch (const std::exception&) in openTimsDataHandle() fail to match std::exception subclasses thrown from opentims's static lib, so BrukerTimsFile_test line 115 (TEST_EXCEPTION(Exception::FileNotReadable, ...)) reports "wrong exception thrown! "No such file or directory"".

Expected outcomes

This PR will be closed and the branch deleted once CI surfaces the answer.

cc @jpfeuffer (assignee of #9392)

🤖 Generated with Claude Code

Copilot AI and others added 24 commits April 28, 2026 18:43
Integrates github.com/jpfeuffer/openms-thermo-bridge using CMake FetchContent
to enable native reading of Thermo RAW files into MSExperiment.

- Add WITH_THERMO_RAW CMake option (OFF by default)
- FetchContent openms-thermo-bridge from GitHub
- Create ThermoRawFile class (header + implementation)
- Register in FileHandler, FileTypes, and FORMAT sources
- Handle runtime file deployment for managed .NET bridge DLLs
- Add test data download option (ENABLE_THERMO_RAW_TESTS)

Agent-Logs-Url: https://github.com/OpenMS/OpenMS/sessions/0baa4939-e841-4551-84a6-7d773b80aa2c

Co-authored-by: jpfeuffer <[email protected]>
- Remove unnecessary DataProcessing clear for centroid scans
- Add comment explaining HCD -> BEAM mapping
- Add warning log for unknown activation types
- Fix FetchContent SOURCE_DIR variable name typo

Agent-Logs-Url: https://github.com/OpenMS/OpenMS/sessions/0baa4939-e841-4551-84a6-7d773b80aa2c

Co-authored-by: jpfeuffer <[email protected]>
… resolve FileTypes_test.cpp conflict (READABLE count: 47+1=48)

Co-authored-by: jpfeuffer <[email protected]>
…ntime copy + macOS arm64 stub

- Test: gate the precursor round-trip assertion on the test data actually
  containing MSn spectra. The bundled ginkgotoxin RAW is MS1-only, so the
  unconditional TEST_EQUAL(found_msn_precursor, true) was failing on
  Linux/Windows. Emit STATUS log when no MSn present so the gap is visible.
- CMake: copy the managed bridge runtime files (ThermoWrapperManaged.dll +
  .runtimeconfig.json) next to ThermoRawFile_test.exe via a POST_BUILD
  step. The bridge searches exe_dir/managed first; on Windows the test
  binary lives in src/tests/class_tests/bin which is a different directory
  from libOpenMS.dll, so the OpenMS-target copy was not visible at runtime.
- Test: provide a placeholder main() when WITH_THERMO_RAW is OFF so the
  test target still links on platforms where the bridge is disabled (macOS
  arm64 default). The empty TU previously caused "Undefined symbols: _main".

Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
The cibuildwheel manylinux containers and Windows/macOS wheel builders do
not have the .NET SDK pre-installed, so the FetchContent step for
openms-thermo-bridge fails with:

  Could not find DOTNET_EXECUTABLE using the following names: dotnet

Pass -DWITH_THERMO_RAW=OFF in all four wheel cmake invocations (Linux x64,
Linux arm64, macOS arm64, Windows). The wheels stay portable; users who
need Thermo RAW support can build OpenMS from source with the bridge
enabled.

Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
Thermo's RawFileReader does not ship native dependencies for arm64 on
either macOS or Linux. The bridge configures and builds (it is just
managed .NET), but at runtime the C# code throws a managed exception
when it tries to open a RAW file because the underlying native helpers
aren't present. CI confirmed: ubuntu-24.04-arm fails ThermoRawFile_test
with "Failed to open RAW file (code -2)" (managed exception).

Extend the existing macOS arm64 default-off to also cover Linux arm64
and update the warning/status message accordingly.

Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
…NETALIGN blocks in src/openms/CMakeLists.txt

Co-authored-by: timosachsenberg <[email protected]>
…SOLVER, WITH_THERMO_RAW, ENABLE_THERMO_RAW_TESTS, WITH_WNETALIGN

Co-authored-by: timosachsenberg <[email protected]>
v0.2.0 ships native osx-arm64 managed runtime assets, so the
arm64/Apple workarounds added earlier in this branch are no longer
needed.

Changes:
- cmake/cmake_findExternalLibs.cmake: pin GIT_TAG to v0.2.0
- CMakeLists.txt: narrow the arm64 default-OFF guard to Linux aarch64
  only (macOS arm64 is now fully supported); update messages
- .github/workflows/pyopenms-wheels-cibuildwheel.yml: remove
  -DWITH_THERMO_RAW=OFF from the macOS arm64 wheel build job
- ThermoRawFile_test.cpp: update comment to reflect that only Linux
  aarch64 still defaults to OFF
…w, gate behind ENABLE_THERMO_RAW_TESTS (opt-in)

The previous ginkgotoxin sample was MS1-only, leaving the MS2 precursor
round-trip assertion silently skipped. Angiotensin_AllScans.raw (BSD-2-Clause,
Battelle 2018) has 87 MS1 (FTMS Full ms) plus hundreds of MS2 scans with HCD
and supplemental-activation (ETD+HCD, ETD+CID) filters at precursor m/z 432.9,
exercising the activation-method switch in ThermoRawFile.cpp.

- CMakeLists.txt: flip ENABLE_THERMO_RAW_TESTS default to OFF to match the
  ENABLE_OPENTIMS_TESTS pattern (opt-in for integration data downloads). Pin
  FetchContent URL to a specific PNNL commit and verify with URL_HASH SHA256.
- ThermoRawFile_test.cpp: replace the MS1-only-gated round-trip with concrete
  assertions on MS1+MSn presence, positive polarity, precursor m/z preservation
  through mzML, and at least one activation method seen on the MS2 spectra.
- doc/doxygen/install/common-cmake-parameters.doxygen: update ENABLE_THERMO_RAW_TESTS
  default note.

https://claude.ai/code/session_016q1fcq679fQJ2EMRSCxNQY
The bridge calls `dotnet publish` for ThermoWrapperManaged.csproj and
FindDotNetHost.cmake needs `nethost.h`/`libnethost` from the
Microsoft.NETCore.App.Host.osx-arm64 SDK pack. macOS runners do not
ship a .NET SDK by default, so configure fails with
`DotNetHost_INCLUDE_DIR/DotNetHost_LIBRARY` missing.

Add an `actions/setup-dotnet@v4` step pinned to 8.0.x (matching the
managed wrapper's net8.0 target) in:
- .github/actions/dependencies/action.yml (covers macOS xcode CI)
- .github/workflows/pyopenms-wheels-cibuildwheel.yml (covers wheel
  build-wheels-macos job)

setup-dotnet exports `DOTNET_ROOT`, which FindDotNetHost.cmake picks
up to locate the host pack.

Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
Temporarily disable the openms-thermo-bridge linkage on macOS to
isolate whether it is the cause of BrukerTimsFile_test failing on
macOS xcode CI (issue #9392).

Hypothesis: linking the bridge into libOpenMS.dylib introduces an
RTTI/visibility mismatch so that catch(const std::exception&) in
openTimsDataHandle() no longer matches std::exception subclasses
thrown from inside opentims's static lib.

Predicted outcome with this patch: BrukerTimsFile_test passes on
macOS again. If so, the bridge linkage is confirmed as the cause
and the fix lives in cmake_findExternalLibs.cmake (visibility /
libc++ ABI flags for the bridge). This PR is for validation only
and will be reverted regardless of outcome.

Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
@OpenMS OpenMS deleted a comment from github-actions Bot May 21, 2026
@timosachsenberg

Copy link
Copy Markdown
Contributor Author

Validation complete; see #9392 (comment)* — hypothesis confirmed. Closing.

@timosachsenberg
timosachsenberg deleted the validate/disable-thermo-raw-macos branch May 21, 2026 06:41
timosachsenberg added a commit that referenced this pull request May 21, 2026
Issue #9392: BrukerTimsFile_test fails on macOS xcode when the bridge is
linked into libOpenMS.dylib — catch(const std::exception&) inside
openTimsDataHandle() fails to match std::exception subclasses thrown
from opentims's static lib, leaking out as "No such file or directory".
Validation in PR #9393 confirmed the bridge linkage is the trigger.

Working theory: hidden-by-default C++ visibility (inherited from
OpenMS's global CMAKE_CXX_VISIBILITY_PRESET=hidden) causes the bridge's
template-instantiated typeinfo (std::exception and its derived chain)
to land in libOpenMS.dylib as symbols that don't deduplicate with
opentims's copies inside the same DSO.

Override the bridge's CXX_VISIBILITY_PRESET to `default` and disable
VISIBILITY_INLINES_HIDDEN, mirroring the pattern already in place for
HiGHS in this file. If this resolves test #143 on macOS xcode, the
hypothesis is confirmed and #9392 can be closed.

Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
poshul pushed a commit that referenced this pull request May 23, 2026
#9389)

* [FEATURE] Add Thermo RAW file reading support via openms-thermo-bridge

Integrates github.com/jpfeuffer/openms-thermo-bridge using CMake FetchContent
to enable native reading of Thermo RAW files into MSExperiment.

- Add WITH_THERMO_RAW CMake option (OFF by default)
- FetchContent openms-thermo-bridge from GitHub
- Create ThermoRawFile class (header + implementation)
- Register in FileHandler, FileTypes, and FORMAT sources
- Handle runtime file deployment for managed .NET bridge DLLs
- Add test data download option (ENABLE_THERMO_RAW_TESTS)

Agent-Logs-Url: https://github.com/OpenMS/OpenMS/sessions/0baa4939-e841-4551-84a6-7d773b80aa2c

Co-authored-by: jpfeuffer <[email protected]>

* [FIX] Address code review feedback for ThermoRawFile

- Remove unnecessary DataProcessing clear for centroid scans
- Add comment explaining HCD -> BEAM mapping
- Add warning log for unknown activation types
- Fix FetchContent SOURCE_DIR variable name typo

Agent-Logs-Url: https://github.com/OpenMS/OpenMS/sessions/0baa4939-e841-4551-84a6-7d773b80aa2c

Co-authored-by: jpfeuffer <[email protected]>

* [FIX] Address all review comments and CI test failure for ThermoRawFile PR #9234

Agent-Logs-Url: https://github.com/OpenMS/OpenMS/sessions/e6dab72b-f13f-424e-92be-0d717181976e

Co-authored-by: jpfeuffer <[email protected]>

* Apply suggestion from @jpfeuffer

* How about actually testing it you dumb bot

Co-authored-by: Julianus Pfeuffer <[email protected]>

* [FIX] Register openms_thermo_bridge in CMake export set to fix configure error

Agent-Logs-Url: https://github.com/OpenMS/OpenMS/sessions/471cbc5e-7543-45ba-9854-38e6ff19f0d2

Co-authored-by: jpfeuffer <[email protected]>

* [FIX] Fix ThermoRawFile.cpp compile errors: namespace and scoped enum usage

Agent-Logs-Url: https://github.com/OpenMS/OpenMS/sessions/35b731ed-b44d-42db-9395-038533cc196f

Co-authored-by: jpfeuffer <[email protected]>

* [FIX] Force openms_thermo_bridge to build as static library to fix TOPP linker errors

Agent-Logs-Url: https://github.com/OpenMS/OpenMS/sessions/567f4a37-f528-4846-a93e-0eed64bc36b1

Co-authored-by: jpfeuffer <[email protected]>

* [FIX] Make openms_thermo_bridge fully internal — remove install/export targets

Agent-Logs-Url: https://github.com/OpenMS/OpenMS/sessions/903d2303-d6d8-42aa-a8af-8cd43154dfea

Co-authored-by: jpfeuffer <[email protected]>

* [FIX] Compile openms_thermo_bridge with -fPIC for shared library linking

Agent-Logs-Url: https://github.com/OpenMS/OpenMS/sessions/2d4cb206-3214-4ed2-b80f-74b4e277ccec

Co-authored-by: jpfeuffer <[email protected]>

* disable bridge tests, add class test, disable on macos

* fix(ThermoRawFile_test): MS2-conditional precursor check + Windows runtime copy + macOS arm64 stub

- Test: gate the precursor round-trip assertion on the test data actually
  containing MSn spectra. The bundled ginkgotoxin RAW is MS1-only, so the
  unconditional TEST_EQUAL(found_msn_precursor, true) was failing on
  Linux/Windows. Emit STATUS log when no MSn present so the gap is visible.
- CMake: copy the managed bridge runtime files (ThermoWrapperManaged.dll +
  .runtimeconfig.json) next to ThermoRawFile_test.exe via a POST_BUILD
  step. The bridge searches exe_dir/managed first; on Windows the test
  binary lives in src/tests/class_tests/bin which is a different directory
  from libOpenMS.dll, so the OpenMS-target copy was not visible at runtime.
- Test: provide a placeholder main() when WITH_THERMO_RAW is OFF so the
  test target still links on platforms where the bridge is disabled (macOS
  arm64 default). The empty TU previously caused "Undefined symbols: _main".

Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>

* ci(wheels): disable WITH_THERMO_RAW in pyOpenMS wheel builds

The cibuildwheel manylinux containers and Windows/macOS wheel builders do
not have the .NET SDK pre-installed, so the FetchContent step for
openms-thermo-bridge fails with:

  Could not find DOTNET_EXECUTABLE using the following names: dotnet

Pass -DWITH_THERMO_RAW=OFF in all four wheel cmake invocations (Linux x64,
Linux arm64, macOS arm64, Windows). The wheels stay portable; users who
need Thermo RAW support can build OpenMS from source with the bridge
enabled.

Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>

* fix(cmake): default WITH_THERMO_RAW=OFF on Linux arm64/aarch64 too

Thermo's RawFileReader does not ship native dependencies for arm64 on
either macOS or Linux. The bridge configures and builds (it is just
managed .NET), but at runtime the C# code throws a managed exception
when it tries to open a RAW file because the underlying native helpers
aren't present. CI confirmed: ubuntu-24.04-arm fails ThermoRawFile_test
with "Failed to open RAW file (code -2)" (managed exception).

Extend the existing macOS arm64 default-off to also cover Linux arm64
and update the warning/status message accordingly.

Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>

* [DOC] Add WITH_THERMO_RAW + ENABLE_THERMO_RAW_TESTS to cmake params docs, note dotnet runtime requirement

Agent-Logs-Url: https://github.com/OpenMS/OpenMS/sessions/9832bbed-ddc6-48f5-a7f3-ecc197b880a8

Co-authored-by: timosachsenberg <[email protected]>

* [FIX] Download and install Thermo RawFileReader license from upstream repo at cmake install phase

Agent-Logs-Url: https://github.com/OpenMS/OpenMS/sessions/58dfa2f7-ca3a-497c-98fd-c5b6ad8c473d

Co-authored-by: jpfeuffer <[email protected]>

* [BUILD,CI] bump openms-thermo-bridge to v0.2.0; enable macOS arm64

v0.2.0 ships native osx-arm64 managed runtime assets, so the
arm64/Apple workarounds added earlier in this branch are no longer
needed.

Changes:
- cmake/cmake_findExternalLibs.cmake: pin GIT_TAG to v0.2.0
- CMakeLists.txt: narrow the arm64 default-OFF guard to Linux aarch64
  only (macOS arm64 is now fully supported); update messages
- .github/workflows/pyopenms-wheels-cibuildwheel.yml: remove
  -DWITH_THERMO_RAW=OFF from the macOS arm64 wheel build job
- ThermoRawFile_test.cpp: update comment to reflect that only Linux
  aarch64 still defaults to OFF

* test(ThermoRawFile): switch test data to PNNL Angiotensin_AllScans.raw, gate behind ENABLE_THERMO_RAW_TESTS (opt-in)

The previous ginkgotoxin sample was MS1-only, leaving the MS2 precursor
round-trip assertion silently skipped. Angiotensin_AllScans.raw (BSD-2-Clause,
Battelle 2018) has 87 MS1 (FTMS Full ms) plus hundreds of MS2 scans with HCD
and supplemental-activation (ETD+HCD, ETD+CID) filters at precursor m/z 432.9,
exercising the activation-method switch in ThermoRawFile.cpp.

- CMakeLists.txt: flip ENABLE_THERMO_RAW_TESTS default to OFF to match the
  ENABLE_OPENTIMS_TESTS pattern (opt-in for integration data downloads). Pin
  FetchContent URL to a specific PNNL commit and verify with URL_HASH SHA256.
- ThermoRawFile_test.cpp: replace the MS1-only-gated round-trip with concrete
  assertions on MS1+MSn presence, positive polarity, precursor m/z preservation
  through mzML, and at least one activation method seen on the MS2 spectra.
- doc/doxygen/install/common-cmake-parameters.doxygen: update ENABLE_THERMO_RAW_TESTS
  default note.

https://claude.ai/code/session_016q1fcq679fQJ2EMRSCxNQY

* ci(macOS): install .NET 8 SDK for OpenMSThermoBridge build

The bridge calls `dotnet publish` for ThermoWrapperManaged.csproj and
FindDotNetHost.cmake needs `nethost.h`/`libnethost` from the
Microsoft.NETCore.App.Host.osx-arm64 SDK pack. macOS runners do not
ship a .NET SDK by default, so configure fails with
`DotNetHost_INCLUDE_DIR/DotNetHost_LIBRARY` missing.

Add an `actions/setup-dotnet@v4` step pinned to 8.0.x (matching the
managed wrapper's net8.0 target) in:
- .github/actions/dependencies/action.yml (covers macOS xcode CI)
- .github/workflows/pyopenms-wheels-cibuildwheel.yml (covers wheel
  build-wheels-macos job)

setup-dotnet exports `DOTNET_ROOT`, which FindDotNetHost.cmake picks
up to locate the host pack.

Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>

* ci(macOS): default visibility on openms_thermo_bridge target (try #9392)

Issue #9392: BrukerTimsFile_test fails on macOS xcode when the bridge is
linked into libOpenMS.dylib — catch(const std::exception&) inside
openTimsDataHandle() fails to match std::exception subclasses thrown
from opentims's static lib, leaking out as "No such file or directory".
Validation in PR #9393 confirmed the bridge linkage is the trigger.

Working theory: hidden-by-default C++ visibility (inherited from
OpenMS's global CMAKE_CXX_VISIBILITY_PRESET=hidden) causes the bridge's
template-instantiated typeinfo (std::exception and its derived chain)
to land in libOpenMS.dylib as symbols that don't deduplicate with
opentims's copies inside the same DSO.

Override the bridge's CXX_VISIBILITY_PRESET to `default` and disable
VISIBILITY_INLINES_HIDDEN, mirroring the pattern already in place for
HiGHS in this file. If this resolves test #143 on macOS xcode, the
hypothesis is confirmed and #9392 can be closed.

Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>

* Revert "ci(macOS): default visibility on openms_thermo_bridge target (try #9392)"

This reverts commit 46f2478.

* [DIAGNOSTIC #9392] surface throw site in openTimsDataHandle

Visibility tweak in 46f2478 (reverted in 9faac9d) didn't move
the BrukerTimsFile_test failure, so the working theory of cross-DSO
typeinfo divergence is wrong, or at least the simple visibility
override doesn't reach the affected translation units.

Before iterating more CMake guesses, gather evidence: print to stderr
on every path through openTimsDataHandle so the next macOS xcode log
tells us whether the throw is

  (a) inside the TimsDataHandle constructor's try-block but a
      typeinfo mismatch makes catch(const std::exception&) miss it
      — the catch(...) here will fire and print the mangled type;
  (b) past the constructor entirely (lazy validation) — the
      "ctor returned OK" marker will print and the test failure
      is coming from a downstream call (isDIA_/loadDDA_/...).

Different fixes apply in each case, so an empirical one-shot is
worth one ~25-min CI cycle. Revert this commit (or both diagnostic
commits) once the answer lands in #9392.

Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>

* [DIAGNOSTIC #9392] print typeinfo addresses + rethrow-as-exception probe

Prior diag showed openTimsDataHandle catch(const std::exception&)
fails to match a real std::__1::system_error throw, but
catch(...) does. The mangled name string is the canonical libc++
one, so this isn't a stdlib-mismatch by name. Two real possibilities
remain:

  (a) Multiple non-coalesced copies of typeinfo for std::exception
      (and chain) inside libOpenMS.dylib — once the bridge is linked,
      hidden-visibility weak symbols don't merge across object files
      with Apple's ld64.
  (b) Something else entirely (linker quirk, libnethost dylib
      shadowing, etc.).

This commit prints, from BrukerTimsFile.cpp's translation unit:
  - the thrown exception's typeinfo pointer
  - &typeid(std::exception/runtime_error/system_error) addresses
  - pointer-equality and name-equality checks against the thrown type
  - the result of std::rethrow_exception caught by std::exception&

If thrown_ti pointer != &typeid(std::system_error) but their .name()
strings match -> (a) confirmed: two typeinfo copies in the same DSO.
If they're pointer-equal but the outer catch still failed -> something
weirder is going on and we need a new theory.

Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>

* fix(diag): guard #9392 cxxabi diagnostic behind !defined(_MSC_VER)

Previous diagnostic commit unconditionally included <cxxabi.h>, which
MSVC doesn't ship -> Windows build broke with C1083. The bug only
reproduces on macOS anyway, so gate the include + diagnostic block
behind a non-MSVC check.

Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>

* [DIAGNOSTIC #9392] walk thrown_ti's __si/__vmi base chain

Previous diag showed std::system_error typeinfo address matches
between throw and catch sites, but catch(const std::exception&)
still fails. The next address we need is what  (the
typeinfo pointer for runtime_error stored inside system_error's
typeinfo) actually points at -- which copy of std::runtime_error
the throw was bound to.

If __base_type address != local typeid(std::runtime_error) address,
the typeinfo objects live in different dylibs (libc++abi vs.
libc++ or libnethost-shadowed) and that's the explicit divergence
that breaks the catch chain walk.

Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>

* fix(diag): replace abi::__si_class_type_info walk with progressive catch probes

Apple libcxxabi <cxxabi.h> does not publicly expose __si_class_type_info /
__vmi_class_type_info, so 4f91e3c broke the macOS build. Replace the
chain walk with three rethrow-and-catch probes (system_error, runtime_error,
exception) that pin the break point in the typeinfo chain without needing
ABI internals.

Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>

* fix(BrukerTimsFile): widen openTimsDataHandle catch to runtime_error (#9392)

On macOS xcode with WITH_THERMO_RAW=ON, BrukerTimsFile_test line 115
(TEST_EXCEPTION(Exception::FileNotReadable, f.load("/nonexistent/path.d",
exp))) reported "wrong exception thrown! No such file or directory":

  openTimsDataHandle's catch(const std::exception&) was failing to match
  the std::__1::system_error opentims actually throws.

Diagnosis (see #9392 for the full measurement log):
- typeid(std::system_error) / std::runtime_error addresses in
  BrukerTimsFile.cpp match the thrown exception's chain exactly.
- typeid(std::exception) address does NOT match the address that
  runtime_error's base_type field stores inside the thrown chain.
- catch(std::system_error)  matches the throw    -> chain OK there
  catch(std::runtime_error) matches the throw    -> chain OK there
  catch(std::exception)     does NOT match       -> chain breaks here.

Cause: linking openms-thermo-bridge into libOpenMS.dylib introduces a
second copy of typeinfo for std::exception inside libOpenMS.dylib that
doesn't coalesce with the one libc++abi.dylib exports. Without the
bridge (e.g., on develop, or with WITH_THERMO_RAW=OFF), only libc++abi's
copy is reachable and the catch works. A deeper linker-side fix
(un-exporting the embedded _ZTISt9exception so the references collapse)
is left for #9392.

Fix: catch the runtime_error layer of the chain explicitly, ahead of
the broader std::exception arm. That layer still has typeinfo identity
across the bridge boundary (proven by the catch probe). The
std::exception arm is kept for non-runtime_error subclasses on other
platforms; the catch(...) arm is the last-resort fallback.

This is type-safe defensive code, not a catch-all -- e.what() is
preserved in the messages on the typed arms.

Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>

* fix(cmake): update OpenMSThermoBridge to v0.2.1 and adjust build settings for shared library compatibility

fix(BrukerTimsFile): remove redundant runtime_error catch to resolve typeinfo duplication issue on macOS

fix(ThermoRawFile): update polarity and activation type handling for improved compatibility with Thermo data

* fix(cmake): update OpenMSThermoBridge to v0.2.3 and enhance installation comments

* [DOC] Update WITH_THERMO_RAW platform support text

Agent-Logs-Url: https://github.com/OpenMS/OpenMS/sessions/729c1d73-be17-4acd-b06a-2ea769ad3e27

Co-authored-by: timosachsenberg <[email protected]>

---------

Co-authored-by: copilot-swe-agent[bot] <[email protected]>
Co-authored-by: jpfeuffer <[email protected]>
Co-authored-by: Claude Opus 4.7 (1M context) <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants