@@ -246,6 +246,40 @@ bool PythonWorker::init() {
246246 QString current_path = qgetenv (" PATH" );
247247 qputenv (" PATH" , (dlls_dir + " ;" + python_home + " ;" + app_dir + " ;" + current_path).toUtf8 ());
248248
249+ // Verbose diagnostics for debugging GHA failures
250+ std::cerr << " === Bundled Python DLL diagnostics ===\n " ;
251+ std::cerr << " app_dir: " << app_dir.toStdString () << " \n " ;
252+ std::cerr << " python_home: " << python_home.toStdString () << " \n " ;
253+ std::cerr << " DLLs dir: " << dlls_dir.toStdString () << " \n " ;
254+ std::cerr << " DLLs dir exists: " << QDir (dlls_dir).exists () << " \n " ;
255+ std::cerr << " python_home/Library/bin exists: " << QDir (python_home + " /Library/bin" ).exists () << " \n " ;
256+
257+ // Check critical files
258+ QStringList check_files = {
259+ python_home + " /python312.dll" ,
260+ python_home + " /python3.dll" ,
261+ python_home + " /DLLs/pyexpat.pyd" ,
262+ python_home + " /Library/bin/libexpat.dll" ,
263+ python_home + " /Lib/os.py" ,
264+ app_dir + " /python312.dll" ,
265+ app_dir + " /libexpat.dll" ,
266+ };
267+ for (const auto & f : check_files) {
268+ std::cerr << " " << f.toStdString () << " : " << (QFile::exists (f) ? " EXISTS" : " MISSING" ) << " \n " ;
269+ }
270+
271+ // List DLLs in app_dir matching python* or lib*
272+ QDir app_dir_obj (app_dir);
273+ QStringList dll_filters = {" python*.dll" , " lib*.dll" };
274+ auto dlls_in_app = app_dir_obj.entryList (dll_filters, QDir::Files);
275+ std::cerr << " DLLs in app_dir: " ;
276+ for (const auto & d : dlls_in_app) std::cerr << d.toStdString () << " " ;
277+ std::cerr << " \n " ;
278+
279+ std::cerr << " PATH (first 500 chars): " << qgetenv (" PATH" ).left (500 ).toStdString () << " \n " ;
280+ std::cerr << " === End diagnostics ===\n " ;
281+ std::cerr.flush ();
282+
249283 SW_LOG (" Registered bundled Python DLL directories" );
250284 } else {
251285 // Legacy conda-based Python path
@@ -284,7 +318,11 @@ bool PythonWorker::init() {
284318#endif // ifdef _WIN32
285319
286320 try {
321+ std::cerr << " === About to call py::initialize_interpreter() ===\n " ;
322+ std::cerr.flush ();
287323 py::initialize_interpreter ();
324+ std::cerr << " === py::initialize_interpreter() succeeded ===\n " ;
325+ std::cerr.flush ();
288326 interpreter_started_ = true ;
289327
290328 py::module sys = py::module::import (" sys" );
0 commit comments