ApeWorX / ape-vyper

Vyper compiler plugin for the Ape Framework, using VVM
https://www.apeworx.io/
Apache License 2.0
26 stars 9 forks source link

fix: preserve compiler error #27

Closed antazoey closed 2 years ago

antazoey commented 2 years ago

What I did

fixes: #26

How I did it

Follow advice from @fubuloubu

  1. Raise compiler-centric error in the compile phase that actually preserves the std-err data OR uses the natural exception in the error output.
  2. Other error improvements.

How to verify it

Make sure you can see the compile related errors in bad vyper code, e.g.:


ERROR: (VyperCompileError) vyper.exceptions.StructureException: Unsupported syntax for module namespace: Expr
  contract "/var/folders/hg/17b1zhsn1n3d8b4rgh6ntt_w0000gn/T/vyper-ajp3wgog.vy", line 1:0
  ---> 1 asdfasdfasdf
  -------^
       2

[15687] Failed to execute script vyper_compile

^ Not exactly sure where the [15687] Failed to execute script vyper_compile comes from though

Also, make sure good vyper good still compiles!

Checklist

antazoey commented 2 years ago

I just tried to compile some garbage, it seems to work better now:

ERROR: (VyperCompileError) vyper.exceptions.StructureException: Unsupported syntax for module namespace: Expr
  contract "/var/folders/hg/17b1zhsn1n3d8b4rgh6ntt_w0000gn/T/vyper-ajp3wgog.vy", line 1:0
  ---> 1 asdfasdfasdf
  -------^
       2

[15687] Failed to execute script vyper_compile
fubuloubu commented 2 years ago
[15687] Failed to execute script vyper_compile

^ Not exactly sure where the [15687] Failed to execute script vyper_compile comes from though

I think this is pyinstaller? maybe

antazoey commented 2 years ago

Would be nice to add a few test cases

Totally agree! Thanks. They are added now.