From da9cec66d30c729f28b540916fbbc493eceeb0d1 Mon Sep 17 00:00:00 2001 From: ferdymercury Date: Wed, 14 Oct 2026 10:57:36 +0200 Subject: [PATCH] [cling] treat empty SDKROOT as unset Fixes https://github.com/root-project/root/issues/23712 Full credit goes to cxwx --- interpreter/cling/lib/Interpreter/CIFactory.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/interpreter/cling/lib/Interpreter/CIFactory.cpp b/interpreter/cling/lib/Interpreter/CIFactory.cpp index 03ad72cb3a4bc..fecd1c746df42 100644 --- a/interpreter/cling/lib/Interpreter/CIFactory.cpp +++ b/interpreter/cling/lib/Interpreter/CIFactory.cpp @@ -380,7 +380,8 @@ namespace { if(arvIt != args.end() && ++arvIt != args.end()) cling_osx_sysroot_directory = *arvIt; if (!llvm::sys::fs::exists(cling_osx_sysroot_directory)) { - if (!::getenv("SDKROOT")) { + auto env = std::getenv("SDKROOT"); + if (!env || !*env) { std::array buffer; const auto xcrun_cmd = "xcrun --show-sdk-path"; std::unique_ptr pipe(