diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 8c3c95c25..57c851c1f 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -195,6 +195,7 @@ jobs: - name: Install FFI env: GITHUB_TOKEN: ${{ github.token }} + CURIO_OPTIMAL_LIBFILCRYPTO: 0 run: | make deps shell: bash @@ -230,7 +231,7 @@ jobs: echo "Using YugabyteDB Container IP: ${{env.CURIO_HARMONYDB_HOSTS}}" export CURIO_HARMONYDB_HOSTS=${{ env.CURIO_HARMONYDB_HOSTS }} export LOTUS_HARMONYDB_HOSTS=${{ env.CURIO_HARMONYDB_HOSTS }} - go test -v --tags=debug -timeout 30m ${{ matrix.test-suite.target }} + go test -v --tags="debug,fvm" -timeout 30m ${{ matrix.test-suite.target }} - name: Stop YugabyteDB container if: always() # Ensure this runs even if the tests fail diff --git a/Makefile b/Makefile index 668089c46..88c77de1f 100644 --- a/Makefile +++ b/Makefile @@ -10,14 +10,31 @@ FFI_DEPS:=$(addprefix $(FFI_PATH),$(FFI_DEPS)) $(FFI_DEPS): build/.filecoin-install ; +# When enabled, build size-optimized libfilcrypto by default +CURIO_OPTIMAL_LIBFILCRYPTO ?= 1 + build/.filecoin-install: $(FFI_PATH) - $(MAKE) -C $(FFI_PATH) $(FFI_DEPS:$(FFI_PATH)%=%) + @if [ "$(CURIO_OPTIMAL_LIBFILCRYPTO)" = "1" ]; then \ + FFI_DISABLE_FVM=1 $(MAKE) curio-libfilecoin; \ + else \ + $(MAKE) -C $(FFI_PATH) $(FFI_DEPS:$(FFI_PATH)%=%); \ + fi @touch $@ MODULES+=$(FFI_PATH) BUILD_DEPS+=build/.filecoin-install CLEAN+=build/.filecoin-install +## Custom libfilcrypto build for Curio (size-optimized, no FVM) +.PHONY: curio-libfilecoin +curio-libfilecoin: + FFI_BUILD_FROM_SOURCE=1 \ + FFI_USE_GPU=1 \ + FFI_USE_MULTICORE_SDR=1 \ + RUSTFLAGS='-C codegen-units=1 -C opt-level=3 -C strip=symbols' \ + $(MAKE) -C $(FFI_PATH) clean .install-filcrypto + @echo "Rebuilt libfilcrypto for Curio (OpenCL+multicore, no default features)." + ffi-version-check: @[[ "$$(awk '/const Version/{print $$5}' extern/filecoin-ffi/version.go)" -eq 3 ]] || (echo "FFI version mismatch, update submodules"; exit 1) BUILD_DEPS+=ffi-version-check @@ -82,6 +99,17 @@ CLEAN+=build/.update-modules deps: $(BUILD_DEPS) .PHONY: deps +## Test targets + +test-deps: CURIO_OPTIMAL_LIBFILCRYPTO=0 +test-deps: $(BUILD_DEPS) + @echo "Built dependencies with FVM support for testing" +.PHONY: test-deps + +test: test-deps + go test -v -tags="cgo,fvm" -timeout 30m ./itests/... +.PHONY: test + ## ldflags -s -w strips binary CURIO_TAGS ?= cunative diff --git a/extern/filecoin-ffi b/extern/filecoin-ffi index 586063e9c..377980587 160000 --- a/extern/filecoin-ffi +++ b/extern/filecoin-ffi @@ -1 +1 @@ -Subproject commit 586063e9cfa45147d554f176759520398715ba41 +Subproject commit 3779805870f9d070bb73a8083feef25c93be9c51