diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index dddb7dd9..83164285 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -9,7 +9,7 @@ jobs: build: strategy: matrix: - os: [ubuntu-latest] + os: [ubuntu-22.04] runs-on: ${{ matrix.os }} steps: - uses: actions/checkout@v2 @@ -30,23 +30,36 @@ jobs: - name: Set up the Linux env run: | set -eux - sudo apt install -y llvm-15 clang-15 libgc-dev - if: matrix.os == 'ubuntu-latest' + sudo apt install -y libgc-dev + + - name: Cache LLVM and Clang + id: cache-llvm + uses: actions/cache@v3 + with: + path: | + C:/Program Files/LLVM + ./llvm + key: llvm-16.0 + - name: Install LLVM and Clang + uses: KyleMayes/install-llvm-action@v1 + with: + version: "16.0" + cached: ${{ steps.cache-llvm.outputs.cache-hit }} - name: Output versions run: | set -eux rustc --version cargo --version - clang-15 --version + clang --version - name: Build and test run: | set -eux cd lib/skc_rustlib; cargo build; cd ../../ - env -- LLC=llc-15 CLANG=clang-15 cargo run -- build-corelib - env -- LLC=llc-15 CLANG=clang-15 cargo test - env -- LLC=llc-15 CLANG=clang-15 bash release_test.sh + env -- cargo run -- build-corelib + env -- cargo test + env -- bash release_test.sh # Run cargo fmt --all -- --check format: diff --git a/Cargo.lock b/Cargo.lock index a4c05304..53f3ba3a 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -636,9 +636,9 @@ checksum = "b4668fb0ea861c1df094127ac5f1da3409a82116a4ba74fca2e58ef927159bb3" [[package]] name = "llvm-sys" -version = "150.1.2" +version = "160.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "417dbaef2fece3b186fe15704e010849279de5f7eea1caa8845558130867bdd2" +checksum = "0bf51981ac0622b10fe4790763e3de1f3d68a0ee4222e03accaaab6731bd508d" dependencies = [ "cc", "lazy_static", diff --git a/Cargo.toml b/Cargo.toml index 81764820..d09a896f 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -23,7 +23,7 @@ skc_codegen = { path = "lib/skc_codegen/" } ariadne = "0.1.5" anyhow = "1.0" -inkwell = { git = "https://github.com/TheDan64/inkwell", features = ["llvm15-0"], rev = "4030f76" } +inkwell = { git = "https://github.com/TheDan64/inkwell", features = ["llvm16-0"], rev = "4030f76" } clap = { version = "3.1.18", features = ["derive"] } either = "1.5.3" env_logger = "0.8.2" diff --git a/README.md b/README.md index 60ce9507..0fde3b59 100644 --- a/README.md +++ b/README.md @@ -110,7 +110,7 @@ See [install.md](./doc/guide/src/install.md) $ cargo test ``` -Only integration tests (test/sk/*.sk): +Only integration tests (test/sk/\*.sk): ``` $ cargo test --test integration_test @@ -128,15 +128,6 @@ With logging enabled $ RUST_LOG='trace' cargo test ``` -### Troubleshooting - -``` - /Users/yhara/.cargo/registry/src/github.com-1ecc6299db9ec823/bdwgc-alloc-0.6.0/vendor/libatomic_ops/configure: line 4683: syntax error near unexpected token `disable-shared' - /Users/yhara/.cargo/registry/src/github.com-1ecc6299db9ec823/bdwgc-alloc-0.6.0/vendor/libatomic_ops/configure: line 4683: `LT_INIT(disable-shared)' -``` - -=> `brew install libtool` - ## License MIT diff --git a/doc/guide/src/install.md b/doc/guide/src/install.md index e708f400..a5b6afa1 100644 --- a/doc/guide/src/install.md +++ b/doc/guide/src/install.md @@ -7,25 +7,25 @@ Only 64bit environments are supported. 1. Install [Git](https://git-scm.com/) 1. Install [Rust](https://www.rust-lang.org/) -1. Install LLVM 12 - - eg. `brew install llvm@12` on Mac - - eg. `sudo apt install llvm-12 clang-12` on Ubuntu +1. Install LLVM 16 + - eg. `brew install llvm@16` on Mac + - eg. `sudo apt install llvm-16 clang-16` on Ubuntu - You may need `sudo apt install cmake` on Ubuntu - (TODO) `apt install libgc-dev` needed on Ubuntu? You may need to setup some environment variables. For example, on Mac: ``` -export PATH="$(brew --prefix)/opt/llvm@12/bin":$PATH -export LDFLAGS="-L$(brew --prefix)/opt/llvm@12/lib" -export CPPFLAGS="-I$(brew --prefix)/opt/llvm@12/include" +export PATH="$(brew --prefix)/opt/llvm@16/bin":$PATH +export LDFLAGS="-L$(brew --prefix)/opt/llvm@16/lib" +export CPPFLAGS="-I$(brew --prefix)/opt/llvm@16/include" ``` and on Ubuntu: ``` -export LLC=llc-12 -export CLANG=clang-12 +export LLC=llc-16 +export CLANG=clang-16 ``` ### Compiling core library @@ -40,7 +40,7 @@ $ cd lib/skc_rustlib; cargo build; cd ../../ $ cargo run -- build-corelib ``` -The `build-corelib` subcommand compiles core classes (builtin/*.sk) into ./builtin/builtin.bc and ./builtin/exports.json. +The `build-corelib` subcommand compiles core classes (builtin/\*.sk) into ./builtin/builtin.bc and ./builtin/exports.json. ### Running a program @@ -73,3 +73,22 @@ because `shiika` looks for corelib in the current directory by default. You can ``` export SHIIKA_ROOT=/path/to/repo/of/shiika ``` + +## Troubleshooting + +``` +error: could not find native static library `Polly`, perhaps an -L flag is missing? + +error: could not compile `llvm-sys` due to previous error +``` + +=> `sudo apt install libpolly-16-dev` + +This may happen when you install llvm from https://apt.llvm.org/ . + +``` + /Users/yhara/.cargo/registry/src/github.com-1ecc6299db9ec823/bdwgc-alloc-0.6.0/vendor/libatomic_ops/configure: line 4683: syntax error near unexpected token `disable-shared' + /Users/yhara/.cargo/registry/src/github.com-1ecc6299db9ec823/bdwgc-alloc-0.6.0/vendor/libatomic_ops/configure: line 4683: `LT_INIT(disable-shared)' +``` + +=> `brew install libtool` diff --git a/lib/skc_codegen/Cargo.toml b/lib/skc_codegen/Cargo.toml index 8ecaefda..c58b85a6 100644 --- a/lib/skc_codegen/Cargo.toml +++ b/lib/skc_codegen/Cargo.toml @@ -14,6 +14,6 @@ skc_mir = { path = "../skc_mir" } anyhow = "1.0" serde = { version = "1.0.125", features = ["derive"] } serde_json = "1.0" -inkwell = { git = "https://github.com/TheDan64/inkwell", features = ["llvm15-0"], rev = "4030f76" } +inkwell = { git = "https://github.com/TheDan64/inkwell", features = ["llvm16-0"], rev = "4030f76" } either = "1.5.3" log = "0.4.11"