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

Fail to compile bin with noir_wasm: "files are expected to be added to the FileManager" #4355

Closed
KumaCrypto opened this issue Feb 13, 2024 · 0 comments · Fixed by #4499
Closed
Labels
bug Something isn't working

Comments

@KumaCrypto
Copy link

Aim

Trying to compile bin project with @noir-lang/noir_wasm

Expected Behavior

Successful compilation :)

Bug

From my description in the discord channel:

The structure of the project is as follows:
There is a main project with main.nr that uses a library from git (lib without dependencies). When calling the compile function for the main.nr from the @noir-lang/noir_wasm package, a panic error occurs: files are expected to be added to the FileManager before reaching the compiler file_path: {path/to/the/lib.nr}", compiler/noirc_driver/src/lib.rs:140:28.

Version: noir_wasm: ^0.23.0, nargo: 0.23.0.

The code I'm trying to execute is:

    const basePath = resolve(join("circuits-noir", name));
    const fm = createFileManager(basePath);
    const compiled = await compile(fm, basePath);

More error log:

RuntimeError: unreachable
    at wasm://wasm/026ce5be:wasm-function[10195]:0x6ef5f4
    at wasm://wasm/026ce5be:wasm-function[9574]:0x6edc7a
    at wasm://wasm/026ce5be:wasm-function[6201]:0x6a4b96
    at wasm://wasm/026ce5be:wasm-function[6742]:0x6bda7d
    at wasm://wasm/026ce5be:wasm-function[9966]:0x6eef4f
    at wasm://wasm/026ce5be:wasm-function[7589]:0x6d6f89
    at wasm://wasm/026ce5be:wasm-function[8169]:0x6e1c55
    at noirc_driver::prepare_dependency::h8f5065e2e17d7a8a (wasm://wasm/026ce5be:wasm-function[4232]:0x60b6f4)
    at noir_wasm::compile::add_noir_lib::h35775807b613d080 (wasm://wasm/026ce5be:wasm-function[6108]:0x69f987)
    at compile (wasm://wasm/026ce5be:wasm-function[106]:0x138f66)

To Reproduce

  1. Clone the repository with a simplified version of the code: https://github.com/KumaCrypto/compilation_bug_noir/tree/main
  2. npm i
  3. node scripts/index.js

Project Impact

Blocker

Impact Context

No response

Workaround

None

Workaround Description

No response

Additional Context

No response

Installation Method

Binary (noirup default)

Nargo Version

nargo version = 0.23.0 noirc version = 0.23.0+5be9f9d7e2f39ca228df10e5a530474af0331704

NoirJS Version

"@noir-lang/noir_wasm": "^0.23.0"

Would you like to submit a PR for this Issue?

None

Support Needs

No response

@KumaCrypto KumaCrypto added the bug Something isn't working label Feb 13, 2024
@github-project-automation github-project-automation bot moved this to 📋 Backlog in Noir Feb 13, 2024
github-merge-queue bot pushed a commit that referenced this issue Mar 7, 2024
# Description

Github deps are directly added to the file manager, which causes them to
be missing the absolute path to the source file and only include the
extraction directory relative to the fm root directory. This caused the
path to the file to be formatted in an unexpected way and the compiler
to panic.

Resolves: #4355

Check one:
- [x] No documentation needed.
- [ ] Documentation included in this PR.
- [ ] **[Exceptional Case]** Documentation to be submitted in a separate
PR.

# PR Checklist\*

- [x] I have tested the changes locally.
- [x] I have formatted the changes with [Prettier](https://prettier.io/)
and/or `cargo fmt` on default settings.
@github-project-automation github-project-automation bot moved this from 📋 Backlog to ✅ Done in Noir Mar 7, 2024
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
Archived in project
Development

Successfully merging a pull request may close this issue.

1 participant