You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
As I see it, the problem here is not that execPath needs to point to lsc; it's that lsc shouldn't be messing around with process.argv. If I remove the code from command.ls and node.ls that does so, this example works fine, and I bet the shelljs functionality fixed in #562 also continues to work.
The node.ls behavior was introduced in commit 9090c59, way back in the coco days. The motivation stated in that commit was to make relative require work with --eval and --stdin. Removing the process.argv assignment from that code doesn't seem to break relative require with --eval or --stdin when I tested it.
The command.ls behavior was introduced in response to #569, in commit c959444. This is partly a case of piling a hack on top of the previous hack, and partly a case of asking for the wrong thing: the reporter asked for [ 'node', '/home/derk/test.ls', 'hello' ] but should have asked for [ 'node', 'lsc', '/home/derk/test.ls', 'hello' ] (or [ 'lsc', '/home/derk/test.ls', 'hello' ], but we know thanks to #562 that this has undesirable effects).
Basically, I think both of those hacks should be removed and process.argv should be left as node intended.
Activity
bumxu commentedon Jul 31, 2016
This has been introduced by #562.
process.execPathnow points to Node, so fork is executed as JS.I can't think a clear solution, sometimes we need
execPathpointingnode, sometimes pointinglsc.😲
rhendric commentedon Mar 29, 2017
As I see it, the problem here is not that
execPathneeds to point to lsc; it's that lsc shouldn't be messing around withprocess.argv. If I remove the code from command.ls and node.ls that does so, this example works fine, and I bet the shelljs functionality fixed in #562 also continues to work.The node.ls behavior was introduced in commit 9090c59, way back in the coco days. The motivation stated in that commit was to make relative
requirework with--evaland--stdin. Removing theprocess.argvassignment from that code doesn't seem to break relativerequirewith--evalor--stdinwhen I tested it.The command.ls behavior was introduced in response to #569, in commit c959444. This is partly a case of piling a hack on top of the previous hack, and partly a case of asking for the wrong thing: the reporter asked for
[ 'node', '/home/derk/test.ls', 'hello' ]but should have asked for[ 'node', 'lsc', '/home/derk/test.ls', 'hello' ](or[ 'lsc', '/home/derk/test.ls', 'hello' ], but we know thanks to #562 that this has undesirable effects).Basically, I think both of those hacks should be removed and
process.argvshould be left as node intended.remove process.argv mutation
remove process.argv mutation