diff --git a/.github/workflows/arbitrator-ci.yml b/.github/workflows/arbitrator-ci.yml index 7629150135..f5155b158b 100644 --- a/.github/workflows/arbitrator-ci.yml +++ b/.github/workflows/arbitrator-ci.yml @@ -47,6 +47,9 @@ jobs: steps: - name: Checkout uses: actions/checkout@v1 + with: + token: ${{ secrets.PRIVATE_CHECKOUT }} + submodules: recursive - name: Install Ubuntu dependencies run: | diff --git a/.gitmodules b/.gitmodules index d798bfc2e4..2a63a7f0cc 100644 --- a/.gitmodules +++ b/.gitmodules @@ -4,3 +4,6 @@ [submodule "fastcache"] path = fastcache url = git@github.com:OffchainLabs/fastcache.git +[submodule "brotli"] + path = brotli + url = https://github.com/google/brotli.git diff --git a/Makefile b/Makefile index 00650ed7ea..6a390827da 100644 --- a/Makefile +++ b/Makefile @@ -288,8 +288,8 @@ solgen/test/prover/proofs/%.json: arbitrator/prover/test-cases/%.wasm $(arbitrat yarn --cwd solgen install @touch $@ -.make/cbrotli-lib: | .make - @printf "%btesting cbrotli local build exists. If this step fails, see ./build-brotli.sh -l -h%b\n" $(color_pink) $(color_reset) +.make/cbrotli-lib: brotli/c/** | .make + @printf "%btesting cbrotli local build exists. If this step fails, run ./build-brotli.sh -l%b\n" $(color_pink) $(color_reset) test -f target/include/brotli/encode.h test -f target/include/brotli/decode.h test -f target/lib/libbrotlicommon-static.a @@ -297,8 +297,8 @@ solgen/test/prover/proofs/%.json: arbitrator/prover/test-cases/%.wasm $(arbitrat test -f target/lib/libbrotlidec-static.a @touch $@ -.make/cbrotli-wasm: | .make - @printf "%btesting cbrotli wasm build exists. If this step fails, see ./build-brotli.sh -w -h%b\n" $(color_pink) $(color_reset) +.make/cbrotli-wasm: brotli/c/** | .make + @printf "%btesting cbrotli wasm build exists. If this step fails, run ./build-brotli.sh -w%b\n" $(color_pink) $(color_reset) test -f target/lib-wasm/libbrotlicommon-static.a test -f target/lib-wasm/libbrotlienc-static.a test -f target/lib-wasm/libbrotlidec-static.a diff --git a/brotli b/brotli new file mode 160000 index 0000000000..f4153a09f8 --- /dev/null +++ b/brotli @@ -0,0 +1 @@ +Subproject commit f4153a09f87cbb9c826d8fc12c74642bb2d879ea diff --git a/build-brotli.sh b/build-brotli.sh index 7083a0dc63..993e136305 100755 --- a/build-brotli.sh +++ b/build-brotli.sh @@ -9,9 +9,7 @@ BUILD_WASM=false BUILD_LOCAL=false USE_DOCKER=false TARGET_DIR=target/ -SOURCE_DIR=target/src/brotli -COMMIT_ID=f4153a09f87cb # v1.0.9 + fixes required for cmake -REPO_URL=https://github.com/google/brotli.git +SOURCE_DIR=brotli usage(){ echo "brotli builder for arbitrum" @@ -19,17 +17,16 @@ usage(){ echo "usage: $0 [options]" echo echo "use one or more of:" - echo " w build wasm (uses emscripten)" - echo " l build local" + echo " -w build wasm (uses emscripten)" + echo " -l build local" echo echo "to avoid dependencies you might want:" - echo " d build inside docker container" + echo " -d build inside docker container" echo echo "Other options:" - echo " s source dir (will be created if doesn't exist) default: $SOURCE_DIR" - echo " t target dir default: $TARGET_DIR" - echo " c commit id (pass empty string to disable checkout) default: $COMMIT_ID" - echo " h help" + echo " -s source dir default: $SOURCE_DIR" + echo " -t target dir default: $TARGET_DIR" + echo " -h help" echo echo "all relative paths are relative to script location" } @@ -55,9 +52,6 @@ while getopts "s:t:c:wldh" option; do s) SOURCE_DIR="$OPTARG" ;; - c) - COMMIT_ID="$OPTARG" - ;; esac done @@ -82,20 +76,13 @@ if $USE_DOCKER; then exit 0 fi -if [ ! -d "$SOURCE_DIR" ]; then - git clone $REPO_URL "$SOURCE_DIR" -fi cd "$SOURCE_DIR" -if [ ! -z $COMMIT_ID ]; then - git checkout $COMMIT_ID -fi - if $BUILD_WASM; then - mkdir -p build-wasm - mkdir -p install-wasm - TEMP_INSTALL_DIR_ABS=`cd -P install-wasm; pwd` - cd build-wasm - cmake ../ -DCMAKE_C_COMPILER=emcc -DCMAKE_BUILD_TYPE=Release -DCMAKE_C_FLAGS=-fPIC -DCMAKE_INSTALL_PREFIX="$TEMP_INSTALL_DIR_ABS" -DCMAKE_AR=`which emar` -DCMAKE_RANLIB=`which touch` + mkdir -p buildfiles/build-wasm + mkdir -p buildfiles/install-wasm + TEMP_INSTALL_DIR_ABS=`cd -P buildfiles/install-wasm; pwd` + cd buildfiles/build-wasm + cmake ../../ -DCMAKE_C_COMPILER=emcc -DCMAKE_BUILD_TYPE=Release -DCMAKE_C_FLAGS=-fPIC -DCMAKE_INSTALL_PREFIX="$TEMP_INSTALL_DIR_ABS" -DCMAKE_AR=`which emar` -DCMAKE_RANLIB=`which touch` make -j make install cp -rv "$TEMP_INSTALL_DIR_ABS/lib" "$TARGET_DIR_ABS/lib-wasm" @@ -103,9 +90,9 @@ if $BUILD_WASM; then fi if $BUILD_LOCAL; then - mkdir -p build-local - cd build-local - cmake ../ -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX="$TARGET_DIR_ABS" + mkdir -p buildfiles/build-local + cd buildfiles/build-local + cmake ../../ -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX="$TARGET_DIR_ABS" make -j make install cd ..