echidna icon indicating copy to clipboard operation
echidna copied to clipboard

chore: fix subprocess silence logic in compiler selection

Open mdqst opened this issue 2 months ago • 1 comments

noticed a small issue in how we were setting silent for the compiler subprocess. previously it used a combination of and/or which can lead to unexpected results.

changed it to a clear ternary expression:

silent = subprocess.DEVNULL if os.getenv("SOLC_SELECT_SILENT", "1") == "1" else None

now the behavior is straightforward and consistent.

mdqst avatar Oct 01 '25 07:10 mdqst

hi! out of curiosity, what prompted this change? do you use this script somewhere? and what issues did you see? (I'm not sure how the and/or pseudo-ternary could fail here, but I agree the if/else is clearer)

I'm mainly asking as we only copy this script to the distroless docker target, and that is not a docker target we ever built on CI or people use. I've thought about removing it altogether.

elopez avatar Nov 10 '25 21:11 elopez