From 38394a18c6607fc64c5c5cf85b178572065a30c4 Mon Sep 17 00:00:00 2001 From: ksolana <110843012+ksolana@users.noreply.github.com> Date: Wed, 13 Mar 2024 09:59:14 -0700 Subject: [PATCH] Upgrade llvm-sys to 17.0.1 Fixes: #431 --- .github/workflows/llvm-ci-pre-land.yml | 8 ++++---- Cargo.lock | 13 ++++++++++--- language/solana/llvm-extra-sys/Cargo.toml | 2 +- language/solana/llvm-extra-sys/build.rs | 4 ++-- language/solana/move-to-solana/Cargo.toml | 2 +- language/tools/move-mv-llvm-compiler/Cargo.toml | 2 +- .../move-mv-llvm-compiler/docs/Administration.md | 11 +++++++++++ 7 files changed, 30 insertions(+), 12 deletions(-) diff --git a/.github/workflows/llvm-ci-pre-land.yml b/.github/workflows/llvm-ci-pre-land.yml index 0ffbd9e857d..96d08b0342d 100644 --- a/.github/workflows/llvm-ci-pre-land.yml +++ b/.github/workflows/llvm-ci-pre-land.yml @@ -59,7 +59,7 @@ jobs: - name: cargo clippy run: cargo xclippy --workspace --all-targets env: - LLVM_SYS_150_PREFIX: ${{ env.MOVE_DEV_PATH }} + LLVM_SYS_170_PREFIX: ${{ env.MOVE_DEV_PATH }} PLATFORM_TOOLS_ROOT: ${{ env.PLATFORM_TOOLS_PATH }} - name: cargo fmt run: cargo xfmt --check @@ -85,7 +85,7 @@ jobs: - name: run Solana-based move cli tests run: "cargo test --features solana-backend -p move-cli --test build_testsuite_solana --test move_unit_tests_solana -- --test-threads 1" env: - LLVM_SYS_150_PREFIX: ${{ env.MOVE_DEV_PATH }} + LLVM_SYS_170_PREFIX: ${{ env.MOVE_DEV_PATH }} MOVE_NATIVE: ${{ env.MOVE_NATIVE_PATH }} PLATFORM_TOOLS_ROOT: ${{ env.PLATFORM_TOOLS_PATH }} @@ -107,7 +107,7 @@ jobs: - name: run Solana-based move stdlib tests run: "cargo run --features solana-backend -p move-cli --bin move -- test --solana -p language/move-stdlib" env: - LLVM_SYS_150_PREFIX: ${{ env.MOVE_DEV_PATH }} + LLVM_SYS_170_PREFIX: ${{ env.MOVE_DEV_PATH }} MOVE_NATIVE: ${{ env.MOVE_NATIVE_PATH }} PLATFORM_TOOLS_ROOT: ${{ env.PLATFORM_TOOLS_PATH }} @@ -129,6 +129,6 @@ jobs: - name: run Solana-based move unit test framework tests run: "cargo test --features solana-backend -p move-unit-test --test move_unit_test_testsuite -- --test-threads 1" env: - LLVM_SYS_150_PREFIX: ${{ env.MOVE_DEV_PATH }} + LLVM_SYS_170_PREFIX: ${{ env.MOVE_DEV_PATH }} MOVE_NATIVE: ${{ env.MOVE_NATIVE_PATH }} PLATFORM_TOOLS_ROOT: ${{ env.PLATFORM_TOOLS_PATH }} diff --git a/Cargo.lock b/Cargo.lock index f62c0b2c63a..6647941401b 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -3680,14 +3680,15 @@ dependencies = [ [[package]] name = "llvm-sys" -version = "150.0.3" +version = "170.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fab12165825f9fe4a9afa32c17bf55a4014a7f0385c5969975f2d04d36cd611c" +checksum = "eed90f72df5504c0af2e3a08ee7762a4a3e42ec2605811fc19f64879de40c50a" dependencies = [ + "anyhow", "cc", "lazy_static 1.4.0", "libc", - "regex", + "regex-lite", "semver 1.0.17", ] @@ -6320,6 +6321,12 @@ dependencies = [ "regex-syntax", ] +[[package]] +name = "regex-lite" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "30b661b2f27137bdbc16f00eda72866a92bb28af1753ffbd56744fb6e2e9cd8e" + [[package]] name = "regex-syntax" version = "0.6.25" diff --git a/language/solana/llvm-extra-sys/Cargo.toml b/language/solana/llvm-extra-sys/Cargo.toml index 041943ffa03..2c416c89f24 100644 --- a/language/solana/llvm-extra-sys/Cargo.toml +++ b/language/solana/llvm-extra-sys/Cargo.toml @@ -9,7 +9,7 @@ edition = "2021" [dependencies] libc = "0.2" -llvm-sys = "150.0.3" +llvm-sys = "170.0.1" [build-dependencies] cc = "1.0.78" diff --git a/language/solana/llvm-extra-sys/build.rs b/language/solana/llvm-extra-sys/build.rs index 214843dd621..9de8e1b6f3b 100644 --- a/language/solana/llvm-extra-sys/build.rs +++ b/language/solana/llvm-extra-sys/build.rs @@ -7,8 +7,8 @@ use std::{path::PathBuf, process::Command}; fn main() -> anyhow::Result<()> { // Get the path to llvm-config from the llvm-sys crate - let llvm_config_path = std::env::var("DEP_LLVM_15_CONFIG_PATH") - .context("DEP_LLVM_15_CONFIG_PATH not set") + let llvm_config_path = std::env::var("DEP_LLVM_17_CONFIG_PATH") + .context("DEP_LLVM_17_CONFIG_PATH not set") .context("this probably means the llvm-sys build failed")?; let llvm_config_path = PathBuf::from(llvm_config_path); let llvm_config = LlvmConfig::new(llvm_config_path); diff --git a/language/solana/move-to-solana/Cargo.toml b/language/solana/move-to-solana/Cargo.toml index 14e7ff5e5a9..1d8b9ccba9a 100644 --- a/language/solana/move-to-solana/Cargo.toml +++ b/language/solana/move-to-solana/Cargo.toml @@ -22,7 +22,7 @@ extension-trait = "1.0.1" itertools = "0.10" libc = "0.2" llvm-extra-sys = { path = "../llvm-extra-sys" } -llvm-sys = "150.0.3" +llvm-sys = "170.0.1" log = "0.4.14" move-binary-format = { path = "../../move-binary-format" } move-bytecode-source-map = { path = "../../move-ir-compiler/move-bytecode-source-map" } diff --git a/language/tools/move-mv-llvm-compiler/Cargo.toml b/language/tools/move-mv-llvm-compiler/Cargo.toml index 823b435ab1f..5070a339557 100644 --- a/language/tools/move-mv-llvm-compiler/Cargo.toml +++ b/language/tools/move-mv-llvm-compiler/Cargo.toml @@ -38,7 +38,7 @@ move-to-solana = { path = "../../solana/move-to-solana" } clap = { version = "3.1.8", features = ["derive"] } #inkwell = { git = "https://github.com/TheDan64/inkwell", branch = "master", features = ["llvm14-0"] } semver = "1.0.13" -llvm-sys = "150.0.3" +llvm-sys = "170.0.1" llvm-extra-sys = { path = "../../solana/llvm-extra-sys" } extension-trait = "1.0.1" num = "0.4.0" diff --git a/language/tools/move-mv-llvm-compiler/docs/Administration.md b/language/tools/move-mv-llvm-compiler/docs/Administration.md index 1437dea8d8c..0decc3fb89a 100644 --- a/language/tools/move-mv-llvm-compiler/docs/Administration.md +++ b/language/tools/move-mv-llvm-compiler/docs/Administration.md @@ -27,3 +27,14 @@ to link issue with their PR. [Frequently] Visit relevant move-language, sui, and aptos discord channels. [As needed] Update solana-labs/#proj-move of major updates. + +## Migration +### Toolchain migration to keep up with solana platform tools and move-dev tools + +### Upgrading llvm-sys +1. create a github issue to track the progress +1. grep for all llvm-sys deps and migrate all of them at once +1. fix build errors +1. update the documentation +1. update the ci scripts +1. announce in discord