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

contains invalid WIN32 path characters #1203

Closed
pcaversaccio opened this issue Jun 30, 2024 · 7 comments
Closed

contains invalid WIN32 path characters #1203

pcaversaccio opened this issue Jun 30, 2024 · 7 comments

Comments

@pcaversaccio
Copy link
Contributor

What happened?

When I pushed the upgrade to Vyper version 0.4.0 here pcaversaccio/zksync-vyper-sandbox@83b79c8, the compilation started to fail with:

Solidity 0.8.26 is not fully supported yet. You can still use Hardhat, but some features, like stack traces, might not work correctly.

Learn more at https://hardhat.org/hardhat-runner/docs/reference/solidity-support

No need to generate any newer typings.
Compiling contracts for zkSync Era with zkvyper v1.5.1 and vyper v0.4.0
An unexpected error occurred:

Error: C:\Dev\Blockchain\zksync-vyper-sandbox\artifacts-zk\C:\Dev\Blockchain\zksync-vyper-sandbox\contracts\vyper\Foo.vy contains invalid WIN32 path characters.
    at Object.mkdirs (C:\Dev\Blockchain\zksync-vyper-sandbox\node_modules\.pnpm\fs-extra@7.0.1\node_modules\fs-extra\lib\mkdirs\mkdirs.js:18:22)
    at C:\Dev\Blockchain\zksync-vyper-sandbox\node_modules\.pnpm\universalify@0.1.2\node_modules\universalify\index.js:13:12
    at new Promise (<anonymous>)
    at Object.mkdirs (C:\Dev\Blockchain\zksync-vyper-sandbox\node_modules\.pnpm\universalify@0.1.2\node_modules\universalify\index.js:7:14)
    at ZkArtifacts.saveArtifactAndDebugFile (C:\Dev\Blockchain\zksync-vyper-sandbox\node_modules\.pnpm\hardhat@2.22.5_ts-node@10.9.2_@types+node@20.14.9_typescript@5.5.2__typescript@5.5.2\node_modules\hardhat\src\internal\artifacts.ts:224:21)
    at ZkArtifacts.saveArtifactAndDebugFile (C:\Dev\Blockchain\zksync-vyper-sandbox\node_modules\.pnpm\@matterlabs+hardhat-zksync-vyper@1.0.8_@nomiclabs+hardhat-vyper@3.0.6_hardhat@2.22.5_ts-node@_n4bugrytkf7ezgd42eohu6gqnm\node_modules\@matterlabs\hardhat-zksync-vyper\src\artifacts.ts:53:32)
    at SimpleTaskDefinition.action (C:\Dev\Blockchain\zksync-vyper-sandbox\node_modules\.pnpm\@nomiclabs+hardhat-vyper@3.0.6_hardhat@2.22.5_ts-node@10.9.2_@types+node@20.14.9_typescript@5.5.2__typescript@5.5.2_\node_modules\@nomiclabs\hardhat-vyper\src\index.ts:349:27)
    at processTicksAndRejections (node:internal/process/task_queues:95:5)
    at async Environment._runTaskDefinition (C:\Dev\Blockchain\zksync-vyper-sandbox\node_modules\.pnpm\hardhat@2.22.5_ts-node@10.9.2_@types+node@20.14.9_typescript@5.5.2__typescript@5.5.2\node_modules\hardhat\src\internal\core\runtime-environment.ts:359:14)
    at async Environment.run (C:\Dev\Blockchain\zksync-vyper-sandbox\node_modules\.pnpm\hardhat@2.22.5_ts-node@10.9.2_@types+node@20.14.9_typescript@5.5.2__typescript@5.5.2\node_modules\hardhat\src\internal\core\runtime-environment.ts:192:14) {
  code: 'EINVAL'
}
 ELIFECYCLE  Command failed with exit code 1.

Minimal reproduction steps

  1. Clone this repo: https://github.com/pcaversaccio/zksync-vyper-sandbox on a Windows machine.
  2. pnpm install
  3. pnpm compile
@kiriyaga-txfusion
Copy link
Contributor

Hello @pcaversaccio, it appears that the compiler is returning absolute paths for the contracts instead of relative ones. This issue is specific to Vyper version 0.4.0, and we'll need to discuss this with the compiler team so they can resolve it. Thank you for reporting this.

@hedgar2017
Copy link

hedgar2017 commented Jul 1, 2024

@kiriyaga-txfusion zkvyper is merely passing through what it receives from vyper in this case, so they behave in the same way.
I've just checked and confirmed that vyper v0.4.0 indeed returns absolute paths starting from this version.

@kiriyaga-txfusion
Copy link
Contributor

Hi @pcaversaccio, we saw your post on the Hardhat issue page. Thanks for that! This issue is related to that one where hardhat-vyper doesn't support the new vyper version that uses absolute paths instead of relative ones. This is also the case on Windows, but in addition, windows cannot merge paths like linux, causing hardhat-vyper to throw a different error.

@pcaversaccio
Copy link
Contributor Author

Hi @pcaversaccio, we saw your post on the Hardhat issue page. Thanks for that! This issue is related to that one where hardhat-vyper doesn't support the new vyper version that uses absolute paths instead of relative ones. This is also the case on Windows, but in addition, windows cannot merge paths like linux, causing hardhat-vyper to throw a different error.

Yeah exactly, that's why I opened an issue specifically there; the WIN32 bug is related to the hardhat-zksync plugin however, correct? Will you coordinate with the Hardhat team on the Vyper 0.4.0 path resolution bug?

@kiriyaga-txfusion
Copy link
Contributor

Hi @pcaversaccio, we saw your post on the Hardhat issue page. Thanks for that! This issue is related to that one where hardhat-vyper doesn't support the new vyper version that uses absolute paths instead of relative ones. This is also the case on Windows, but in addition, windows cannot merge paths like linux, causing hardhat-vyper to throw a different error.

Yeah exactly, that's why I opened an issue specifically there; the WIN32 bug is related to the hardhat-zksync plugin however, correct? Will you coordinate with the Hardhat team on the Vyper 0.4.0 path resolution bug?

Our plugin uses hardhat-vyper in the background, and this issue appears due to an invalid artifact save path generated by hardhat-vyper. Yes, we can even contribute on that repo to fix this issue in a shorter time 👍

@kiriyaga-txfusion
Copy link
Contributor

Hello @pcaversaccio , please check the new release of hardhat-vyper version 3.0.7 if you haven't already. This release also fixes an issue we had with win32 paths as described in the issue description.

@pcaversaccio
Copy link
Contributor Author

Hello @pcaversaccio , please check the new release of hardhat-vyper version 3.0.7 if you haven't already. This release also fixes an issue we had with win32 paths as described in the issue description.

Yeah, thanks for this! I successfully deployed a contract here: https://sepolia-era.zksync.network/address/0x0E74203a877C6f681491388Bbd9bde4d0589C8e9#code. We need to address however Vyper contract verification that use the new modules system. Will open a new issue on this one.

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

No branches or pull requests

3 participants