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

Compile Error on Fresh Project #4

Open
calvbore opened this issue Feb 4, 2025 · 8 comments
Open

Compile Error on Fresh Project #4

calvbore opened this issue Feb 4, 2025 · 8 comments
Labels
bug Something isn't working good first issue Good for newcomers help wanted Extra attention is needed

Comments

@calvbore
Copy link

calvbore commented Feb 4, 2025

On a new project if I try to compile the default circuit I get this error immediately:

Error executing command: /home/calvin/.bb/hardhat/v0.66.0/bb write_vk -b /home/calvin/ethdev/hh-noir-starter/noir/target/my_noir.json -o /home/calvin/ethdev/hh-noir-starter/noir/target/my_noir_vk
/bin/sh: 1: /home/calvin/.bb/hardhat/v0.66.0/bb: not found

Error in plugin hardhat-plugin-noir: Error executing command: /home/calvin/.bb/hardhat/v0.66.0/bb write_vk -b /home/calvin/ethdev/hh-noir-starter/noir/target/my_noir.json -o /home/calvin/ethdev/hh-noir-starter/noir/target/my_noir_vk

When I compile with --show-stack-traces, this is the additional info:

HardhatPluginError: Error executing command: /home/calvin/.bb/hardhat/v0.66.0/bb write_vk -b /home/calvin/ethdev/hh-noir-starter/noir/target/my_noir.json -o /home/calvin/ethdev/hh-noir-starter/noir/target/my_noir_vk
    at /home/calvin/ethdev/hh-noir-starter/node_modules/hardhat-plugin-noir/src/utils.ts:24:11
    at async /home/calvin/ethdev/hh-noir-starter/node_modules/hardhat-plugin-noir/src/tasks.ts:47:9
    at async Promise.all (index 1)
    at async OverriddenTaskDefinition._action (/home/calvin/ethdev/hh-noir-starter/node_modules/hardhat-plugin-noir/src/tasks.ts:39:5)
    at async Environment._runTaskDefinition (/home/calvin/ethdev/hh-noir-starter/node_modules/hardhat/src/internal/core/runtime-environment.ts:351:14)
    at async Environment.run (/home/calvin/ethdev/hh-noir-starter/node_modules/hardhat/src/internal/core/runtime-environment.ts:184:14)
    at async main (/home/calvin/ethdev/hh-noir-starter/node_modules/hardhat/src/internal/cli/cli.ts:322:7)
@olehmisar
Copy link
Owner

could you please provide the full log?

Also, what is the result of the following commands?

ls /home/calvin/.bb
ls /home/calvin/.bb/hardhat
ls /home/calvin/.bb/hardhat/v0.66.0

@olehmisar olehmisar transferred this issue from olehmisar/hardhat-noir-starter Feb 4, 2025
@calvbore
Copy link
Author

calvbore commented Feb 4, 2025

Here is the full log:

Installing [email protected] in /home/calvin/.bb/hardhat/v0.66.0
Installing to /home/calvin/.bb
✓ Installed barretenberg to /home/calvin/.bb

  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
  0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0
100 9528k  100 9528k    0     0  7943k      0  0:00:01  0:00:01 --:--:-- 7943k

Generating Solidity verifier for new_file...
Generating Solidity verifier for my_noir...
Error executing command: /home/calvin/.bb/hardhat/v0.66.0/bb write_vk -b /home/calvin/ethdev/hh-noir-starter/noir/target/my_noir.json -o /home/calvin/ethdev/hh-noir-starter/noir/target/my_noir_vk
/bin/sh: 1: /home/calvin/.bb/hardhat/v0.66.0/bb: not found

Error in plugin hardhat-plugin-noir: Error executing command: /home/calvin/.bb/hardhat/v0.66.0/bb write_vk -b /home/calvin/ethdev/hh-noir-starter/noir/target/my_noir.json -o /home/calvin/ethdev/hh-noir-starter/noir/target/my_noir_vk

HardhatPluginError: Error executing command: /home/calvin/.bb/hardhat/v0.66.0/bb write_vk -b /home/calvin/ethdev/hh-noir-starter/noir/target/my_noir.json -o /home/calvin/ethdev/hh-noir-starter/noir/target/my_noir_vk
    at /home/calvin/ethdev/hh-noir-starter/node_modules/hardhat-plugin-noir/src/utils.ts:24:11
    at async /home/calvin/ethdev/hh-noir-starter/node_modules/hardhat-plugin-noir/src/tasks.ts:47:9
    at async Promise.all (index 1)
    at async OverriddenTaskDefinition._action (/home/calvin/ethdev/hh-noir-starter/node_modules/hardhat-plugin-noir/src/tasks.ts:39:5)
    at async Environment._runTaskDefinition (/home/calvin/ethdev/hh-noir-starter/node_modules/hardhat/src/internal/core/runtime-environment.ts:351:14)
    at async Environment.run (/home/calvin/ethdev/hh-noir-starter/node_modules/hardhat/src/internal/core/runtime-environment.ts:184:14)
    at async main (/home/calvin/ethdev/hh-noir-starter/node_modules/hardhat/src/internal/cli/cli.ts:322:7)

ls /home/calvin/.bb gives me bb bbup hardhat
ls /home/calvin/.bb/hardhat gives me v0.66.0
ls /home/calvin/.bb/hardhat/v0.66.0 returns nothing

I do already have nargo and bb installed via the scripts in the noir documentation, not sure if that would be affecting this.

@olehmisar
Copy link
Owner

weird. What shell are you using? It does not pickup environment variables required to install the specific nargo and bb versions in the correct destination

@calvbore
Copy link
Author

calvbore commented Feb 4, 2025

just using a default bash shell on pop os

@olehmisar
Copy link
Owner

idk how to reproduce it. I have only mac and ubuntu machines. Your shell/os is not picking up environment variables that are required for nargo and bb installation. Try updating your bash.

@olehmisar
Copy link
Owner

To make this plugin not rely on native nargo/bb, one would have to migrate it to wasm versions of nargo/bb.

@olehmisar olehmisar added bug Something isn't working help wanted Extra attention is needed good first issue Good for newcomers labels Feb 6, 2025
@olehmisar
Copy link
Owner

try with version 0.3.1. I replaced exec with spawn, so maybe it changes how your OS is picking up env variables

@calvbore
Copy link
Author

sorry for the late reply, my bash is at the latest version. I ran with [email protected] and get a permission denied error.

> [email protected] compile
> npx hardhat compile

Installing [email protected] in /home/calvin/.bb/hardhat/v0.67.0
Installing to /.bb
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
  0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0
100 9658k  100 9658k    0     0  8071k      0  0:00:01  0:00:01 --:--:-- 43.0M
mkdir: cannot create directory '/.bb': Permission denied
An unexpected error occurred:

Error: Process exited with code 1
    at ChildProcess.<anonymous> (/home/calvin/ethdev/hh-noir-starter/node_modules/hardhat-plugin-noir/src/utils.ts:31:18)
    at ChildProcess.emit (node:events:517:28)
    at ChildProcess.emit (node:domain:489:12)
    at maybeClose (node:internal/child_process:1098:16)
    at Process.ChildProcess._handle.onexit (node:internal/child_process:303:5)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working good first issue Good for newcomers help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

2 participants