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

called Option::unwrap() on a None value #981

Closed
zakrad opened this issue Mar 13, 2023 · 15 comments · Fixed by #992
Closed

called Option::unwrap() on a None value #981

zakrad opened this issue Mar 13, 2023 · 15 comments · Fixed by #992
Labels
bug Something isn't working

Comments

@zakrad
Copy link

zakrad commented Mar 13, 2023

Aim

I was following the Noir hello_world tutorial and encountered this error after nargo check

Expected behavior

It should generate two additional files in my hello_world folder

Bug

The application panicked (crashed).
Message:  called `Option::unwrap()` on a `None` value

To reproduce

Installation method

Compiled from source

Nargo version

nargo 0.3.0

@noir-lang/noir_wasm version

No response

@noir-lang/barretenberg version

No response

@noir-lang/aztec_backend version

No response

Additional context

No response

@zakrad zakrad added the bug Something isn't working label Mar 13, 2023
@aguzmant103
Copy link

Faced this too just now

@aguzmant103
Copy link

If it helps, I installed Noir with WASM backend https://noir-lang.org/getting_started/nargo/installation.html#option-21-install-executable-with-wasm-backend

@zakrad
Copy link
Author

zakrad commented Mar 14, 2023

Yeah I also installed Noir with WASM backend

@TomAFrench
Copy link
Member

Hi @aguzmant103 and @zakrad , thank you for this report. I'm unable to reproduce this on the prebuilt binaries or on the tip of master.

Can you confirm which commit you're building from and share the full error message so that I can see where this error is being thrown?

@aguzmant103
Copy link

aguzmant103 commented Mar 14, 2023

image
nargo 0.2.0 (git version hash: 9bec92a, is dirty: false)

@TomAFrench here you go. Is this what you're after?

@TomAFrench
Copy link
Member

Yes, that helps a lot. Thank you.

Looks like the embedded std lib isn't being found somehow. It works fine on Ubuntu so potentially it's a windows specific issue? Something related to forward vs backwards slashes not being handled in the prefix for StdLibAssets?

@kobyhallx, I think you have a windows installation. Could you test this out to see if you can reproduce?

@zakrad
Copy link
Author

zakrad commented Mar 14, 2023

I dont know which commit but I pulled with this git clone git@github.com:noir-lang/noir.git yesterday

@zakrad
Copy link
Author

zakrad commented Mar 14, 2023

Yes, that helps a lot. Thank you.

Looks like the embedded std lib isn't being found somehow. It works fine on Ubuntu so potentially it's a windows specific issue? Something related to forward vs backwards slashes not being handled in the prefix for StdLibAssets?

@kobyhallx, I think you have a windows installation. Could you test this out to see if you can reproduce?

I also tried with wsl on windows with same error

@aguzmant103
Copy link

I'm on Windows directly so that theory could be right

@TomAFrench
Copy link
Member

This definitely seems to be a windows specific error which snuck through due to our test suite not properly alerting failing tests on windows.

Tentative fix here: #990. If you could try building from commit 999b49a and seeing if you still get this error I'd be very grateful.

@aguzmant103
Copy link

@TomAFrench still there unfortunately
image

Is it okay I just installed it on top of the last one? (I couldn't find how to remove the old version). I just:

  1. git cloned to the branch with the fix
  2. followed the same WASM installation procedure

@TomAFrench
Copy link
Member

TomAFrench commented Mar 16, 2023

Yeah, that's perfect. Thanks for testing.

Not entirely surprising that it didn't work. My guess is the fake "path" for the stdlib is getting converted from std/lib.nr to std\lib.nr on windows which results in it not matching the pattern we check for in order to return the stdlib, but that would have been a cleaner fix than for this issue.

@aguzmant103
Copy link

@TomAFrench this issue was closed by mistake? Lmk what other things to try :)

@TomAFrench
Copy link
Member

Nope, should be fixed if you build from the latest master.

@TomAFrench
Copy link
Member

This fix is included in the 0.3.2 release so if you pull the latest binary (once its built) then you should good to go.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants