ci: fix windows tests with .exe suffix #111
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
What ❔
Fixes Windows tests with optional .exe suffix.
Why ❔
On Windows, executables should always have
.exe
extension.On the other hand,
process::Command
in Rust can work it out, and.exe
can be skipped in the filename if the file has no other extension (or it looks like even a suffix we use with-
). There are lots of weirdness internally explained in rust-lang/rust#37519.As the result, the following initialization code:
will work correctly if executable name is
solc
orsolc.exe
on Windows, but will not be able to find an executable (even if it's inPATH
) if the executable name issolc-*
(e.g.solc-0.8.26
cannot be found). Onlysolc-0.8.26.exe
can be found correctly on Windows by Command.There is more info in the Command docs:
This PR optionally adds
.exe
suffix on Windows for tests, but does not change behavior on other platforms where we pass justsolc
which is fine for all cases.Checklist
cargo fmt
and checked withcargo clippy
.