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

LLVM IR generator definition pass error #317

Closed
2 tasks done
ChiHaoLu opened this issue Apr 12, 2024 · 3 comments
Closed
2 tasks done

LLVM IR generator definition pass error #317

ChiHaoLu opened this issue Apr 12, 2024 · 3 comments
Labels
compiler 📟 Issues specific to compiling

Comments

@ChiHaoLu
Copy link

ChiHaoLu commented Apr 12, 2024

Component

Forge

Have you ensured that all of these are up to date?

  • Foundry
  • Foundryup

What version of Foundry are you on?

No response

What command(s) is the bug in?

forge build --zksync

Operating System

macOS (Apple Silicon)

Describe the bug

I am building the a project with zkSync-foundry, but I meet a problem returns error when compiling:

$ forge build --zksync
>
[⠒] Compiling...
No files changed, compilation skipped

Error:
Failed to compile with zksolc: Compilation failed with "Contract `contracts/v2/FiatTokenV2.sol:FiatTokenV2` compiling error: 

The contract `contracts/v2/FiatTokenV2.sol:FiatTokenV2` LLVM IR generator definition pass error: 

Library `contracts/util/SignatureChecker.sol:SignatureChecker` not found in the project

The contract `contracts/v2/FiatTokenV2.sol:FiatTokenV2` LLVM IR generator definition pass error: 

Library `contracts/util/SignatureChecker.sol:SignatureChecker` not found in the project\n\n\nStack backtrace:
    0: __ZN4llvm15SmallVectorBaseIyE8grow_podEPvmm
    1: __ZN4llvm15SmallVectorBaseIyE8grow_podEPvmm
    2: __mh_execute_header
    3: __mh_execute_header
    4: __mh_execute_header
    5: __mh_execute_header
    6: __mh_execute_header
    7: __mh_execute_header
    8: __ZN4llvm15SmallVectorBaseIyE8grow_podEPvmm
    9: __mh_execute_header
    10: __mh_execute_header
    11: __mh_execute_header
    12: __mh_execute_header
    13: __mh_execute_header
    14: __mh_execute_header
    15: __mh_execute_header
    16: __ZN4llvm15SmallVectorBaseIyE8grow_podEPvmm
    17: __mh_execute_header
    18: __mh_execute_header
    19: __mh_execute_header
    20: __ZN4llvm15SmallVectorBaseIyE8grow_podEPvmm
    21: __pthread_deallocate\n". 

Using compiler: "/Users/chihaolu/.zksync/zksolc-macosx-arm64-v1.4.0", with args "/Users/chihaolu/Desktop/project/stablecoin-zkSync/contracts/v2/FiatTokenV2.sol" ["--standard-json", "--solc", "/Users/chihaolu/.svm/0.6.12/solc-0.6.12"]

My repo is here, you can use it to reproduce.

I found some similar issues, but I still can't figure out how to solve this problem.

@ChiHaoLu ChiHaoLu added the T-bug label Apr 12, 2024
@dutterbutter dutterbutter added compiler 📟 Issues specific to compiling and removed T-bug labels Apr 12, 2024
@dutterbutter
Copy link
Collaborator

Thanks @ChiHaoLu we are in the process of improving compiling so this is very helpful.

@Karrq
Copy link
Contributor

Karrq commented May 28, 2024

Hello, I wanted to let you know that this should been taken care of by #357!

You should now get a better error when using forge build --zksync which also lets you know what you need to do next (and I expect it to mention SignatureChecker).

Looking at the information you provided tho, I expect you to encounter #382 when doing forge test --zksync, please take a look there for more information.

If you still encounter this error please let us know

@Karrq
Copy link
Contributor

Karrq commented Jun 5, 2024

I tried your repo locally and I got the expected error.

--> contracts/util/SignatureChecker.sol
Error: 
Missing libraries detected [ZkMissingLibrary { contract_name: "SignatureChecker", contract_path: "contracts/util/SignatureChecker.sol", missing_libraries: [] }]

Run the following command in order to deploy the missing libraries:
forge create --deploy-missing-libraries --private-key <PRIVATE_KEY> --rpc-url <RPC_URL> --chain <CHAIN_ID> --zksync

Thank you for your report! If the issue persists on your end, please reopen this issue.

@Karrq Karrq closed this as completed Jun 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
compiler 📟 Issues specific to compiling
Projects
None yet
Development

No branches or pull requests

3 participants