Skip to content

"Impossible:" errors whenever a command to be run doesn't exist #65

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
Hi-Angel opened this issue Mar 21, 2025 · 1 comment · Fixed by #66
Closed

"Impossible:" errors whenever a command to be run doesn't exist #65

Hi-Angel opened this issue Mar 21, 2025 · 1 comment · Fixed by #66

Comments

@Hi-Angel
Copy link
Contributor

Hi-Angel commented Mar 21, 2025

In practice I see quite often an error:

Impossible: `spawnSync` child process neither exited nor was killed.

Looks quite possible… Further digging shows that this is due ChildProcess logic not accounting for both status and signal to be null for valid reasons (which may also be some system error, not just "command not found").

Steps to reproduce

Execute this code:

module Main where

import Prelude

import Effect (Effect)
import Effect.Console (logShow)
import Node.ChildProcess (spawnSync') as Proc

main :: Effect Unit
main = do
  ret <- Proc.spawnSync' "non-existing-cmd" [] identity
  logShow ret.error

Expected

(Just Error: spawnSync non-existing-cmd ENOENT)

Actual

A crash with Impossible: spawnSync child process neither exited nor was killed.

Hi-Angel added a commit to Hi-Angel/purescript-node-child-process that referenced this issue Mar 21, 2025
When a non-existing command is attempted to run, both status and
signal will be null, which leads to ChildProcess module crashing.
Obviously, this is incorrect behavior.

The problem is more general than that though: any system error that
would result in failing to run a process would result in the module
crash.

Fix that by checking for such case.

Fixes: purescript-node#65
Hi-Angel added a commit to Hi-Angel/purescript-node-child-process that referenced this issue Mar 21, 2025
When a non-existing command is attempted to run, both status and
signal will be null, which leads to ChildProcess module crashing.
Obviously, this is incorrect behavior.

The problem is more general than that though: any system error that
would result in failing to run a process would result in the module
crash.

Fix that by checking for such case.

Fixes: purescript-node#65
Hi-Angel added a commit to Hi-Angel/purescript-node-child-process that referenced this issue Mar 21, 2025
When a non-existing command is attempted to run, both status and
signal will be null, which leads to ChildProcess module crashing.
Obviously, this is incorrect behavior.

The problem is more general than that though: any system error that
would result in failing to run a process would result in the module
crash.

Fix that by checking for such case.

Fixes: purescript-node#65
@Hi-Angel
Copy link
Contributor Author

Sent a PR to fix that.

Hi-Angel added a commit to Hi-Angel/purescript-node-child-process that referenced this issue Mar 21, 2025
When a non-existing command is attempted to run, both status and
signal will be null, which leads to ChildProcess module crashing.
Obviously, this is incorrect behavior.

The problem is more general than that though: any system error that
would result in failing to run a process would result in the module
crash.

Fix that by checking for such case.

Fixes: purescript-node#65
Hi-Angel added a commit to Hi-Angel/purescript-node-child-process that referenced this issue Mar 21, 2025
When a non-existing command is attempted to run, both status and
signal will be null, which leads to ChildProcess module crashing.
Obviously, this is incorrect behavior.

The problem is more general than that though: any system error that
would result in failing to run a process would result in the module
crash.

Fix that by checking for such case.

Fixes: purescript-node#65
Hi-Angel added a commit to Hi-Angel/purescript-node-child-process that referenced this issue Mar 22, 2025
When a non-existing command is attempted to run, both status and
signal will be null, which leads to ChildProcess module crashing.
Obviously, this is incorrect behavior.

The problem is more general than that though: any system error that
would result in failing to run a process would result in the module
crash.

Fix that by checking for such case.

Fixes: purescript-node#65
Hi-Angel added a commit to Hi-Angel/purescript-node-child-process that referenced this issue Mar 22, 2025
When a non-existing command is attempted to run, both status and
signal will be null, which leads to ChildProcess module crashing.
Obviously, this is incorrect behavior.

The problem is more general than that though: any system error that
would result in failing to run a process would result in the module
crash.

Fix that by checking for such case.

Fixes: purescript-node#65
Hi-Angel added a commit to Hi-Angel/purescript-node-child-process that referenced this issue Mar 22, 2025
When a non-existing command is attempted to run, both status and
signal will be null, which leads to ChildProcess module crashing.
Obviously, this is incorrect behavior.

The problem is more general than that though: any system error that
would result in failing to run a process would result in the module
crash.

Fix that by checking for such case.

Fixes: purescript-node#65
@garyb garyb closed this as completed in #66 Mar 22, 2025
@garyb garyb closed this as completed in a836ddd Mar 22, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
1 participant