Skip to content
Draft
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
6 changes: 3 additions & 3 deletions .cargo/config.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[env]
LLVM_SYS_191_PREFIX = "/usr/lib/llvm-19/"
MLIR_SYS_190_PREFIX = "/usr/lib/llvm-19/"
TABLEGEN_190_PREFIX = "/usr/lib/llvm-19/"
LLVM_SYS_201_PREFIX = "/usr/lib/llvm-20/"
MLIR_SYS_200_PREFIX = "/usr/lib/llvm-20/"
TABLEGEN_200_PREFIX = "/usr/lib/llvm-20/"

# 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
14 changes: 7 additions & 7 deletions .github/workflows/replay.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@ jobs:
clippy:
runs-on: ubuntu-latest
env:
MLIR_SYS_190_PREFIX: /usr/lib/llvm-19/
LLVM_SYS_191_PREFIX: /usr/lib/llvm-19/
TABLEGEN_190_PREFIX: /usr/lib/llvm-19/
MLIR_SYS_190_PREFIX: /usr/lib/llvm-20/
LLVM_SYS_191_PREFIX: /usr/lib/llvm-20/
TABLEGEN_190_PREFIX: /usr/lib/llvm-20/
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@1.86.0
Expand All @@ -23,13 +23,13 @@ jobs:
- name: Add LLVM Debian repository
uses: myci-actions/add-deb-repo@10
with:
repo: deb http://apt.llvm.org/jammy/ llvm-toolchain-jammy-19 main
repo: deb http://apt.llvm.org/jammy/ llvm-toolchain-jammy-20 main
repo-name: llvm-repo
keys-asc: https://apt.llvm.org/llvm-snapshot.gpg.key
- name: Install lld
run: sudo apt install lld
- name: Install LLVM
run: sudo apt-get install llvm-19 llvm-19-dev llvm-19-runtime clang-19 clang-tools-19 lld-19 libpolly-19-dev libmlir-19-dev mlir-19-tools
run: sudo apt-get install llvm-20 llvm-20-dev llvm-20-runtime clang-20 clang-tools-20 lld-20 libpolly-20-dev libmlir-20-dev mlir-20-tools
- name: Run cargo clippy
run: |
cd crates/blockifier
Expand All @@ -40,7 +40,7 @@ jobs:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@nightly
with:
toolchain: nightly-2023-10-19
toolchain: nightly-2023-10-20
components: rustfmt
- name: Run cargo fmt
run: cargo +nightly-2023-10-19 fmt --all -- --check
run: cargo +nightly-2023-10-20 fmt --all -- --check
99 changes: 68 additions & 31 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -178,8 +178,8 @@ cairo-lang-sierra = "2.12.0"
cairo-lang-sierra-to-casm = "2.12.0"
cairo-lang-starknet-classes = "2.12.0"
cairo-lang-utils = "2.12.0"
cairo-native = { git = "https://github.com/lambdaclass/cairo_native", rev = "d7f8352657a4c1228b227807b90aea10f97f746d" }
sierra-emu = { git = "https://github.com/lambdaclass/cairo_native", rev = "d7f8352657a4c1228b227807b90aea10f97f746d" }
cairo-native = { git = "https://github.com/lambdaclass/cairo_native.git", rev = "a0730a8d64d43836ac8812b4eb212706f5aae14b" }
sierra-emu = { git = "https://github.com/lambdaclass/cairo_native.git", rev = "80e6b125d2d99d1301833292bf97c8ea9f82ead4" }
cairo-vm = "2.2.0"
camelpaste = "0.1.0"
chrono = "0.4.26"
Expand Down
21 changes: 0 additions & 21 deletions crates/apollo_compile_to_native/build.rs
Original file line number Diff line number Diff line change
@@ -1,23 +1,9 @@
use apollo_compilation_utils::build_utils::install_compiler_binary;

include!("src/constants.rs");

fn main() {
println!("cargo:rerun-if-changed=build.rs");

set_run_time_out_dir_env_var();
install_starknet_native_compile();
}

/// Install the `starknet-native-compile` binary from the Cairo Native crate and moves the binary
/// to the `target` directory. The `starknet-native-compile` binary is used to compile Sierra to
/// Native. The binary is executed as a subprocess whenever Sierra to Cairo compilation is required.
fn install_starknet_native_compile() {
let binary_name = CAIRO_NATIVE_BINARY_NAME;
let required_version = REQUIRED_CAIRO_NATIVE_VERSION;

let cargo_install_args = &["cairo-native", "--version", required_version, "--bin", binary_name];
install_compiler_binary(binary_name, required_version, cargo_install_args, &out_dir());
}

// Sets the `RUNTIME_ACCESSIBLE_OUT_DIR` environment variable to the `OUT_DIR` value, which will be
Expand All @@ -26,10 +12,3 @@ fn set_run_time_out_dir_env_var() {
let out_dir = std::env::var("OUT_DIR").expect("OUT_DIR is not set");
println!("cargo:rustc-env=RUNTIME_ACCESSIBLE_OUT_DIR={}", out_dir);
}

// Returns the OUT_DIR. This function is only operable at build time.
fn out_dir() -> std::path::PathBuf {
std::env::var("OUT_DIR")
.expect("Failed to get the build time OUT_DIR environment variable")
.into()
}
8 changes: 4 additions & 4 deletions scripts/dependencies.sh
Original file line number Diff line number Diff line change
Expand Up @@ -31,14 +31,14 @@ function setup_llvm_deps() {
;;
Linux)
$SUDO bash -c 'curl https://apt.llvm.org/llvm.sh -Lo llvm.sh
bash ./llvm.sh 19 all
bash ./llvm.sh 20 all
rm -f ./llvm.sh
apt update && apt install -y \
libgmp3-dev \
libmlir-19-dev \
libpolly-19-dev \
libmlir-20-dev \
libpolly-20-dev \
libzstd-dev \
mlir-19-tools
mlir-20-tools
'
;;
*)
Expand Down
Loading