revive llvm builder utility (#154)

Pre-eliminary support for LLVM releases and resolc binary releases by streamlining the build process for all supported hosts platforms.

- Introduce the revive-llvm-builder crate with the revive-llvm builder utilty.
- Do not rely on the LLVM dependency in $PATH to decouple the system LLVM installation from the LLVM host dependency.
- Fix the emscripten build by decoupling the host and native LLVM dependencies. Thus allowing a single LLVM emscripten release that can be used on any host platform.
- An example Dockerfile building an alpine container with a fully statically linked resolc ELF binary.
- Remove the Debian builder utilities and workflow.
This commit is contained in:
Cyrill Leutwiler
2025-01-13 15:58:27 +01:00
committed by GitHub
parent fde9edab10
commit 7f81f37e0c
65 changed files with 4847 additions and 557 deletions
+15 -9
View File
@@ -1,4 +1,4 @@
.PHONY: install format test test-solidity test-cli test-integration test-workspace test-wasm clean docs docs-build
.PHONY: install format test test-solidity test-cli test-integration test-workspace test-wasm clean install-llvm install-llvm-builder
RUSTFLAGS_EMSCRIPTEN := \
-C link-arg=-sEXPORTED_FUNCTIONS=_main,_free,_malloc \
@@ -28,16 +28,16 @@ install-npm:
install-wasm: install-npm
RUSTFLAGS='$(RUSTFLAGS_EMSCRIPTEN)' cargo build --target wasm32-unknown-emscripten -p revive-solidity --release --no-default-features
install-llvm-builder:
cargo install --path crates/llvm-builder
install-llvm: install-llvm-builder
revive-llvm clone
revive-llvm build
test-wasm: install-wasm
npm run test:wasm
# install-revive: Build and install to the directory specified in REVIVE_INSTALL_DIR
ifeq ($(origin REVIVE_INSTALL_DIR), undefined)
REVIVE_INSTALL_DIR=`pwd`/release/revive-debian
endif
install-revive:
cargo install --path crates/solidity --root $(REVIVE_INSTALL_DIR)
format:
cargo fmt --all --check
@@ -53,11 +53,15 @@ test-solidity: install
cargo test --package revive-solidity
test-workspace: install
cargo test --workspace
cargo test --workspace --exclude revive-llvm-builder
test-cli: install
npm run test:cli
test-llvm-builder:
@echo "warning: the llvm-builder tests will take many hours"
cargo test --package revive-llvm-builder -- --test-threads=1
bench-pvm: install-bin
cargo criterion --bench execute --features bench-pvm-interpreter --message-format=json \
| criterion-table > crates/benchmarks/PVM.md
@@ -72,9 +76,11 @@ bench: install-bin
clean:
cargo clean ; \
revive-llvm clean ; \
rm -rf node_modules ; \
rm -rf crates/solidity/src/tests/cli-tests/artifacts ; \
cargo uninstall revive-solidity ; \
cargo uninstall revive-llvm-builder ; \
rm -f package-lock.json ; \
rm -rf js/dist ; \
rm -f js/src/resolc.{wasm,js}