OpenZeppelin / openzeppelin-sdk

OpenZeppelin SDK repository for CLI and upgrades.js. No longer actively developed.
MIT License
431 stars 200 forks source link

relatively import path does not work on Windows without WSL #1558

Open yurenju opened 4 years ago

yurenju commented 4 years ago

use relatively import on Windows without WSL does not work, for example: https://github.com/yurenju/oz-compile-failed-on-windows

Contract2.sol is imported via import "./Conntract2.sol" in Contract1.sol:

pragma solidity ^0.5.0;

import "./Contract2.sol";

contract Contract1 {
    uint256 public value;

    function increase() public {
      value++;
    }
}

but if run npm run compile on WIndows without WSL, it shows File import callback not supported

> oz compile
✖ Compiling contracts with solc 0.5.17 (commit.d19bba13)
Compilation errors: 
contracts\Contract1.sol:3:1: ParserError: Source "Contract2.sol" not found: File import callback not supported
import "./Contract2.sol";
^-----------------------^

I know you guys recommend developing smart contract on Windows with WSL on openzeppelin forum, but deploy contract on dev network via openzeppelin cli is not really stable in my experience, I usually need to reboot WSL to deploy contract if it complain connection refused.

so it would be great if we can have native windows support for openzeppelin cli without WSL and I actually found a solution, pull request is coming.

abcoathup commented 4 years ago

Hi @yurenju ! Thanks for the suggestion, it is really appreciated.

The project owner will review your suggestion as soon as they can.

We normally recommend to wait until we have discussed an idea before writing any code or submitting a Pull Request, so we can go through the design beforehand. We don’t want you to waste your time!

yurenju commented 4 years ago

@abcoathup thanks for reply! and no worry, I still can use that patch in a custom version of cli to solve my problem now which don't waste the time :D