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

bug(forge build): forge build fails during patch for solc>=0.8.24 (on NixOS?) #9682

Closed
2 tasks done
benSepanski opened this issue Jan 14, 2025 · 3 comments · Fixed by #9700
Closed
2 tasks done

bug(forge build): forge build fails during patch for solc>=0.8.24 (on NixOS?) #9682

benSepanski opened this issue Jan 14, 2025 · 3 comments · Fixed by #9700
Labels
A-compiler Area: compiler A-dependencies Area: dependencies T-bug Type: bug

Comments

@benSepanski
Copy link

benSepanski commented Jan 14, 2025

Component

Forge

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

  • Foundry
  • Foundryup

What version of Foundry are you on?

forge 0.3.0 (017c59d 2025-01-14T00:23:15.391167000Z)

What version of Foundryup are you on?

foundryup: 0.3.0

What command(s) is the bug in?

forge build

Operating System

macOS (Apple Silicon)

Describe the bug

mkdir myProj
cd myProj
forge init
forge install
forge build

Results in the following error:

[⠊] Compiling...
[⠒] Compiling 27 files with Solc 0.8.28
[⠘] Installing Solc version 0.8.28
[⠃] Failed to install Solc 0.8.28: Unable to patch solc binary for nixos. stdout: . stderr: patchelf: not an ELF executable

Error: Unable to patch solc binary for nixos. stdout: . stderr: patchelf: not an ELF executable

However, this error disappears if I set the solidity version to 0.8.23 or lower in the foundry.toml. I am using the solc downloaded from brew (today), and have tried with both stable and nightly foundry.

@benSepanski benSepanski added T-bug Type: bug T-needs-triage Type: this issue needs to be labelled labels Jan 14, 2025
@github-project-automation github-project-automation bot moved this to Todo in Foundry Jan 14, 2025
@benSepanski
Copy link
Author

Note: I have also tried installing and re-installing foundry, and building from source locally.

I did brew install libusb, and have tried this PR #9260 based on this issue #545, but continued to hit the same error.

@zerosnacks
Copy link
Member

Hi @benSepanski

From the error it appears you are running NixOS? Is this correct?

Possibly related: #545

@zerosnacks zerosnacks added T-to-investigate Type: to investigate A-compiler Area: compiler and removed T-needs-triage Type: this issue needs to be labelled labels Jan 15, 2025
@zerosnacks zerosnacks changed the title Forge build fails during patch for solc>=0.8.24 bug(forge build): forge build fails during patch for solc>=0.8.24 (on NixOS?) Jan 15, 2025
@benSepanski
Copy link
Author

Thanks! I do have nix on my system, but for a different application. I am trying to not use it for foundry, though I guess svm-rs does not give me much of an option

https://github.com/alloy-rs/svm-rs/blob/dd58346a22afaa1937647dedfbab95619872e2d5/crates/svm-rs/src/platform.rs#L45-L47

I've tried some of the solutions recommended in #545, but did not have the error messages they did, and the solutions did not work for me

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-compiler Area: compiler A-dependencies Area: dependencies T-bug Type: bug
Projects
Status: Done
Development

Successfully merging a pull request may close this issue.

2 participants