-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
forge build fails with solc 0.6.12 #1116
Comments
Can you do "rm -rf ~/.svm" and try again with "RUST_LOG=ethers forge b" and print the output? |
that's a version from couple days ago, could not reproduce with |
Please try the following (as mentioned above):
|
Confirmed that it happens on the very latest version, The problem appears to be happening because I'm running on arm64 linux. I can reproduce the failure by downloading this binary (which has the same sha256 sum as the solc forge installs into $ ./solc-v0.6.12 --allow-paths $PATH/forge-2,$PATH/forge-2/lib $PATH/forge-2/src/Contract.sol
Aborted (core dumped) Currently trying to figure out what's happening, strace makes it look like the binary might be sending SIGABRT to itself. |
I was able to build solc from source and the 0.6.12 I built works correctly. When I try to put it into |
@lithp Yes, running with |
Interesting, is it possible that the builds produced in https://github.com/nikitastupin/solc/ are faulty? |
Running it with I'm down to help you figure out what if anything is wrong with the arm64 binaries. The binary doesn't appear to be stripped, I'll run it inside gdb and see if anything jumps out at me, but let me know if there are other ways I could help you! |
Confusingly, this is the stack trace at abort: (gdb) bt
#0 0x0000000000cfee08 in gsignal ()
#1 0x0000000000401ac0 in abort ()
#2 0x0000000000ceb114 in uw_init_context_1 ()
#3 0x0000000000ceb674 in _Unwind_RaiseException ()
#4 0x0000000000c4a780 in __cxa_throw ()
#5 0x00000000005a2ea0 in void boost::throw_exception<solidity::langutil::FatalError>(solidity::langutil::FatalError const&) ()
#6 0x0000000000595da8 in void boost::exception_detail::throw_exception_<solidity::langutil::FatalError>(solidity::langutil::FatalError const&, char const*, char const*, int) ()
#7 0x0000000000bc740c in solidity::langutil::ErrorReporter::fatalError(solidity::langutil::ErrorId, solidity::langutil::Error::Type, solidity::langutil::SourceLocation const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&) ()
#8 0x0000000000bc7584 in solidity::langutil::ErrorReporter::fatalParserError(solidity::langutil::ErrorId, solidity::langutil::SourceLocation const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&) ()
#9 0x000000000057ee04 in solidity::frontend::Parser::parsePragmaVersion(solidity::langutil::SourceLocation const&, std::vector<solidity::langutil::Token, std::allocator<solidity::langutil::Token> > const&, std::vector<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::allocator<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > > > const&) ()
#10 0x000000000057f31c in solidity::frontend::Parser::parsePragmaDirective() ()
#11 0x000000000057e7b4 in solidity::frontend::Parser::parse(std::shared_ptr<solidity::langutil::Scanner> const&) ()
#12 0x0000000000507670 in solidity::frontend::CompilerStack::parse() ()
#13 0x0000000000509400 in solidity::frontend::CompilerStack::parseAndAnalyze() ()
#14 0x00000000005098f4 in solidity::frontend::CompilerStack::compile() ()
#15 0x000000000040ab7c in solidity::frontend::CommandLineInterface::processInput() ()
#16 0x00000000004597c8 in main () There's not enough debug info for me to single-step through so I have no idea why the error message would fail to print. As for why the version check might be failing, I had some trouble getting my locally-built solc to pass the version check, it failed at what appears to be exactly where this stacktrace is failing:
In order to get this check to pass I needed to run |
Oh that's because you didn't build it with the release flag, see here, you built a pre-release version which ends up not matching the hash |
@nikitastupin any clue on why this core dump might be happening? |
Sorry, I wasn't clear! If I only do the line you linked to then it still builds a pre-release version and fails at the place this stacktrace shows. The built binary only agrees to compile this contract if I also run line 44, My guess was that these built binaries might not have run line 44. However, it looks like this is the action which built the binaries, so my guess is likely wrong! |
Perhaps I've produced the % file solc-v0.6.12
% file solc-v0.8.13
Let me reproduce the issue locally and fix that. |
Ah maybe it was before you had set up the GHA? |
I think that's exactly the case. Anyways, I've rebuilt and published the |
I think that's because of |
If rebuild solves the problem, I'll update the remaining 30 static binaries 😃 solc $ ls linux/aarch64/* | xargs -n 1 file | grep static | wc -l
|
Hey @onbjerg,
I've just updated |
believe we have to update links as we're pointing to an outdated commit on svm-rs: https://github.com/roynalnaruto/svm-rs/search?q=nikitastupin |
Will update in in a while! |
@lithp this should be fixed now! Could you confirm? |
It works for me now. If @lithp confirms the fix, I'll recompile all other [static] binaries and let you know once they're published so we can update one more time. Thank you all for you effort ❤️ |
@nikitastupin you can also tag me, so I can update |
Confirmed that with the newest version of forge I no longer need to use the 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 ❤️ |
LFG |
Hi @roynalnaruto! I've recompiled and published the remaining binaries. Feel free to update |
@nikitastupin updating here: alloy-rs/svm-rs#42 |
Component
Forge
Have you ensured that all of these are up to date?
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:The text was updated successfully, but these errors were encountered: