From 7427d482a0e5ad40e2492a100cb8ecc1db4c6204 Mon Sep 17 00:00:00 2001 From: dorimedini-starkware Date: Tue, 1 Oct 2024 10:56:35 +0300 Subject: [PATCH] feat: dependencies.sh script for dev onboarding (#1116) * feat: dependencies.sh script for dev onboarding Co-Authored-By: alon.dotan --- .github/actions/setup_native_deps/action.yml | 2 +- .github/workflows/blockifier_ci.yml | 1 + .github/workflows/blockifier_compiled_cairo.yml | 2 ++ .github/workflows/blockifier_post-merge.yml | 1 + .github/workflows/committer_ci.yml | 2 ++ .github/workflows/merge_paths_ci.yml | 2 ++ .github/workflows/papyrus_ci.yml | 2 ++ .github/workflows/papyrus_docker-publish.yml | 2 ++ Dockerfile | 2 +- scripts/{setup_native_deps.sh => dependencies.sh} | 5 ----- scripts/install_build_tools.sh | 2 +- scripts/sequencer-ci.Dockerfile | 2 +- 12 files changed, 16 insertions(+), 9 deletions(-) rename scripts/{setup_native_deps.sh => dependencies.sh} (83%) diff --git a/.github/actions/setup_native_deps/action.yml b/.github/actions/setup_native_deps/action.yml index 141da630c5..e0e4c7e55d 100644 --- a/.github/actions/setup_native_deps/action.yml +++ b/.github/actions/setup_native_deps/action.yml @@ -13,4 +13,4 @@ runs: id: set-runtime-deps shell: bash run: | - sudo ./scripts/setup_native_deps.sh + sudo ./scripts/dependencies.sh diff --git a/.github/workflows/blockifier_ci.yml b/.github/workflows/blockifier_ci.yml index 24af56bf6d..264536fb54 100644 --- a/.github/workflows/blockifier_ci.yml +++ b/.github/workflows/blockifier_ci.yml @@ -29,6 +29,7 @@ on: - 'crates/blockifier/**' - 'crates/native_blockifier/**' - 'scripts/build_native_blockifier.sh' + - 'scripts/dependencies.sh' - 'scripts/install_build_tools.sh' - 'scripts/sequencer-ci.Dockerfile' diff --git a/.github/workflows/blockifier_compiled_cairo.yml b/.github/workflows/blockifier_compiled_cairo.yml index 916837c897..63696c966f 100644 --- a/.github/workflows/blockifier_compiled_cairo.yml +++ b/.github/workflows/blockifier_compiled_cairo.yml @@ -13,6 +13,7 @@ on: - 'crates/blockifier/src/test_utils/cairo_compile.rs' - 'crates/blockifier/tests/feature_contracts_compatibility_test.rs' - 'crates/blockifier/tests/requirements.txt' + - 'scripts/dependencies.sh' pull_request: types: - opened @@ -24,6 +25,7 @@ on: - 'crates/blockifier/src/test_utils/cairo_compile.rs' - 'crates/blockifier/tests/feature_contracts_compatibility_test.rs' - 'crates/blockifier/tests/requirements.txt' + - 'scripts/dependencies.sh' # On PR events, cancel existing CI runs on this same PR for this workflow. concurrency: diff --git a/.github/workflows/blockifier_post-merge.yml b/.github/workflows/blockifier_post-merge.yml index 1afff5e93e..0f7a5c8433 100644 --- a/.github/workflows/blockifier_post-merge.yml +++ b/.github/workflows/blockifier_post-merge.yml @@ -8,6 +8,7 @@ on: - '.github/workflows/blockifier_post-merge.yml' - 'crates/blockifier/**' - 'crates/native_blockifier/**' + - 'scripts/dependencies.sh' jobs: if_merged: diff --git a/.github/workflows/committer_ci.yml b/.github/workflows/committer_ci.yml index deeab30a13..6ae36007ac 100644 --- a/.github/workflows/committer_ci.yml +++ b/.github/workflows/committer_ci.yml @@ -15,6 +15,7 @@ on: - 'crates/starknet_api/**' - 'crates/starknet_committer/**' - 'crates/starknet_patricia/**' + - 'scripts/dependencies.sh' pull_request: types: @@ -31,6 +32,7 @@ on: - 'crates/starknet_api/**' - 'crates/starknet_committer/**' - 'crates/starknet_patricia/**' + - 'scripts/dependencies.sh' # On PR events, cancel existing CI runs on this same PR for this workflow. concurrency: diff --git a/.github/workflows/merge_paths_ci.yml b/.github/workflows/merge_paths_ci.yml index 65e11b51f2..e1e27e676f 100644 --- a/.github/workflows/merge_paths_ci.yml +++ b/.github/workflows/merge_paths_ci.yml @@ -9,6 +9,7 @@ on: - v[0-9].** paths: - '.github/workflows/merge_paths_ci.yml' + - 'scripts/dependencies.sh' - 'scripts/merge_branches.py' - 'scripts/merge_paths.json' - 'scripts/merge_paths_test.py' @@ -23,6 +24,7 @@ on: - edited paths: - '.github/workflows/merge_paths_ci.yml' + - 'scripts/dependencies.sh' - 'scripts/merge_branches.py' - 'scripts/merge_paths.json' - 'scripts/merge_paths_test.py' diff --git a/.github/workflows/papyrus_ci.yml b/.github/workflows/papyrus_ci.yml index 1c0764b284..9aa94efc4e 100644 --- a/.github/workflows/papyrus_ci.yml +++ b/.github/workflows/papyrus_ci.yml @@ -12,6 +12,7 @@ on: - 'crates/papyrus**/**' - 'crates/sequencing/**' - 'crates/starknet_client/**' + - 'scripts/dependencies.sh' pull_request: types: @@ -29,6 +30,7 @@ on: - 'crates/papyrus**/**' - 'crates/sequencing/**' - 'crates/starknet_client/**' + - 'scripts/dependencies.sh' merge_group: types: [ checks_requested ] diff --git a/.github/workflows/papyrus_docker-publish.yml b/.github/workflows/papyrus_docker-publish.yml index 9ddcdfb3b3..9c27c5bc25 100644 --- a/.github/workflows/papyrus_docker-publish.yml +++ b/.github/workflows/papyrus_docker-publish.yml @@ -8,11 +8,13 @@ on: paths: - '.github/workflows/papyrus_docker-publish.yml' - 'crates/papyrus**/**' + - 'scripts/dependencies.sh' pull_request: paths: - '.github/workflows/papyrus_docker-publish.yml' - 'crates/papyrus**/**' + - 'scripts/dependencies.sh' # On PR events, cancel existing CI runs on this same PR for this workflow. concurrency: diff --git a/Dockerfile b/Dockerfile index b4f890ca32..f3dc0803a5 100644 --- a/Dockerfile +++ b/Dockerfile @@ -11,7 +11,7 @@ FROM ubuntu:22.04 AS base WORKDIR /app COPY scripts/install_build_tools.sh . -COPY scripts/setup_native_deps.sh . +COPY scripts/dependencies.sh . RUN apt update && apt -y install curl bzip2 diff --git a/scripts/setup_native_deps.sh b/scripts/dependencies.sh similarity index 83% rename from scripts/setup_native_deps.sh rename to scripts/dependencies.sh index b415b7e18f..2577f7c870 100755 --- a/scripts/setup_native_deps.sh +++ b/scripts/dependencies.sh @@ -27,11 +27,6 @@ function setup_llvm_deps() { Darwin) brew update brew install llvm@18 - - export LIBRARY_PATH=/opt/homebrew/lib - export MLIR_SYS_180_PREFIX="$(brew --prefix llvm@18)" - export LLVM_SYS_181_PREFIX="$MLIR_SYS_180_PREFIX" - export TABLEGEN_180_PREFIX="$MLIR_SYS_180_PREFIX" ;; Linux) $SUDO bash -c 'curl https://apt.llvm.org/llvm.sh -Lo llvm.sh diff --git a/scripts/install_build_tools.sh b/scripts/install_build_tools.sh index 222aea3c5b..e9b649b45c 100755 --- a/scripts/install_build_tools.sh +++ b/scripts/install_build_tools.sh @@ -52,4 +52,4 @@ install_common_packages install_pypy & install_rust & wait -./setup_native_deps.sh +./dependencies.sh diff --git a/scripts/sequencer-ci.Dockerfile b/scripts/sequencer-ci.Dockerfile index 26d64cf667..77a9902dff 100644 --- a/scripts/sequencer-ci.Dockerfile +++ b/scripts/sequencer-ci.Dockerfile @@ -17,6 +17,6 @@ ENV CARGO_HOME=${RUSTUP_HOME} ENV PATH=$PATH:${RUSTUP_HOME}/bin COPY install_build_tools.sh . -COPY setup_native_deps.sh . +COPY dependencies.sh . RUN ./install_build_tools.sh