crytic / crytic-compile

Abstraction layer for smart contract build systems
GNU Affero General Public License v3.0
148 stars 85 forks source link

Console prompts hang test framework invocation #564

Open Xenomega opened 2 months ago

Xenomega commented 2 months ago

When installing crytic-compile on a new machine with hardhat, then attempting to compile a codebase, crytic-compile executes a command, and captures its output to reflect after the command finishes executing. The problem with this is, on first use of hardhat, you will get a stdin prompt asking you to confirm some settings:

xenomega@ubuntu:~/github/audit-treehouse-contracts$ npx hardhat compile

✔ Help us improve Hardhat with anonymous crash reports & basic usage data? (Y/n) · 

This will result in crytic-compile waiting for the command to end, but it will not end until the prompt is answered, but stdin/stdout is not forwarded during execution, meaning the user can't see or know there is a prompt to accept.

It's not a big deal in essence, you can run npx hardhat compile and see the prompt, answer it, and all future runs will work. But it might be worth forwarding stdin/stdout during execution so users don't hit this issue with any tools that have a prompt in the future.

jkoppel commented 1 month ago

Looks like I hit this too, and got thrown hard. https://empirehacking.slack.com/archives/C7KKY517H/p1721030884810249