Verify FFI version before building

Resolves: #5003

Signed-off-by: Jakub Sztandera <kubuxu@protocol.ai>
This commit is contained in:
Jakub Sztandera 2021-02-15 13:30:56 +01:00
parent 95e47cf998
commit 59733da383
No known key found for this signature in database
GPG Key ID: 9A9AF56F8B3879BA

View File

@ -41,10 +41,15 @@ MODULES+=$(FFI_PATH)
BUILD_DEPS+=build/.filecoin-install
CLEAN+=build/.filecoin-install
$(MODULES): build/.update-modules ;
ffi-version-check:
@[[ "$$(awk '/const Version/{print $$5}' extern/filecoin-ffi/version.go)" -eq 1 ]] || (echo "FFI version mismatch, update submodules"; exit 1)
BUILD_DEPS+=ffi-version-check
.PHONY: ffi-version-check
# dummy file that marks the last time modules were updated
build/.update-modules:
build/.update-modules: $(MODULES)
git submodule update --init --recursive
touch $@