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

Solcjs can't write output on Windows machines due to path separators #365

Closed
0x-r4bbit opened this issue Jun 5, 2019 · 1 comment · Fixed by #367
Closed

Solcjs can't write output on Windows machines due to path separators #365

0x-r4bbit opened this issue Jun 5, 2019 · 1 comment · Fixed by #367

Comments

@0x-r4bbit
Copy link
Contributor

Looks like there's a bug in Solcjs with regards to how it handles the file names of output files generated by solc.

Here's what's happening:

Assuming we run solcjs cli like this on Linux/Mac:

$ solcjs --abi --bin -o some-folder path/to/file.sol

It'll generate:

some-folder/path_to_file_ContractName.abi
some-folder/path_to_file_ContractName.bin

Notice how slashes are replaced with underscores.

On windows however, often backslashes are used so the same command looks like this:

$ solcjs --abi --bin -o some-folder path\to\file.sol

However, writing the output fails because it doesn't replace backslashes with underscores. This is what it tries to write:

some-folder\path\to\file_ContractName.abi
some-folder\path\to\file_ContractName.bin

This won't work because path\fo\ doesn't exist inside some-folder.

I tested this with solc (instead of solcjs) and can confirm that it behaves correctly on Windows (replaces backslashes as expected).

I'm happy to look into this if this is fixable. I thought solcjs is only wrapping solc but maybe it does more to it.

Any ideas, pointers?

@0x-r4bbit
Copy link
Contributor Author

Hi, just wanted to follow-up and ask if anyone can give me direction to help fixing this.

0x-r4bbit added a commit to 0x-r4bbit/solc-js that referenced this issue Jun 10, 2019
0x-r4bbit added a commit to 0x-r4bbit/vibranium that referenced this issue Jun 10, 2019
Due to differences between solc and solcjs in their generated output
on Windows machines (ethereum/solc-js#365),
compilation will always break because solcjs doesn't handle output
paths correctly.

A fix for this has been proposed here ethereum/solc-js#367,
once that is merged, we can roll back to solcjs again.
0x-r4bbit added a commit to 0x-r4bbit/vibranium that referenced this issue Jun 10, 2019
Due to differences between solc and solcjs in their generated output
on Windows machines (ethereum/solc-js#365),
compilation will always break because solcjs doesn't handle output
paths correctly.

A fix for this has been proposed here ethereum/solc-js#367,
once that is merged, we can roll back to solcjs again.
0x-r4bbit added a commit to 0x-r4bbit/vibranium that referenced this issue Jun 10, 2019
Due to differences between solc and solcjs in their generated output
on Windows machines (ethereum/solc-js#365),
compilation will always break because solcjs doesn't handle output
paths correctly.

A fix for this has been proposed here ethereum/solc-js#367,
once that is merged, we can roll back to solcjs again.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant