Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

forge compile hangs indefinitely on simple contract compilation #11251

Unanswered
Pynex asked this question in Help
Discussion options

Component

Forge

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

  • Foundry
  • Foundryup

What version of Foundry are you on?

forge Version: 1.2.3-stable Commit SHA: a813a2c Build Timestamp: 2025年06月08日T15:42:40.147013149Z (1749397360) Build Profile: maxperf

What version of Foundryup are you on?

foundryup: 1.1.0

What command(s) is the bug in?

forge build/test/compile/coverage

Operating System

Arch Linux

Describe the bug

forge compile hangs indefinitely and never completes compilation, even for simple contracts. The process needs to be manually terminated with Ctrl+C.

Steps to Reproduce

Install Foundry using foundryup
Create a new project or use existing project with simple contract
Run forge compile
Command hangs indefinitely without output

What Works

solc src/Counter.sol --bin --abi --optimize -o build/ - compiles successfully
forge --version - works fine
forge config - works fine

Additional Notes

The issue occurs consistently across different projects
No error messages are displayed
Installed via foundryup from official installer
Local solc compiler works fine with the same contracts

You must be logged in to vote

Replies: 4 comments

Comment options

@Pynex cannot reproduce this on Win / Linux, most probably related to your install / setup. Please provide more details, try running RUST_LOG=trace forge build and see where it hangs

You must be logged in to vote
0 replies
Comment options

Title: forge compile hangs indefinitely on Arch Linux during Solidity version installation

Description:
When running forge compile, the process hangs forever while trying to install Solidity versions (e.g., 0.6.12 and 0.8.20). Manually terminating with Ctrl+C is the only way to stop it.
Key Details:

OS: Arch Linux
Foundry Version: forge 1.2.3-stable (commit a813a2c)
Repro Steps:
 foundryup (latest)
 forge compile → hangs indefinitely

logs

