-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
Add support for Apple Silicon #525
Comments
Do you get the same issue if you use |
can you ru the compilation of the foundry in a rosetta terminal? im on an m1 as well and it works fine for me in alacritty run in rosetta mode |
Hm, that's weird, I have compiled, installed and used the forge binaries fine on an M1 Mac. No need for rosetta either. I just checked and Activity Monitor also says it's running under "Apple" architecture. |
Same for me, I'm on M1 w/o Rosetta and it works. @pmuens can you try nuking the |
Thanks everyone for jumping in!
Just ran an
I wrote a script inspired by My directory structure is the following (the script posted below is the
#!/usr/bin/env bash
set -e
# NOTE: This script is an adaption of https://tinyurl.com/yxefjez5
echo Installing Foundry...
# Adaption of https://stackoverflow.com/a/246128
SCRIPT_DIR=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )
ROOT_DIR="$SCRIPT_DIR/../contracts"
TMP_DIR="$ROOT_DIR/tmp"
BIN_DIR="$ROOT_DIR/bin"
mkdir -p $TMP_DIR
mkdir -p $BIN_DIR
while [[ $1 ]]; do
case $1 in
--) shift; break;;
-r|--repo) shift; REPO=$1;;
-b|--branch) shift; BRANCH=$1;;
-v|--version) shift; VERSION=$1;;
*) printf "internal error: %q\\n" "$1"; exit 1
esac; shift
done
REPO=${REPO-gakonst/foundry}
BRANCH=${BRANCH-master}
VERSION=${VERSION-nightly}
if ! command -v cargo &> /dev/null ; then
echo Cargo is not installed...
exit 1
fi
REPO_PATH="${TMP_DIR}/${REPO}"
if [ -d $REPO_PATH ]; then
cd $REPO_PATH
git pull
git checkout ${BRANCH}
git pull
else
IFS="/" read -ra AUTHOR <<< "$REPO"
mkdir -p "$TMP_DIR/$AUTHOR"
cd "$TMP_DIR/$AUTHOR"
git clone https://github.com/${REPO}
cd $REPO_PATH
git checkout ${BRANCH}
fi
echo "nightly" > "$REPO_PATH/rust-toolchain"
cargo build --release --locked
cp "$REPO_PATH/target/release/forge" "$BIN_DIR/forge"
cp "$REPO_PATH/target/release/cast" "$BIN_DIR/cast"
chmod +x "$BIN_DIR/forge"
chmod +x "$BIN_DIR/cast"
echo Successfully installed Foundry... I re-ran the script in an empty project structure again this morning. Unfortunately I get the same result. I'm using this script to have Ideally I'd also love to run Foundry "natively" without Rosetta 😬 Thanks again everyone for providing help here! Edit: I also pulled the recent Edit 2: The interesting part is that |
Curious as to why you don't want to do a global install? |
A couple of years ago I switched from Homebrew to Nix for macOS package management. It definitely comes with a steep learning curve and a lot of times you have to fiddle around with the system yourself but I just love how everything is in I looked through The other beautiful thing about the binaries is that they're "portable" so you can just move them around on your filesystem. |
So it seems like this is not a Foundry issue, nor an svm-rs issue, but a Solidity issue. There are no released binaries for Silicon. So in order to fix this (without asking people to use Rosetta), we would need to:
|
not sure what happened but i'm also having the same issue here after updating foundry. previously I was able to run things fine with the |
@bretth18 I think that the |
For those of you who got Did you just pull the binary release via https://github.com/gakonst/foundry/releases? Did you use I did another attempt at installing If anybody has another workaround, I would really appreciate it if you could chime in. Thanks again for looking into this. |
hey, i was able to get everything working after realizing i wasn't using a |
That's great. Thanks for getting back and providing useful insights here 👍 Just out of curiosity: which |
i've been using homebrew without problems: https://formulae.brew.sh/formula/solidity |
Everything worked as expected for me on a fresh M1 mac using Homebrew's solidity bottle and foundryup. i.e.
@pmuens brew is using 0.8.11 - commit d7f03943. Managed to get it to build with the following:
Already had the dependencies installed from brew - needs boost and z3. |
bumps svm-rs. fixes #525 fixes #684 driveby: re-enable geb integration test (fixed in gakonst/ethers-rs#866) fixes #561
bumps svm-rs. fixes #525 fixes #684 driveby: re-enable geb integration test (fixed in gakonst/ethers-rs#866) fixes #561
FYI can confirm that the latest version works like a charm. Thanks a lot for fixing this 👌 |
bumps svm-rs. fixes foundry-rs/foundry#525 fixes foundry-rs/foundry#684
bumps svm-rs. fixes foundry-rs/foundry#525 fixes foundry-rs/foundry#684
First of all: Thanks everyone involved for creating
foundry
.This might not be the correct repository but I thought that I'd post it regardless in case others stumble upon the same issue.
When I clone, compile and run
foundry
on an M1 Mac I get the following error message when runningfoundry build
in the example scaffold that is generated viafoundry init
:Overall it looks like svm doesn't support Apple Silicon binaries as of yet. I found the following issue in the
svm-rs
repo that might be related to the problem: alloy-rs/svm-rs#12The text was updated successfully, but these errors were encountered: