Commit 95d3ee1c authored by Nicolas "Norswap" Laurent's avatar Nicolas "Norswap" Laurent Committed by norswap

make unicorn a git module

parent a2020455
node_modules
artifacts
cache
unicorn
unicorn2
.*.swp
venv
.idea
......
......@@ -2,3 +2,6 @@
branch = l2minigeth
path = minigeth
url = git@github.com:ethereum-optimism/minigeth.git
[submodule "unicorn"]
path = unicorn
url = git@github.com:unicorn-engine/unicorn.git
SHELL := /bin/bash
build: unicorn submodule minigeth_mips minigeth_default_arch mipsevm contracts
build: submodules unicorn minigeth_mips minigeth_default_arch mipsevm contracts
unicorn:
./build_unicorn.sh
submodule:
submodules:
# CI will checkout submodules on its own (and fails on these commands)
if [[ -z "$$GITHUB_ENV" ]]; then \
git submodule init; \
......@@ -31,11 +31,16 @@ nodejs:
npm install; \
fi
# Must be a definition and not a rule, otherwise it gets only called once and
# not before each test as we wish.
define clear_cache
rm -rf /tmp/cannon
mkdir -p /tmp/cannon
endef
clear_cache:
$(call clear_cache)
test_challenge:
$(call clear_cache)
# Build preimage cache for block 13284469
......@@ -82,5 +87,5 @@ mrproper: clean
rm -rf node_modules
rm -rf mipigo/venv
.PHONY: build unicorn submodule minigeth_mips minigeth_default_arch mipsevm contracts \
nodejs clean mrproper test_challenge test_mipsevm test_minigeth test
.PHONY: build unicorn submodules minigeth_mips minigeth_default_arch mipsevm contracts \
nodejs clean mrproper test_challenge test_mipsevm test_minigeth test clear_cache
#!/usr/bin/env bash
if [[ ! -d unicorn2 ]]; then
git clone https://github.com/geohot/unicorn.git -b dev unicorn2
#git clone https://github.com/unicorn-engine/unicorn.git -b dev unicorn2
fi
cd unicorn2
cmake . -DUNICORN_ARCH=mips -DCMAKE_BUILD_TYPE=Release
#cmake . -DUNICORN_ARCH=mips -DCMAKE_BUILD_TYPE=Debug
cd unicorn
mkdir -p build
cd build
cmake .. -DUNICORN_ARCH=mips -DCMAKE_BUILD_TYPE=Release
make -j8
# The Go linker / runtime expects these to be there!
cp libunicorn.so.1 ..
cp libunicorn.so.2 ..
# export LIBUNICORN_PATH for Github CI
# TODO: is this actually needed?
if [[ ! -z "$GITHUB_ENV" ]]; then
echo "LIBUNICORN_PATH=$(pwd)/unicorn2/" >> $GITHUB_ENV
echo "LIBUNICORN_PATH=$(pwd)/unicorn/" >> $GITHUB_ENV
fi
......@@ -4,7 +4,7 @@ go 1.17
replace github.com/ethereum/go-ethereum => ../minigeth
replace github.com/unicorn-engine/unicorn => ../unicorn2
replace github.com/unicorn-engine/unicorn => ../unicorn
require (
github.com/ethereum/go-ethereum v1.10.8
......
Subproject commit e5e1303243cf1a4e788a981ac7e6dbe945802260
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment