File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -399,24 +399,31 @@ def _win_spawn_detached_compiler(debug):
399399 DETACHED_PROCESS = 0x00000008
400400 CREATE_NEW_PROCESS_GROUP = 0x00000200
401401
402+ import tempfile
403+ log_path = Path (tempfile .gettempdir ()) / "omnipkg_detached_compiler.log"
404+
402405 script = (
403- "import sys, time\n "
406+ "import sys, os, time\n "
407+ f"sys.path.insert(0, { str (Path (__file__ ).parent .parent .parent )!r} )\n "
408+ f"os.environ['OMNIPKG_DEBUG'] = '1'\n "
404409 "time.sleep(1.0)\n "
405410 "from omnipkg.dispatcher import _maybe_install_c_dispatcher\n "
406411 "_maybe_install_c_dispatcher()\n "
407412 )
408413
409414 try :
415+ log_fh = open (log_path , "w" , encoding = "utf-8" )
410416 proc = subprocess .Popen (
411417 [sys .executable , "-c" , script ],
412418 creationflags = DETACHED_PROCESS | CREATE_NEW_PROCESS_GROUP ,
413419 close_fds = True ,
414- stdout = subprocess . DEVNULL ,
415- stderr = subprocess . DEVNULL ,
420+ stdout = log_fh ,
421+ stderr = log_fh ,
416422 )
423+ log_fh .close ()
417424 print (
418425 f"[C-INSTALL] Windows first-run: spawned detached compiler pid={ proc .pid } . "
419- f"_omnipkg_dispatch.exe will be ready on next invocation. " ,
426+ f"Log: { log_path } " ,
420427 file = sys .stderr ,
421428 )
422429 except OSError as e :
You can’t perform that action at this time.
0 commit comments