Skip to content
This repository has been archived by the owner on Mar 20, 2024. It is now read-only.

Commit

Permalink
Upgrade llvm-sys to 17.0.1
Browse files Browse the repository at this point in the history
Fixes: #431
  • Loading branch information
ksolana committed Mar 13, 2024
1 parent 8af22c3 commit aa6b5b0
Show file tree
Hide file tree
Showing 9 changed files with 38 additions and 20 deletions.
8 changes: 4 additions & 4 deletions .github/workflows/llvm-ci-pre-land.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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 }}

Expand All @@ -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 }}

Expand All @@ -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 }}
4 changes: 2 additions & 2 deletions .github/workflows/unit-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ jobs:
env:
SCCACHE_GHA_ENABLED: "true"
RUSTC_WRAPPER: "sccache"
LLVM_SYS_150_PREFIX: ${{ env.MOVE_DEV_PATH }}
LLVM_SYS_170_PREFIX: ${{ env.MOVE_DEV_PATH }}
PLATFORM_TOOLS_ROOT: ${{ env.PLATFORM_TOOLS_PATH }}

- name: build move-ir-compiler
Expand All @@ -60,5 +60,5 @@ jobs:
env:
SCCACHE_GHA_ENABLED: "true"
RUSTC_WRAPPER: "sccache"
LLVM_SYS_150_PREFIX: ${{ env.MOVE_DEV_PATH }}
LLVM_SYS_170_PREFIX: ${{ env.MOVE_DEV_PATH }}
PLATFORM_TOOLS_ROOT: ${{ env.PLATFORM_TOOLS_PATH }}
13 changes: 10 additions & 3 deletions Cargo.lock

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

2 changes: 1 addition & 1 deletion language/solana/llvm-extra-sys/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
4 changes: 2 additions & 2 deletions language/solana/llvm-extra-sys/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
2 changes: 1 addition & 1 deletion language/solana/move-to-solana/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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" }
Expand Down
2 changes: 1 addition & 1 deletion language/tools/move-mv-llvm-compiler/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
11 changes: 11 additions & 0 deletions language/tools/move-mv-llvm-compiler/docs/Administration.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
12 changes: 6 additions & 6 deletions language/tools/move-mv-llvm-compiler/docs/Development.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ Known working revision:
Export two environment variables:

- `PLATFORM_TOOLS_ROOT` - the path at which `platform-tools` was extracted
- `LLVM_SYS_150_PREFIX` - the path at which `move-dev` tools was extracted (as it has llvm binaries, including llvm-config that llvm-sys can use)
- `LLVM_SYS_170_PREFIX` - the path at which `move-dev` tools was extracted (as it has llvm binaries, including llvm-config that llvm-sys can use)

### After a toolchain update

Expand Down Expand Up @@ -55,13 +55,13 @@ $ tar -xf platform-tools-linux-x86_64.tar.bz2
$ ls /path/to/platform-tools/releases/v1.39/platform-tools
llvm rust version.md
$ export PLATFORM_TOOLS_ROOT=/path/to/platform-tools/releases/v1.39/platform-tools
$ LLVM_SYS_150_PREFIX=/path/to/platform-tools/releases/v1.39/move-dev
$ LLVM_SYS_170_PREFIX=/path/to/platform-tools/releases/v1.39/move-dev
```

## Building

```sh
# export LLVM_SYS_150_PREFIX (See Instructions to get move-dev tools)
# export LLVM_SYS_170_PREFIX (See Instructions to get move-dev tools)
# export PLATFORM_TOOLS_ROOT (See Instructions to get solana-labs/platform-tools)
cargo build -p move-ir-compiler -p move-compiler -p move-stdlib
```
Expand All @@ -80,7 +80,7 @@ These test require the `move-ir-compiler` and `move-build` tools (See: [Build in
Run the tests with any of these commands:

```sh
# export LLVM_SYS_150_PREFIX (See Instructions to build solana-labs/llvm-project)
# export LLVM_SYS_170_PREFIX (See Instructions to build solana-labs/llvm-project)
# export PLATFORM_TOOLS_ROOT (See Instructions to get solana-labs/platform-tools)
cargo test -p move-mv-llvm-compiler --test ir-tests
cargo test -p move-mv-llvm-compiler --test move-ir-tests
Expand Down Expand Up @@ -111,7 +111,7 @@ locally if you make changes to move-stdlib for example.
- `move-unit-test-framework-tests-solana` - Solana-based move unit test framework tests

```sh
# export LLVM_SYS_150_PREFIX (See Instructions to build solana-labs/llvm-project)
# export LLVM_SYS_170_PREFIX (See Instructions to build solana-labs/llvm-project)
# export PLATFORM_TOOLS_ROOT (See Instructions to get solana-labs/platform-tools)
# export MOVE_NATIVE=/path/to/move-repo/language/move-native
cargo test --features solana-backend -p move-cli --test build_testsuite_solana --test move_unit_tests_solana -- --test-threads 1
Expand Down Expand Up @@ -193,7 +193,7 @@ To debug in VS Code add this config:
"RUST_BACKTRACE": "all",
"RUST_LOG": "debug",
"CARGO_MANIFEST_DIR": "something like /home/sol/work/git/move/language/tools/move-mv-llvm-compiler",
"LLVM_SYS_150_PREFIX": "something like /home/sol/work/git/platform-tools/out/rust/build/x86_64-unknown-linux-gnu/llvm",
"LLVM_SYS_170_PREFIX": "something like /home/sol/work/git/platform-tools/out/rust/build/x86_64-unknown-linux-gnu/llvm",
"PLATFORM_TOOLS_ROOT": "something like /home/sol/work/git/platform-tools/out/deploy"
},
"program": "something like /home/sol/work/git/move/target/debug/deps/dwarf_tests-XXXXXXXXXXXXXXXX",
Expand Down

0 comments on commit aa6b5b0

Please sign in to comment.