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

zkforge build crashes on solidity errors #291

Open
2 tasks done
alpinevm opened this issue Mar 24, 2024 · 2 comments
Open
2 tasks done

zkforge build crashes on solidity errors #291

alpinevm opened this issue Mar 24, 2024 · 2 comments
Labels
compiler Issues specific to compiling

Comments

@alpinevm
Copy link

Component

zkForge

Have you ensured that all of these are up to date?

  • Foundry
  • Foundryup

What version of Foundry are you on?

(normal) forge 0.2.0 (f9da73d 2024-03-24T00:18:58.485997283Z)

What command(s) is the bug in?

zkforge build

Operating System

Linux

Describe the bug

When running zkforge zkbuild --use 0.8.20 --use-zksolc v1.4.0 on a contract with a solidity syntax error the compiler crashes:

$ RUST_BACKTRACE=full zkforge zkbuild --use 0.8.20 --use-zksolc v1.4.0
The application panicked (crashed).
Message:  called `Result::unwrap()` on an `Err` value: Error("missing field `contracts`", line: 1, column: 316)
Location: crates/common/src/zk_compile.rs:1165

This is a bug. Consider reporting it at https://github.com/foundry-rs/foundry

  ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ BACKTRACE ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
  <empty backtrace>

Run with COLORBT_SHOW_HIDDEN=1 environment variable to disable frame filtering.
Aborted (core dumped)

Output of forge build on the same project for reference:

$ forge build
[⠊] Compiling...
[⠒] Compiling 3 files with 0.8.20
[⠢] Solc 0.8.20 finished in 2.14ms
Error:
Compiler run failed:
Error (2314): Expected ';' but got '}'
 --> src/NFT.sol:7:2:
  |
7 | 	}
  | 	^

Was able to reproduce this with a few different types of solidity errors.

System Info:
zkforge version:

$ zkforge -V
forge 0.2.0 (89ef0f4 2024-03-24T23:48:59.091477116Z)

Compiled from source with command:

$ cargo install --path ./crates/zkforge --profile local --force --locked

Rust version info:

$ rustup show
Default host: x86_64-unknown-linux-gnu
rustup home:  /home/user/.rustup

installed toolchains
--------------------

stable-x86_64-unknown-linux-gnu
nightly-2023-09-30-x86_64-unknown-linux-gnu (default)

active toolchain
----------------

nightly-2023-09-30-x86_64-unknown-linux-gnu (default)
rustc 1.74.0-nightly (8ce4540bd 2023-09-29)

Machine info:

$ lsb_release -a
No LSB modules are available.
Distributor ID:	Ubuntu
Description:	Ubuntu 22.04.3 LTS
Release:	22.04
Codename:	jammy
@alpinevm alpinevm added the T-bug label Mar 24, 2024
@milaabl
Copy link

milaabl commented Mar 25, 2024

I have the same issue as you, too!! But it occurs when running the build command on any Solidity source, no matter if the code has correct syntax or no. I'm running Windows WSL, but @yohanelly95 is getting the same error on MacOS. (#285)

@dutterbutter
Copy link
Collaborator

Hey folks 👋

We are in the process of releasing a new version of our Foundry implementation that will handle these situations much better. I apologize for the inconvenience currently being experienced, as this is an early alpha version we appreciate the reported issue. We are tracking to make a pre-release of the new version this week.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
compiler Issues specific to compiling
Projects
None yet
Development

No branches or pull requests

3 participants