Skip to content

Commit

Permalink
Selectively download nimbus-eth2 submodules
Browse files Browse the repository at this point in the history
  • Loading branch information
jangko committed Sep 18, 2023
1 parent a65b1c9 commit 2c2aa16
Show file tree
Hide file tree
Showing 6 changed files with 30 additions and 14 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -241,7 +241,7 @@ jobs:

- name: Build Nim and Nimbus-eth1 dependencies
run: |
make -j${ncpu} ARCH_OVERRIDE=${PLATFORM} CI_CACHE=NimBinCache update
make -j${ncpu} ARCH_OVERRIDE=${PLATFORM} CI_CACHE=NimBinCache update-from-ci
- name: Run nimbus-eth1 tests (Windows)
if: runner.os == 'Windows'
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/fluffy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ jobs:

- name: Build Nim and Nimbus-eth1 dependencies
run: |
make -j${ncpu} ARCH_OVERRIDE=${PLATFORM} CI_CACHE=NimBinaries update
make -j${ncpu} ARCH_OVERRIDE=${PLATFORM} CI_CACHE=NimBinaries update-from-ci
- name: build uTP test app container
run: |
Expand Down Expand Up @@ -253,7 +253,7 @@ jobs:
run: |
# use CC to make sure Nim compiler and subsequent test
# using the same glibc version.
env CC=gcc make -j${ncpu} ARCH_OVERRIDE=${PLATFORM} CI_CACHE=NimBinaries update
env CC=gcc make -j${ncpu} ARCH_OVERRIDE=${PLATFORM} CI_CACHE=NimBinaries update-from-ci
- name: Run fluffy tests (Windows)
if: runner.os == 'Windows'
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/nimbus_verified_proxy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,7 @@ jobs:

- name: Build Nim and Nimbus-eth1 dependencies
run: |
make -j${ncpu} ARCH_OVERRIDE=${PLATFORM} CI_CACHE=NimBinaries update
make -j${ncpu} ARCH_OVERRIDE=${PLATFORM} CI_CACHE=NimBinaries update-from-ci
- name: Run verified proxy tests (Windows)
if: runner.os == 'Windows'
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/simulators.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ jobs:
- name: Build Nim and deps
run: |
ncpu=$(nproc)
make -j${ncpu} ARCH_OVERRIDE=x64 CI_CACHE=NimBinaries update
make -j${ncpu} ARCH_OVERRIDE=x64 CI_CACHE=NimBinaries update-from-ci
make -j${ncpu} deps
- name: Run Simulators
Expand Down Expand Up @@ -74,7 +74,7 @@ jobs:
- name: Build Nim and deps
run: |
ncpu=$(sysctl -n hw.ncpu)
make -j${ncpu} ARCH_OVERRIDE=x64 CI_CACHE=NimBinaries update
make -j${ncpu} ARCH_OVERRIDE=x64 CI_CACHE=NimBinaries update-from-ci
make -j${ncpu} deps
- name: Run Simulators
Expand Down Expand Up @@ -144,7 +144,7 @@ jobs:
- name: Build Nim and deps
run: |
ncpu=${NUMBER_OF_PROCESSORS}
mingw32-make -j${ncpu} ARCH_OVERRIDE=x64 CI_CACHE=NimBinaries update
mingw32-make -j${ncpu} ARCH_OVERRIDE=x64 CI_CACHE=NimBinaries update-from-ci
mingw32-make -j${ncpu} deps
- name: Run Simulators
Expand Down
18 changes: 17 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,18 @@ FLUFFY_TOOLS_CSV := $(subst $(SPACE),$(COMMA),$(FLUFFY_TOOLS))

ifeq ($(NIM_PARAMS),)
# "variables.mk" was not included, so we update the submodules.
GIT_SUBMODULE_UPDATE := git submodule update --init --recursive
# selectively download nimbus-eth2 submodules because we don't need all of it's modules
# also holesky already exceeds github LFS quota
GIT_SUBMODULE_UPDATE := git -c submodule."vendor/nimbus-eth2".update=none submodule update --init --recursive; \
git submodule update vendor/nimbus-eth2; \
cd vendor/nimbus-eth2; \
git submodule update --init vendor/eth2-networks; \
git submodule update --init vendor/holesky; \
git submodule update --init vendor/sepolia; \
git submodule update --init vendor/gnosis-chain-configs; \
git submodule update --init --recursive vendor/nim-kzg4844; \
cd ../..

.DEFAULT:
+@ echo -e "Git submodules not found. Running '$(GIT_SUBMODULE_UPDATE)'.\n"; \
$(GIT_SUBMODULE_UPDATE); \
Expand Down Expand Up @@ -186,6 +197,11 @@ update: | update-common
rm -rf nimbus.nims && \
$(MAKE) nimbus.nims $(HANDLE_OUTPUT)

update-from-ci: | sanity-checks update-test
rm -rf nimbus.nims && \
$(MAKE) nimbus.nims $(HANDLE_OUTPUT)
+ "$(MAKE)" --no-print-directory deps-common

# builds the tools, wherever they are
$(TOOLS): | build deps
for D in $(TOOLS_DIRS); do [ -e "$${D}/$@.nim" ] && TOOL_DIR="$${D}" && break; done && \
Expand Down
12 changes: 6 additions & 6 deletions docker/dist/entry_point.sh
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ if [[ "${PLATFORM}" == "Windows_amd64" ]]; then

build_rocksdb TARGET_OS=MINGW CXX="${CXX}"

make -j$(nproc) update
make -j$(nproc) update-from-ci

make \
-j$(nproc) \
Expand Down Expand Up @@ -133,7 +133,7 @@ elif [[ "${PLATFORM}" == "Linux_arm32v7" ]]; then

build_rocksdb TARGET_ARCHITECTURE=arm CXX="${CXX}"

make -j$(nproc) update
make -j$(nproc) update-from-ci

env CFLAGS="" make \
-j$(nproc) \
Expand All @@ -154,7 +154,7 @@ elif [[ "${PLATFORM}" == "Linux_arm64v8" ]]; then

build_rocksdb TARGET_ARCHITECTURE=arm64 CXX="${CXX}"

make -j$(nproc) update
make -j$(nproc) update-from-ci

make \
-j$(nproc) \
Expand Down Expand Up @@ -183,7 +183,7 @@ elif [[ "${PLATFORM}" == "macOS_amd64" ]]; then

build_rocksdb TARGET_OS=Darwin CXX="${CXX}" AR="${AR}"

make -j$(nproc) update
make -j$(nproc) update-from-ci

make \
-j$(nproc) \
Expand Down Expand Up @@ -225,7 +225,7 @@ elif [[ "${PLATFORM}" == "macOS_arm64" ]]; then

build_rocksdb TARGET_OS=Darwin TARGET_ARCHITECTURE=arm64 CXX="${CXX}" AR="${AR}"

make -j$(nproc) update
make -j$(nproc) update-from-ci

make \
-j$(nproc) \
Expand Down Expand Up @@ -259,7 +259,7 @@ else

build_rocksdb

make -j$(nproc) update
make -j$(nproc) update-from-ci

make \
-j$(nproc) \
Expand Down

0 comments on commit 2c2aa16

Please sign in to comment.