From 0c80eebd2b9eb8b01d0d41696c500fb6915565d4 Mon Sep 17 00:00:00 2001 From: Mikhail Evstifeev <60695606+mievst@users.noreply.github.com> Date: Tue, 3 Nov 2026 01:16:20 +0300 Subject: [PATCH] Include only where backtrace() is used Utils.hpp included on every non-Android __unix__ target, but only print_backtrace() in Utils.cpp needs it, and only under USE_BACKTRACE. musl (Alpine Linux) does not provide the header, so the SDK failed to compile there. This also breaks ONNX Runtime builds on Alpine, which build the SDK by default since 1DS became their telemetry backend (microsoft/onnxruntime#33827). --- lib/utils/Utils.cpp | 4 ++++ lib/utils/Utils.hpp | 3 --- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/lib/utils/Utils.cpp b/lib/utils/Utils.cpp index 33b0fb221..3d29bbbc7 100644 --- a/lib/utils/Utils.cpp +++ b/lib/utils/Utils.cpp @@ -27,6 +27,10 @@ #include #endif +#if defined(USE_BACKTRACE) && defined(__unix__) +#include +#endif + #include #include diff --git a/lib/utils/Utils.hpp b/lib/utils/Utils.hpp index c87c56367..142241e24 100644 --- a/lib/utils/Utils.hpp +++ b/lib/utils/Utils.hpp @@ -33,9 +33,6 @@ namespace std #endif #ifdef __unix__ -#ifndef ANDROID -#include -#endif #include #include #endif