diff --git a/.cargo/config.toml b/.cargo/config.toml new file mode 100644 index 0000000000..e1e04d9683 --- /dev/null +++ b/.cargo/config.toml @@ -0,0 +1,4 @@ +[env] +LLVM_SYS_181_PREFIX="/usr/lib/llvm-18/" +MLIR_SYS_180_PREFIX="/usr/lib/llvm-18/" +TABLEGEN_180_PREFIX="/usr/lib/llvm-18/" diff --git a/.github/actions/bootstrap/action.yml b/.github/actions/bootstrap/action.yml index b8366c9836..5201006e79 100644 --- a/.github/actions/bootstrap/action.yml +++ b/.github/actions/bootstrap/action.yml @@ -3,3 +3,5 @@ runs: steps: - name: Install rust. uses: ./.github/actions/install_rust + - name: Install cairo native. + uses: ./.github/actions/setup_native_deps diff --git a/.github/actions/install_rust/rust_version.txt b/.github/actions/install_rust/rust_version.txt deleted file mode 100644 index 2bf5ad0447..0000000000 --- a/.github/actions/install_rust/rust_version.txt +++ /dev/null @@ -1 +0,0 @@ -stable diff --git a/.github/actions/setup-native-deps/action.yml b/.github/actions/setup_native_deps/action.yml similarity index 53% rename from .github/actions/setup-native-deps/action.yml rename to .github/actions/setup_native_deps/action.yml index 4b9e1f4d0a..141da630c5 100644 --- a/.github/actions/setup-native-deps/action.yml +++ b/.github/actions/setup_native_deps/action.yml @@ -9,20 +9,8 @@ outputs: runs: using: "composite" steps: - - name: Make script executable - shell: bash - run: chmod +x ./scripts/setup_native_deps.sh - - name: Install Cairo Native Runtime Dependencies id: set-runtime-deps shell: bash run: | sudo ./scripts/setup_native_deps.sh - - - name: Set Environment Variables - id: set-env-vars - shell: bash - run: | - echo "MLIR_SYS_180_PREFIX=/usr/lib/llvm-18/" >> $GITHUB_ENV && - echo "LLVM_SYS_181_PREFIX=/usr/lib/llvm-18/" >> $GITHUB_ENV && - echo "TABLEGEN_180_PREFIX=/usr/lib/llvm-18/" >> $GITHUB_ENV \ No newline at end of file diff --git a/scripts/setup_native_deps.sh b/scripts/setup_native_deps.sh index 6c895ba8b4..c8011628a9 100755 --- a/scripts/setup_native_deps.sh +++ b/scripts/setup_native_deps.sh @@ -1,15 +1,14 @@ #!/bin/bash install_essential_deps_linux() { - apt-get update -y - apt-get install -y \ + apt update && apt install -y \ + ca-certificates \ curl \ + git \ + gnupg \ jq \ ripgrep \ - wget \ - ca-certificates \ - gnupg \ - git + wget } setup_llvm_deps() { @@ -29,8 +28,8 @@ setup_llvm_deps() { export TABLEGEN_180_PREFIX ;; Linux) - export DEBIAN_FRONTEND=noninteractive - export TZ=America/New_York + export DEBIAN_FRONTEND=noninteractive + export TZ=America/New_York CODENAME=$(grep VERSION_CODENAME /etc/os-release | cut -d= -f2) [ -z "$CODENAME" ] && { echo "Error: Unable to determine OS codename"; exit 1; } @@ -39,31 +38,24 @@ setup_llvm_deps() { echo "deb-src http://apt.llvm.org/$CODENAME/ llvm-toolchain-$CODENAME-18 main" >> /etc/apt/sources.list.d/llvm-18.list wget -O - https://apt.llvm.org/llvm-snapshot.gpg.key | apt-key add - - apt-get update && apt-get upgrade -y - apt-get install -y zstd - apt-get install -y llvm-18 llvm-18-dev llvm-18-runtime clang-18 clang-tools-18 lld-18 libpolly-18-dev libmlir-18-dev mlir-18-tools - apt-get install -y libgmp3-dev - - MLIR_SYS_180_PREFIX=/usr/lib/llvm-18/ - LLVM_SYS_181_PREFIX=/usr/lib/llvm-18/ - TABLEGEN_180_PREFIX=/usr/lib/llvm-18/ - - export MLIR_SYS_180_PREFIX - export LLVM_SYS_181_PREFIX - export TABLEGEN_180_PREFIX + apt update && apt install -y \ + clang-18 \ + clang-tools-18 \ + libgmp3-dev \ + libmlir-18-dev \ + libpolly-18-dev \ + lld-18 \ + llvm-18 \ + llvm-18-dev \ + llvm-18-runtime \ + mlir-18-tools \ + zstd ;; *) echo "Error: Unsupported operating system" exit 1 ;; esac - - # GitHub Actions specific - [ -n "$GITHUB_ACTIONS" ] && { - echo "MLIR_SYS_180_PREFIX=$MLIR_SYS_180_PREFIX" >> $GITHUB_ENV - echo "LLVM_SYS_181_PREFIX=$LLVM_SYS_181_PREFIX" >> $GITHUB_ENV - echo "TABLEGEN_180_PREFIX=$TABLEGEN_180_PREFIX" >> $GITHUB_ENV - } } install_rust() { @@ -112,4 +104,4 @@ main() { echo "LLVM and Cairo native runtime dependencies installed successfully." } -main "$@" \ No newline at end of file +main "$@"