Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ci: add native runtime env #783

Merged
merged 2 commits into from
Dec 6, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 7 additions & 2 deletions .cargo/config.toml
Original file line number Diff line number Diff line change
@@ -1,8 +1,13 @@
# Required to have the proper environment variables set to
# build the starkware-libs/sequencer dependencies with Native mode.

[env]
CAIRO_NATIVE_RUNTIME_LIBRARY = "./libcairo_native_runtime.a"
# The `CAIRO_NATIVE_RUNTIME_LIBRARY` env variable must point to an _ABSOLUTE_ path where
# the `libcairo_native_runtime.a` file will be stored and found.
#
# Since the runtime is built by the blockifier crate's build script, it will be stored
# in blockifier's build directory, unless an absolute path is provided through this env variable.
# This variable must be set before running `cargo build` or `cargo test`,
# to overwrite what might be defined in a `config.toml` file.

# Use `lld` for linking instead of `ld`, since we run out of memory while linking with `ld` on
# 16-cores linux machines, see:
Expand Down
7 changes: 7 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,11 @@ KKRT_V0_BUILD_ARTIFACT_URL = $(shell curl -L https://api.github.com/repos/kkrt-l
# Kakarot SSJ artifacts for precompiles
KKRT_SSJ_BUILD_ARTIFACT_URL = $(shell curl -L https://api.github.com/repos/kkrt-labs/kakarot-ssj/releases/latest | jq -r '.assets[0].browser_download_url')

# Note: the `CAIRO_NATIVE_RUNTIME_LIBRARY` env variable must be set to the absolute path to the
# `libcairo_native_runtime.a` file. This is because we use the `native` feature of the `blockifier`
# crate, which requires the runtime to be available.
export CAIRO_NATIVE_RUNTIME_LIBRARY=$(HOME)/.cargo/libcairo_native_runtime.a

# Downloads and unpacks Ethereum Foundation tests in the `$(EF_TESTS_DIR)` directory.
# Requires `wget` and `tar`
$(EF_TESTS_DIR):
Expand All @@ -27,6 +32,7 @@ $(EF_TESTS_DIR):

# Ensures the commands for $(EF_TESTS_DIR) always run on `make setup`, regardless if the directory exists
.PHONY: $(EF_TESTS_DIR) build

setup: $(EF_TESTS_DIR)

setup-kakarot-v0: clean-kakarot-v0
Expand Down Expand Up @@ -74,6 +80,7 @@ tests-v0-ci: build
tests-v1-ci: build
cargo test --test tests --lib --no-fail-fast --quiet --features "v1,ci"


# Runs ef tests only with the `v0` feature
ef-test-v0: build
cargo test --test tests --no-fail-fast --quiet --features "v0,ci"
Expand Down
60 changes: 0 additions & 60 deletions scripts/dependencies.sh

This file was deleted.