Tencent / puerts

PUER(普洱) Typescript. Let's write your game in UE or Unity with TypeScript.
Other
4.77k stars 682 forks source link

[unreal]LiveCoding会造成V8Inspector监听异常 #559

Open mysticfarer opened 2 years ago

mysticfarer commented 2 years ago

detail | 详细描述

勾选 Edit->Editor Preferences->Enable Live Coding 后, vscode/devtool会无法attach到8080调试端口。

原因

UnrealEditor以子进程形式创建LiveCodingConsole,并inherite了父进程中的listen fd, 导致父进程中V8Inspector无法close listen fd,进而导致重建时无法再次监听8080端口。

mysticfarer commented 2 years ago

影响不是很大,禁用Live Coding就能避免此问题; 但部分项目或引擎可能默认启用了Live Coding,造成TS无法调试,会对使用者带来困惑。

mysticfarer commented 2 years ago

对V8Inspector里的listen fd设置FD_CLOEXEC能直接解决此问题, 但拿到fd的相关代码封装有点深,未再深入跟进。

chexiongsheng commented 2 years ago

设置FD_CLOEXEC,window下也可以么?