Repository navigation
Replies: 1 comment
|
The patch for this report is available on a fork, because pull requests are disabled for this repository:
Contents:
Evidence: End-to-end against a packaged build: before the change the worker spawn exits with code 0 in under a second with empty stdout/stderr; with the entry supplied, a full PTC run returns its program result. The one remaining failure under an Electron-as-node host is the fixture whose program spawns |
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Summary
On a packaged Desktop build (0.1.6-alpha.1), every
run_codecall in theptcpreset fails immediately with:The call fails in well under a second with empty stdout/stderr, so no tool can be used in PTC sessions. Restarting the application does not help.
Environment
ptc, file policydanger-full-accessfeat(desktop): run runtime host from asarCause
Three facts combine:
apps/desktop/src/main.tsusesprocess.execPathas the Host executable, andapps/desktop/src/host-process.tslaunches it withELECTRON_RUN_AS_NODE=1. Inside that Host,process.execPathis therefore the Electron application binary.packages/ptc-runtime/ptc-runtime-node/src/index.tsresolves its default worker executable fromprocess.execPathand builds the worker environment by clearing inherited names, which removesELECTRON_RUN_AS_NODE.worker-exit.Local verification supporting the cause:
ELECTRON_RUN_AS_NODEexits with code 0 in under a second with empty stdout and stderr — exactly the reported failure.ELECTRON_RUN_AS_NODE=1boots the worker (it reaches the control-channel handshake), so the worker itself is fine.Suggested fix
Keep the worker in Node mode when the resolved executable is the current Electron binary, next to the existing executable/bootstrap selection:
and merge it into the worker environment in
run(). Local verification after this change: an end-to-end PTC run against a packaged build returns the program result, the package suite passes on plain Node, and it passes under an Electron-as-node Host except for one fixture whose program spawnsprocess.execPathitself (that case still starts the application, because the program-visible environment is empty by design).All reactions