Skip to content

Commit 4e9ff3f

Browse files
chore: update dependency versions, add feature for llvm 18.1 (#53)
* chore: update dependency versions * misc fix * add llvm 18 to ci * try 18.0 * back to 18.1 * add debug * vci * install required dep for llvm 18 * cargo fmt * try 18 with no rayon * put 18 back in
1 parent 452264d commit 4e9ff3f

File tree

4 files changed

+49
-29
lines changed

4 files changed

+49
-29
lines changed

.github/workflows/ci.yml

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,13 @@ on:
55
branches: [ "main" ]
66
pull_request:
77
branches: [ "main" ]
8+
workflow_dispatch:
9+
inputs:
10+
debug_enabled:
11+
type: boolean
12+
description: 'Run the build with tmate debugging enabled (https://github.com/marketplace/actions/debugging-with-tmate)'
13+
required: false
14+
default: false
815

916
env:
1017
CARGO_TERM_COLOR: always
@@ -32,7 +39,7 @@ jobs:
3239
- ["15.0", "15-0"]
3340
- ["16.0", "16-0"]
3441
- ["17.0", "17-0"]
35-
#- ["18.0", "18-0"] (next version of inkwell should support 18.1, then can be added here)
42+
- ["18.1", "18-1"]
3643
toolchain:
3744
- stable
3845
os:
@@ -86,7 +93,7 @@ jobs:
8693
path: |
8794
${{ env.CARGO_HOME }}
8895
target
89-
key: unit-test-${{ runner.os }}-${{ matrix.toolchain}}-${{ matrix.llvm }}-${{ matrix.features }}
96+
key: unit-test-${{ runner.os }}-${{ matrix.toolchain}}-${{ matrix.llvm[0] }}-${{ matrix.features }}
9097
- name: Set up Rust
9198
run: rustup default ${{ matrix.toolchain }} && rustup update ${{ matrix.toolchain }} --no-self-update && rustup component add clippy rust-docs
9299
- name: Rust version
@@ -100,6 +107,15 @@ jobs:
100107
if : matrix.os == 'macos-13'
101108
run:
102109
brew install llvm@16
110+
- name: Install dependencies (for ubuntu-latest and LLVM 18.1)
111+
if : matrix.llvm[0] == '18.1' && matrix.os == 'ubuntu-latest'
112+
run: |
113+
sudo apt update
114+
wget http://security.ubuntu.com/ubuntu/pool/universe/n/ncurses/libtinfo5_6.3-2ubuntu0.1_amd64.deb
115+
sudo apt install ./libtinfo5_6.3-2ubuntu0.1_amd64.deb
116+
- name: Setup tmate session
117+
uses: mxschmitt/action-tmate@v3
118+
if: ${{ github.event_name == 'workflow_dispatch' && inputs.debug_enabled }}
103119
- name: Run tests (LLVM)
104120
if : matrix.llvm != ''
105121
run: cargo test --verbose --features llvm${{ matrix.llvm[1] }} --features "${{ matrix.features }}"

Cargo.toml

Lines changed: 22 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ default = []
1515
llvm15-0 = ["inkwell-150", "llvm-sys-150", "llvm", "enzyme"]
1616
llvm16-0 = ["inkwell-160", "llvm-sys-160", "llvm", "enzyme"]
1717
llvm17-0 = ["inkwell-170", "llvm-sys-170", "llvm", "enzyme"]
18-
llvm18-0 = ["inkwell-180", "llvm-sys-180", "llvm", "enzyme"]
18+
llvm18-1 = ["inkwell-181", "llvm-sys-181", "llvm", "enzyme"]
1919
enzyme = ["bindgen", "cmake"]
2020
llvm = []
2121
cranelift = ["dep:cranelift", "dep:cranelift-module", "dep:cranelift-object", "dep:cranelift-jit", "dep:cranelift-native"]
@@ -24,27 +24,27 @@ rayon = ["dep:rayon"]
2424

2525
[dependencies]
2626
ndarray = { version = "=0.16.1" }
27-
anyhow = "1.0.95"
27+
anyhow = "1.0.98"
2828
approx = "0.5"
29-
pest = "2.7.15"
30-
pest_derive = "2.7.15"
29+
pest = "2.8.0"
30+
pest_derive = "2.8.0"
3131
itertools = "0.14.0"
3232
uid = "0.1.8"
33-
inkwell-150 = { package = "inkwell", version = ">=0.5.0", features = ["llvm15-0"], optional = true }
34-
inkwell-160 = { package = "inkwell", version = ">=0.5.0", features = ["llvm16-0"], optional = true }
35-
inkwell-170 = { package = "inkwell", version = ">=0.5.0", features = ["llvm17-0"], optional = true }
36-
inkwell-180 = { package = "inkwell", version = ">=0.5.0", features = ["llvm18-0"], optional = true }
37-
llvm-sys-150 = { package = "llvm-sys", version = "150.0.3", optional = true }
38-
llvm-sys-160 = { package = "llvm-sys", version = "160.1.0", optional = true }
39-
llvm-sys-170 = { package = "llvm-sys", version = "170.0.1", optional = true }
40-
llvm-sys-180 = { package = "llvm-sys", version = "180.0.0", optional = true }
41-
inkwell_internals = { version = "0.10.0", optional = true }
42-
cranelift = { version = "0.115.1", optional = true}
43-
cranelift-module = { version = "0.115.1", optional = true}
44-
cranelift-object = { version = "0.115.1", optional = true}
45-
cranelift-jit = { version = "0.115.1", optional = true}
46-
cranelift-native = { version = "0.115.1", optional = true}
47-
target-lexicon = "0.12"
33+
inkwell-150 = { package = "inkwell", version = "0.6.0", features = ["llvm15-0"], optional = true }
34+
inkwell-160 = { package = "inkwell", version = "0.6.0", features = ["llvm16-0"], optional = true }
35+
inkwell-170 = { package = "inkwell", version = "0.6.0", features = ["llvm17-0"], optional = true }
36+
inkwell-181 = { package = "inkwell", version = "0.6.0", features = ["llvm18-1"], optional = true }
37+
llvm-sys-150 = { package = "llvm-sys", version = "150.2.1", optional = true }
38+
llvm-sys-160 = { package = "llvm-sys", version = "160.2.1", optional = true }
39+
llvm-sys-170 = { package = "llvm-sys", version = "170.2.0", optional = true }
40+
llvm-sys-181 = { package = "llvm-sys", version = "181.2.0", optional = true }
41+
inkwell_internals = { version = "0.11.0", optional = true }
42+
cranelift = { version = "0.119.0", optional = true}
43+
cranelift-module = { version = "0.119.0", optional = true}
44+
cranelift-object = { version = "0.119.0", optional = true}
45+
cranelift-jit = { version = "0.119.0", optional = true}
46+
cranelift-native = { version = "0.119.0", optional = true}
47+
target-lexicon = "0.13"
4848
aliasable = "0.1.3"
4949
rayon = { version="1.10.0", optional = true }
5050
lazy_static = "1.5.0"
@@ -63,11 +63,11 @@ features = [
6363

6464
[build-dependencies]
6565
bindgen = { version = "0.71.1", optional = true }
66-
cmake = { version = "0.1.52", optional = true }
66+
cmake = { version = "0.1.54", optional = true }
6767

6868
[target.'cfg(not(target_arch = "wasm32"))'.dev-dependencies]
69-
divan = "0.1.17"
70-
env_logger = "0.11.6"
69+
divan = "0.1.21"
70+
env_logger = "0.11.8"
7171

7272
[[bench]]
7373
name = "evaluation"

src/execution/compiler.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,8 @@ impl CompilerMode {
7575
let thread_dim = std::env::var("RAYON_NUM_THREADS")
7676
.unwrap_or_else(|_| num_cpus.to_string())
7777
.parse::<usize>()
78-
.unwrap();
78+
.unwrap()
79+
.max(1);
7980
let max_threads = (number_of_states / 10).max(1);
8081
min(thread_dim, max_threads)
8182
}

src/lib.rs

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,9 @@ pub use execution::compiler::Compiler;
1616
pub use execution::cranelift::codegen::{CraneliftJitModule, CraneliftObjectModule};
1717
#[cfg(feature = "llvm")]
1818
pub use execution::llvm::codegen::LlvmModule;
19+
pub use execution::module::{
20+
CodegenModule, CodegenModuleCompile, CodegenModuleEmit, CodegenModuleJit, CodegenModuleLink,
21+
};
1922
pub use execution::object::ObjectModule;
2023

2124
#[cfg(feature = "inkwell-150")]
@@ -24,14 +27,14 @@ extern crate inkwell_150 as inkwell;
2427
extern crate inkwell_160 as inkwell;
2528
#[cfg(feature = "inkwell-170")]
2629
extern crate inkwell_170 as inkwell;
27-
#[cfg(feature = "inkwell-180")]
28-
extern crate inkwell_180 as inkwell;
30+
#[cfg(feature = "inkwell-181")]
31+
extern crate inkwell_181 as inkwell;
2932

3033
#[cfg(feature = "inkwell-150")]
3134
extern crate llvm_sys_150 as llvm_sys;
3235
#[cfg(feature = "inkwell-160")]
3336
extern crate llvm_sys_160 as llvm_sys;
3437
#[cfg(feature = "inkwell-170")]
3538
extern crate llvm_sys_170 as llvm_sys;
36-
#[cfg(feature = "inkwell-180")]
37-
extern crate llvm_sys_180 as llvm_sys;
39+
#[cfg(feature = "inkwell-181")]
40+
extern crate llvm_sys_181 as llvm_sys;

0 commit comments

Comments
 (0)