Skip to content
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

Poor command not found error in lockfile generator #1084

Closed
kylewillmon opened this issue May 9, 2023 · 0 comments · Fixed by #1087
Closed

Poor command not found error in lockfile generator #1084

kylewillmon opened this issue May 9, 2023 · 0 comments · Fixed by #1087
Assignees
Labels
bug Something isn't working medium priority Should be handled as soon as possible

Comments

@kylewillmon
Copy link
Contributor

When the underlying command is not found, the error given is not great.

❯ phylum parse
Generating lockfile for manifest "/Users/maxrake/dev/delme/manifest_test/./pip/requirements.txt" using Pip…
❗ Error: failed to run command "cd \"/Users/maxrake/dev/delme/manifest_test/pip\" && \"pip-compile\" \"-o\" \"requirements-locked.txt\" \"/Users/maxrake/dev/delme/manifest_test/./pip/requirements.txt\"": No such file or directory (os error 2)

This has a few issues:

  1. The cd <dir> && is just noise that hides the actual issue
  2. All of the escaped quotes in the string are distracting

A better message could look something like this:

❯ phylum parse
Generating lockfile for manifest "/Users/maxrake/dev/delme/manifest_test/./pip/requirements.txt" using Pip…
❗ Error: failed to run command: "pip-compile" "-o" "requirements-locked.txt" "/Users/maxrake/dev/delme/manifest_test/./pip/requirements.txt"

Caused by:
  No such file or directory (os error 2)
@kylewillmon kylewillmon added bug Something isn't working needs triage Needs to be reviewed or assigned labels May 9, 2023
@cd-work cd-work self-assigned this May 9, 2023
cd-work added a commit that referenced this issue May 9, 2023
This patch changes the error generated during lockfile generation when
the ecosystem's package manager subprocess could not be spawned
successfully.

Instead of printing the full debug formatting of the command, just the
program and its argument are printed.

Closes #1084.
@kylewillmon kylewillmon added medium priority Should be handled as soon as possible and removed needs triage Needs to be reviewed or assigned labels May 9, 2023
cd-work added a commit that referenced this issue May 9, 2023
This patch changes the error generated during lockfile generation when
the ecosystem's package manager subprocess could not be spawned
successfully.

Instead of printing the full debug formatting of the command, just the
program is printed. This should prevent users from being confused by
irrelevant details in the error message.

Closes #1084.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working medium priority Should be handled as soon as possible
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants