ethereum / hevm

symbolic EVM evaluator
https://hevm.dev
GNU Affero General Public License v3.0
223 stars 45 forks source link

Error: unable to parse: .../out/Base.sol/CommonBase.json #491

Closed iirekm closed 1 month ago

iirekm commented 3 months ago

I'm getting Error: unable to parse: .../out/Base.sol/CommonBase.json.

Reproduction: just followed the steps from https://hevm.dev/install.html

Versions: recent version of hevm and forge at time of writing.

iirekm commented 3 months ago

OS: Ubuntu 24.04, but the same problem happens on clean containerized environment (made with earthly):

VERSION 0.8
FROM alpine:3.19.1

foundry:
    FROM ghcr.io/foundry-rs/foundry:nightly-cafc2606a2187a42b236df4aa65f4e8cdfcea970

forge-build:
    FROM +foundry
    WORKDIR /build
    COPY src src
    COPY foundry.toml .
    RUN forge build
    SAVE ARTIFACT out

hevm-download:
    RUN apk add --no-cache curl
    RUN curl -L https://github.com/ethereum/hevm/releases/download/release%2F0.53.0/hevm-x86_64-linux -o hevm
    SAVE ARTIFACT hevm

hevm:
    COPY +hevm-download/hevm /usr/local/bin/
    RUN chmod +x /usr/local/bin/hevm
    RUN apk add --no-cache z3

hevm-test:
    FROM +hevm
    WORKDIR /build
    COPY +forge-build/out out
    RUN hevm test
iirekm commented 3 months ago

Any progress with it? It makes hevm useless for me. How are you able to use it if it clearly fails even in clean environment!

msooseth commented 3 months ago

I'm sorry for being late at answering. This is due to a new/old version of foundry. The JSON has changed. It's very annoying. Can you maybe use the nix setup that's explained on the README? That contains the correct foundry that will produce the JSON that hevm expects.

Please note that even though we are aware of this issue, there's little we can do -- either we break hevm for everyone using the old JSON, or we break it for everyone using the new JSON. Implementing/supporting both is a lot of pain. If you use the nix setup that's on the README, it'll use the correct version of foundry and you'll be good.

I'm sorry for the inconvenience this has caused :(

msooseth commented 1 month ago

Hi,

If using the new foundry, this is not an issue. So I am closing, because I don't think it's a good idea to support both old and new foundry. Let me know if you have any trouble using the new foundry!!

Cheers,

Mate

Silur commented 1 month ago

can you please specify what does "new foundry" mean in this case? Because the issue persists with the current latest version forge 0.2.0 (af97b2c 2024-07-18T00:17:45.244496253Z)

msooseth commented 3 weeks ago

I am fixing this, sorry. Once https://github.com/ethereum/hevm/pull/510 iis merged, this will work. In the meanwhile, you can use that version, if you like! Sorry about this mess, my mistake.