Skip to content
This repository has been archived by the owner on Jan 24, 2022. It is now read-only.

Use posix.relative() instead of path.relative() #1559

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

yurenju
Copy link

@yurenju yurenju commented Jun 20, 2020

fixed #1558

in solc-js, file path is used as key to manage dependencies, the contract body is retrieved via file path, so if: import "./Contract2.sol"; appears, solc-js will use "./Contract2.sol" to lookup the body of contract which need to be place into it.

but when we use path.relative() to handle file path, it will transform from "./Contract2.sol" to ".\Contract2.sol" then solc-js cannot find correct contract body, finally throw "File import callback not supported".

so path.posix.relative() should be used in this case to ensure file path follows POSIX rule for a key to index contract body.

in solc-js, file path is used as key to manage dependencies, the
contract body is retrieved via file path, so if:
`import "./Contract2.sol";` appears, solc-js will use "./Contract2.sol"
to lookup the body of contract which need to be place into it.

but when we use path.relative() to handle file path, it will transform
from "./Contract2.sol" to ".\Contract2.sol" then solc-js cannot find
correct contract body, finally throw "File import callback not supported"

so path.posix.relative() should be used in this case to ensure file path
follows POSIX rule for a key to index contract body.
@FrozenKiwi
Copy link

bump?

@abcoathup
Copy link
Contributor

Hi @FrozenKiwi,

We’ve decided it’s best to focus our upgradeability efforts on the Upgrades Plugins exclusively, and have halted development on the OpenZeppelin CLI.

See: https://forum.openzeppelin.com/t/building-for-interoperability-why-we-re-focusing-on-upgrades-plugins/4088

I recommend using OpenZeppelin Upgrades Plugins: https://docs.openzeppelin.com/upgrades-plugins/1.x/

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

relatively import path does not work on Windows without WSL
3 participants