2025年08月08日T14:12:07.193132Z TRACE h2::proto::streams::prioritize: schedule_send stream.id=StreamId(1)
2025年08月08日T14:12:07.193147Z TRACE h2::proto::streams::store: Queue::push_back
2025年08月08日T14:12:07.193164Z TRACE h2::proto::streams::store: -> first entry
2025年08月08日T14:12:07.193176Z TRACE h2::proto::streams::recv: enqueue_reset_expiration; StreamId(1)
2025年08月08日T14:12:07.193186Z TRACE h2::proto::streams::store: Queue::push_back
2025年08月08日T14:12:07.193195Z TRACE h2::proto::streams::store: -> first entry
2025年08月08日T14:12:07.193205Z TRACE h2::proto::streams::counts: transition_after; stream=StreamId(1); state=State { inner: Closed(ScheduledLibraryReset(CANCEL)) }; is_closed=true; pending_send_empty=true; buffered_send_data=0; num_recv=0; num_send=1
2025年08月08日T14:12:07.194554Z TRACE Connection{peer=Client}:poll: h2::proto::connection: connection.state=Open
2025年08月08日T14:12:07.194725Z TRACE Connection{peer=Client}:poll:FramedRead::poll_next: h2::codec::framed_read: poll
2025年08月08日T14:12:07.195434Z TRACE Connection{peer=Client}:poll: h2::proto::connection: connection.state=Open
2025年08月08日T14:12:07.195617Z TRACE Connection{peer=Client}:poll:FramedRead::poll_next: h2::codec::framed_read: poll
2025年08月08日T14:12:07.195834Z TRACE Connection{peer=Client}:poll: h2::proto::streams::prioritize: poll_complete
2025年08月08日T14:12:07.195948Z TRACE Connection{peer=Client}:poll: h2::proto::streams::prioritize: poll_complete
2025年08月08日T14:12:07.195984Z TRACE Connection{peer=Client}:poll: h2::proto::streams::prioritize: schedule_pending_open
2025年08月08日T14:12:07.195962Z TRACE Connection{peer=Client}:poll: h2::proto::streams::prioritize: schedule_pending_open
2025年08月08日T14:12:07.196513Z TRACE Connection{peer=Client}:poll:pop_frame:popped{stream.id=StreamId(1) stream.state=State { inner: Closed(ScheduledLibraryReset(CANCEL)) }}: h2::proto::streams::prioritize: is_pending_reset=true
2025年08月08日T14:12:07.196536Z TRACE Connection{peer=Client}:poll:pop_frame:popped{stream.id=StreamId(1) stream.state=State { inner: Closed(ScheduledLibraryReset(CANCEL)) }}: h2::proto::streams::prioritize: pop_frame; frame=Reset { stream_id: StreamId(1), error_code: CANCEL }
2025年08月08日T14:12:07.196552Z TRACE Connection{peer=Client}:poll:pop_frame:popped{stream.id=StreamId(1) stream.state=State { inner: Closed(ScheduledLibraryReset(CANCEL)) }}: h2::proto::streams::counts: transition_after; stream=StreamId(1); state=State { inner: Closed(Error(Reset(StreamId(1), CANCEL, Library))) }; is_closed=true; pending_send_empty=true; buffered_send_data=0; num_recv=0; num_send=1
2025年08月08日T14:12:07.196564Z TRACE Connection{peer=Client}:poll:pop_frame:popped{stream.id=StreamId(1) stream.state=State { inner: Closed(ScheduledLibraryReset(CANCEL)) }}: h2::proto::streams::counts: dec_num_streams; stream=StreamId(1)
2025年08月08日T14:12:07.196576Z TRACE Connection{peer=Client}:poll: h2::proto::streams::prioritize: writing frame=Reset { stream_id: StreamId(1), error_code: CANCEL }
2025年08月08日T14:12:07.196602Z DEBUG Connection{peer=Client}:poll:FramedWrite::buffer{frame=Reset { stream_id: StreamId(1), error_code: CANCEL }}: h2::codec::framed_write: send frame=Reset { stream_id: StreamId(1), error_code: CANCEL }
2025年08月08日T14:12:07.196815Z TRACE Connection{peer=Client}:poll:FramedWrite::buffer{frame=Reset { stream_id: StreamId(1), error_code: CANCEL }}: h2::frame::reset: encoding RESET; id=StreamId(1) code=CANCEL
2025年08月08日T14:12:07.196860Z TRACE Connection{peer=Client}:poll:pop_frame:popped{stream.id=StreamId(1) stream.state=State { inner: Closed(ScheduledLibraryReset(CANCEL)) }}: h2::proto::streams::prioritize: is_pending_reset=true
2025年08月08日T14:12:07.196900Z TRACE Connection{peer=Client}:poll:pop_frame:popped{stream.id=StreamId(1) stream.state=State { inner: Closed(ScheduledLibraryReset(CANCEL)) }}: h2::proto::streams::prioritize: pop_frame; frame=Reset { stream_id: StreamId(1), error_code: CANCEL }
2025年08月08日T14:12:07.197023Z TRACE Connection{peer=Client}:poll:pop_frame:popped{stream.id=StreamId(1) stream.state=State { inner: Closed(ScheduledLibraryReset(CANCEL)) }}: h2::proto::streams::counts: transition_after; stream=StreamId(1); state=State { inner: Closed(Error(Reset(StreamId(1), CANCEL, Library))) }; is_closed=true; pending_send_empty=true; buffered_send_data=0; num_recv=0; num_send=1
2025年08月08日T14:12:07.197043Z TRACE Connection{peer=Client}:poll:pop_frame:popped{stream.id=StreamId(1) stream.state=State { inner: Closed(ScheduledLibraryReset(CANCEL)) }}: h2::proto::streams::counts: dec_num_streams; stream=StreamId(1)
2025年08月08日T14:12:07.197059Z TRACE Connection{peer=Client}:poll: h2::proto::streams::prioritize: writing frame=Reset { stream_id: StreamId(1), error_code: CANCEL }
2025年08月08日T14:12:07.197084Z DEBUG Connection{peer=Client}:poll:FramedWrite::buffer{frame=Reset { stream_id: StreamId(1), error_code: CANCEL }}: h2::codec::framed_write: send frame=Reset { stream_id: StreamId(1), error_code: CANCEL }
2025年08月08日T14:12:07.197157Z TRACE Connection{peer=Client}:poll:FramedWrite::buffer{frame=Reset { stream_id: StreamId(1), error_code: CANCEL }}: h2::frame::reset: encoding RESET; id=StreamId(1) code=CANCEL
2025年08月08日T14:12:07.197341Z TRACE Connection{peer=Client}:poll:FramedWrite::buffer{frame=Reset { stream_id: StreamId(1), error_code: CANCEL }}: h2::codec::framed_write: encoded reset rem=13
2025年08月08日T14:12:07.197537Z TRACE Connection{peer=Client}:poll: h2::proto::streams::prioritize: schedule_pending_open
2025年08月08日T14:12:07.197555Z TRACE Connection{peer=Client}:poll:FramedWrite::flush: h2::codec::framed_write: queued_data_frame=false
2025年08月08日T14:12:07.197026Z TRACE Connection{peer=Client}:poll:FramedWrite::buffer{frame=Reset { stream_id: StreamId(1), error_code: CANCEL }}: h2::codec::framed_write: encoded reset rem=13
2025年08月08日T14:12:07.197823Z TRACE Connection{peer=Client}:poll: h2::proto::streams::prioritize: schedule_pending_open
2025年08月08日T14:12:07.197898Z TRACE Connection{peer=Client}:poll:FramedWrite::flush: h2::codec::framed_write: queued_data_frame=false
2025年08月08日T14:12:07.198039Z TRACE Connection{peer=Client}:poll:FramedWrite::flush: h2::codec::framed_write: flushing buffer
2025年08月08日T14:12:07.198287Z TRACE h2::client: last stream closed during poll, wake again
2025年08月08日T14:12:07.198039Z TRACE Connection{peer=Client}:poll:FramedWrite::flush: h2::codec::framed_write: flushing buffer
2025年08月08日T14:12:07.198708Z TRACE h2::client: last stream closed during poll, wake again
2025年08月08日T14:12:07.198905Z TRACE h2::proto::streams::streams: Streams::recv_eof
2025年08月08日T14:12:07.199202Z TRACE h2::proto::streams::counts: transition_after; stream=StreamId(1); state=State { inner: Closed(Error(Reset(StreamId(1), CANCEL, Library))) }; is_closed=true; pending_send_empty=true; buffered_send_data=0; num_recv=0; num_send=0
2025年08月08日T14:12:07.199222Z TRACE h2::proto::streams::counts: transition_after; stream=StreamId(1); state=State { inner: Closed(Error(Reset(StreamId(1), CANCEL, Library))) }; is_closed=true; pending_send_empty=true; buffered_send_data=0; num_recv=0; num_send=0
2025年08月08日T14:12:07.199241Z TRACE h2::proto::streams::streams: Streams::recv_eof
2025年08月08日T14:12:07.199272Z TRACE h2::proto::streams::counts: transition_after; stream=StreamId(1); state=State { inner: Closed(Error(Reset(StreamId(1), CANCEL, Library))) }; is_closed=true; pending_send_empty=true; buffered_send_data=0; num_recv=0; num_send=0
2025年08月08日T14:12:07.199280Z TRACE h2::proto::streams::counts: transition_after; stream=StreamId(1); state=State { inner: Closed(Error(Reset(StreamId(1), CANCEL, Library))) }; is_closed=true; pending_send_empty=true; buffered_send_data=0; num_recv=0; num_send=0
2025年08月08日T14:12:07.199339Z TRACE mio::poll: deregistering event source from poller 
2025年08月08日T14:12:07.199548Z TRACE mio::poll: deregistering event source from poller 
[⠰] Installing Solc version 0.8.20
[⠔] Failed to install Solc 0.8.20: error sending request for url (https://binaries.soliditylang.org/linux-amd64/solc-linux-amd64-v0.8.20+commit.a1b79de6)
[⠒] Failed to install Solc 0.6.12: error sending request for url (https://binaries.soliditylang.org/linux-amd64/solc-linux-amd64-v0.6.12+commit.27d51765)2025年08月08日T14:12:07.225601Z DEBUG compile_with: foundry_common::compile: finished compiling in 600.975s
[⠑] Failed to install Solc 0.6.12: error sending request for url (https://binaries.soliditylang.org/linux-amd64/solc-linux-amd64-v0.6.12+commit.27d51765)
Error: error sending request for url (https://binaries.soliditylang.org/linux-amd64/solc-linux-amd64-v0.8.20+commit.a1b79de6)
Context:
- operation timed out
◄ 0s にじゅうまる forge compile しろいしかく しろさんかくくろまる◦⎥ 18:52
[⠒] Compiling...
[⠢] Compiling 1 files with Solc 0.8.20
[⠆] Compiling 155 files with Solc 0.6.12
[⠰] Installing Solc version 0.6.12
[⠢] Installing Solc version 0.8.20
[⠘] Failed to install Solc 0.8.20: error sending request for url (https://binaries.soliditylang.org/linux-amd64/list.json)
[⠃] Failed to install Solc 0.6.12: error sending request for url (https://binaries.soliditylang.org/linux-amd64/list.json)
Error: error sending request for url (https://binaries.soliditylang.org/linux-amd64/list.json)
Context:
- Error #0: client error (SendRequest)
- Error #1: connection error
- Error #2: timed out
 ▴7818▿17866
◄ 17m22s

forge config:

◄ 36s ⋈┈にじゅうまる forge config しろいしかく zeus-contracts しろさんかくくろまる◦⎥ node ◫ 24.5.0via S 19:22
[profile.default]
src = "contracts"
test = "test"
script = "script"
out = "out"
libs = [
 "lib",
 "node_modules",
]
remappings = [
 "@openzeppelin/=node_modules/@openzeppelin/",
 "eth-gas-reporter/=node_modules/eth-gas-reporter/",
 "hardhat-deploy/=node_modules/hardhat-deploy/",
 "hardhat/=node_modules/hardhat/",
]
auto_detect_remappings = true
libraries = []
cache = true
dynamic_test_linking = false
cache_path = "cache"
snapshots = "snapshots"
gas_snapshot_check = false
gas_snapshot_emit = true
broadcast = "broadcast"
allow_paths = []
include_paths = []
skip = []
force = false
evm_version = "cancun"
gas_reports = ["*"]
gas_reports_ignore = []
gas_reports_include_tests = false
auto_detect_solc = true
offline = false
optimizer = false
optimizer_runs = 200
verbosity = 0
ignored_error_codes = [
 "license",
 "code-size",
 "init-code-size",
 "transient-storage",
]
ignored_warnings_from = []
deny_warnings = false
test_failures_file = "cache/test-failures"
show_progress = false
ffi = false
allow_internal_expect_revert = false
always_use_create_2_factory = false
prompt_timeout = 120
sender = "0x1804c8ab1f12e6bbf3894d4083f33e07309d1f38"
tx_origin = "0x1804c8ab1f12e6bbf3894d4083f33e07309d1f38"
initial_balance = "0xffffffffffffffffffffffff"
block_number = 1
gas_limit = 1073741824
block_base_fee_per_gas = 0
block_coinbase = "0x0000000000000000000000000000000000000000"
block_timestamp = 1
block_difficulty = 0
block_prevrandao = "0x0000000000000000000000000000000000000000000000000000000000000000"
memory_limit = 134217728
extra_output = []
extra_output_files = []
names = false
sizes = false
via_ir = false
ast = false
no_storage_caching = false
no_rpc_rate_limit = false
use_literal_content = false
bytecode_hash = "ipfs"
cbor_metadata = true
sparse_mode = false
build_info = false
isolate = false
disable_block_gas_limit = false
unchecked_cheatcode_artifacts = false
create2_library_salt = "0x0000000000000000000000000000000000000000000000000000000000000000"
create2_deployer = "0x4e59b44847b379578588920ca78fbf26c0b4956c"
assertions_revert = true
legacy_assertions = false
odyssey = false
transaction_timeout = 120
eof = false
additional_compiler_profiles = []
compilation_restrictions = []
script_execution_protection = true
[profile.default.rpc_storage_caching]
chains = "all"
endpoints = "all"
[[profile.default.fs_permissions]]
access = "read"
path = "out"
[fmt]
line_length = 120
tab_width = 4
bracket_spacing = false
int_types = "long"
multiline_func_header = "attributes_first"
quote_style = "double"
number_underscore = "preserve"
hex_underscore = "remove"
single_line_statement_blocks = "preserve"
override_spacing = false
wrap_comments = false
ignore = []
contract_new_lines = false
sort_imports = false
[doc]
out = "docs"
title = ""
book = "book.toml"
homepage = "README.md"
ignore = []
[fuzz]
runs = 256
max_test_rejects = 65536
dictionary_weight = 40
include_storage = true
include_push_bytes = true
max_fuzz_dictionary_addresses = 15728640
max_fuzz_dictionary_values = 6553600
gas_report_samples = 256
failure_persist_dir = "cache/fuzz"
failure_persist_file = "failures"
show_logs = false
[invariant]
runs = 256
depth = 500
fail_on_revert = false
call_override = false
dictionary_weight = 80
include_storage = true
include_push_bytes = true
max_fuzz_dictionary_addresses = 15728640
max_fuzz_dictionary_values = 6553600
shrink_run_limit = 5000
max_assume_rejects = 65536
gas_report_samples = 256
failure_persist_dir = "cache/invariant"
show_metrics = false
show_solidity = false
[labels]
[vyper]
[bind_json]
out = "utils/JsonBindings.sol"
include = []
exclude = []

--use flag works for single Solidity version but fails for multiple versions

forge build --use /home/pynex/.svm/0.6.12/solc-linux-amd64-v0.6.12+commit.27d51765

But for contracts requiring multiple versions (e.g., 0.6.12 and 0.8.20), it fails with:

Error: Encountered invalid solc version in contracts/tokens/ZUS/ZUS.sol: 
No solc version exists that matches the version requirement: =0.8.20

How can I compile projects with multiple Solidity versions using only locally installed solc binaries?

You must be logged in to vote
0 replies
Comment options

more detail logs

logs.txt

You must be logged in to vote
0 replies
Comment options

hi! you have a solidity file pinned to =0.8.20 so you need that version to build.
For future reference, you could use compilation restrictions to build files with different versions https://getfoundry.sh/config/reference/solidity-compiler#compilation-restrictions but you need solc versions locally anyways.
Moving this to discussions, alternatively you could ask in support tg channels. Thank you

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Help
Labels
T-bug Type: bug T-needs-triage Type: this issue needs to be labelled
2 participants
Converted from issue

This discussion was converted from issue #10966 on August 08, 2025 15:39.

AltStyle によって変換されたページ (->オリジナル) /