foundry: forge build fails with solc 0.6.12
Component
Forge
Have you ensured that all of these are up to date?
- Foundry
- Foundryup
What version of Foundry are you on?
forge 0.2.0 (b951f65 2022-03-26T04:46:06.407207863+00:00)
What command(s) is the bug in?
forge build
Operating System
Linux
Describe the bug
When I open a new project but change the solidity version to 0.6.12 forge build fails:
$ forge init forge-2
Initializing $PATH/forge-2...
Installing ds-test in "$PATH/forge-2/lib/ds-test", (url: https://github.com/dapphub/ds-test, tag: None)
Installed ds-test
Initialized forge project.
$ cd forge-2
$ forge build
[⠊] Compiling...
[⠢] Compiling 3 files with 0.8.10
Compiler run successful
$ sed -i 's/0.8.10/0.6.12/' src/Contract.sol
$ grep pragma src/Contract.sol
pragma solidity 0.6.12;
$ forge build
[⠢] Compiling...
Error:
0: Solc Error:
Location:
cli/src/cmd/utils.rs:40
Backtrace omitted.
Run with RUST_BACKTRACE=1 environment variable to display it.
Run with RUST_BACKTRACE=full to include source snippets.
$ forge --version
forge 0.2.0 (b951f65 2022-03-26T04:46:06.407207863+00:00)
About this issue
- Original URL
- State: closed
- Created 2 years ago
- Comments: 27 (15 by maintainers)
If rebuild solves the problem, I’ll update the remaining 30 static binaries 😃
Confirmed that with the newest version of forge I no longer need to use the
--offlineworkaround, the downloaded solc just works.Thank you for the quick help and for the quick resolution! Also, thank you for foundry in general, outside of the little trouble I had here with getting started forge&cast have been immensely helpful, an absolute delight ❤️
@lithp Yes, running with
--offlineshould skip it 😃@nikitastupin updating here: https://github.com/roynalnaruto/svm-rs/pull/42
Hi @roynalnaruto! I’ve recompiled and published the remaining binaries. Feel free to update
svm-rs😃@nikitastupin you can also tag me, so I can update
svm-rsonce you’ve pushed new binaries.Perhaps I’ve produced the
0.6.12version with different compiler options because0.6.12binary from the nikitastupin/solc is statically linked while it should be dynamically linked.Let me reproduce the issue locally and fix that.