From d43b07996e3e82ed850f9d9b500ef6f4465c5ba8 Mon Sep 17 00:00:00 2001 From: DaniPopes <57450786+DaniPopes@users.noreply.github.com> Date: Thu, 21 Mar 2024 04:29:10 +0100 Subject: [PATCH] ci: print llvm-config --- .github/workflows/ci.yml | 4 ++- Cargo.lock | 52 ++++++++++++++-------------- crates/revm-jit-cranelift/Cargo.toml | 8 ++--- crates/revm-jit/Cargo.toml | 6 ++++ crates/revm-jit/src/bytecode.rs | 2 +- crates/revm-jit/src/lib.rs | 5 +++ crates/revm-jit/src/main.rs | 8 ++--- 7 files changed, 48 insertions(+), 37 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 5ab7bc8..729c032 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -23,12 +23,14 @@ jobs: - uses: KyleMayes/install-llvm-action@v1 with: version: ${{ env.LLVM_VERSION }} + - name: llvm-config + run: llvm-config --version --bindir --libdir - uses: dtolnay/rust-toolchain@stable - uses: Swatinem/rust-cache@v2 with: cache-on-failure: true - name: test - run: cargo test --workspace + run: cargo test --all-features --workspace --verbose feature-checks: runs-on: ubuntu-latest diff --git a/Cargo.lock b/Cargo.lock index 6a008de..ee95bde 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -425,9 +425,9 @@ dependencies = [ [[package]] name = "cranelift" -version = "0.105.3" +version = "0.106.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6d8964676f9a0165edbdb7650344acb73d4decd590685f0964b6109b3691fff8" +checksum = "bf6f4efd94998d1260cea289fe1fbe5ab0fc0df463069849f3837b84c70ee807" dependencies = [ "cranelift-codegen", "cranelift-frontend", @@ -435,18 +435,18 @@ dependencies = [ [[package]] name = "cranelift-bforest" -version = "0.105.3" +version = "0.106.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "16d5521e2abca66bbb1ddeecbb6f6965c79160352ae1579b39f8c86183895c24" +checksum = "6a535eb1cf5a6003197dc569320c40c1cb2d2f97ef5d5348eebf067f20957381" dependencies = [ "cranelift-entity", ] [[package]] name = "cranelift-codegen" -version = "0.105.3" +version = "0.106.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ef40a4338a47506e832ac3e53f7f1375bc59351f049a8379ff736dd02565bd95" +checksum = "11b5066db32cec1492573827183af2142d2d88fe85a83cfc9e73f0f63d3788d4" dependencies = [ "bumpalo", "cranelift-bforest", @@ -465,39 +465,39 @@ dependencies = [ [[package]] name = "cranelift-codegen-meta" -version = "0.105.3" +version = "0.106.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d24cd5d85985c070f73dfca07521d09086362d1590105ba44b0932bf33513b61" +checksum = "64942e5774308e835fbad4dd25f253105412c90324631910e1ec27963147bddb" dependencies = [ "cranelift-codegen-shared", ] [[package]] name = "cranelift-codegen-shared" -version = "0.105.3" +version = "0.106.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e0584c4363e3aa0a3c7cb98a778fbd5326a3709f117849a727da081d4051726c" +checksum = "c39c33db9a86dd6d8d04166a10c53deb477aeea3500eaaefca682e4eda9bb986" [[package]] name = "cranelift-control" -version = "0.105.3" +version = "0.106.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f25ecede098c6553fdba362a8e4c9ecb8d40138363bff47f9712db75be7f0571" +checksum = "4b7fc4937613aea3156a0538800a17bf56f345a5da2e79ae3df58488c93d867f" dependencies = [ "arbitrary", ] [[package]] name = "cranelift-entity" -version = "0.105.3" +version = "0.106.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6ea081a42f25dc4c5b248b87efdd87dcd3842a1050a37524ec5391e6172058cb" +checksum = "f85575e79a153ce1ddbfb7fe1813519b4bfe1eb200cc9c8353b45ad123ae4d36" [[package]] name = "cranelift-frontend" -version = "0.105.3" +version = "0.106.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9796e712f5af797e247784f7518e6b0a83a8907d73d51526982d86ecb3a58b68" +checksum = "bbc31d6c0ab2249fe0c21e988256b42f5f401ab2673b4fc40076c82a698bdfb9" dependencies = [ "cranelift-codegen", "log", @@ -507,15 +507,15 @@ dependencies = [ [[package]] name = "cranelift-isle" -version = "0.105.3" +version = "0.106.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f4a66ccad5782f15c80e9dd5af0df4acfe6e3eee98e8f7354a2e5c8ec3104bdd" +checksum = "dc14f37e3314c0e4c53779c2f46753bf242efff76ee9473757a1fff3b495ad37" [[package]] name = "cranelift-jit" -version = "0.105.3" +version = "0.106.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dabad94c317b89a8300e9c48ee4715ffc0c1235ec94cf6bb71aa12511cb1afe8" +checksum = "cfdd1942f3233176a68c285380dbc84ff0440246a1bce308611c0a385b56ab18" dependencies = [ "anyhow", "cranelift-codegen", @@ -533,9 +533,9 @@ dependencies = [ [[package]] name = "cranelift-module" -version = "0.105.3" +version = "0.106.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7d4f782914c709b021e76475516358e64287d17e950113e051468ccf9ca8ff43" +checksum = "121b2b5a16912554a1b9aace75b9b21eca49f28e33cbfbad4786dd9bc5361a5c" dependencies = [ "anyhow", "cranelift-codegen", @@ -544,9 +544,9 @@ dependencies = [ [[package]] name = "cranelift-native" -version = "0.105.3" +version = "0.106.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "285e80df1d9b79ded9775b285df68b920a277b84f88a7228d2f5bc31fcdc58eb" +checksum = "2ea5375f76ab31f9800a23fb2b440810286a6f669a3eb467cdd7ff255ea64268" dependencies = [ "cranelift-codegen", "libc", @@ -1854,9 +1854,9 @@ checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423" [[package]] name = "wasmtime-jit-icache-coherence" -version = "18.0.3" +version = "19.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "866634605089b4632b32226b54aa3670d72e1849f9fc425c7e50b3749c2e6df3" +checksum = "2796e4b4989db62899d2117e1e0258b839d088c044591b14e3a0396e7b3ae53a" dependencies = [ "cfg-if", "libc", diff --git a/crates/revm-jit-cranelift/Cargo.toml b/crates/revm-jit-cranelift/Cargo.toml index 14521f8..3fa4356 100644 --- a/crates/revm-jit-cranelift/Cargo.toml +++ b/crates/revm-jit-cranelift/Cargo.toml @@ -21,9 +21,9 @@ revm-jit-core.workspace = true revm-primitives.workspace = true -cranelift = "0.105" -cranelift-jit = "0.105" -cranelift-module = "0.105" -cranelift-native = "0.105" +cranelift = "0.106" +cranelift-jit = "0.106" +cranelift-module = "0.106" +cranelift-native = "0.106" color-eyre.workspace = true diff --git a/crates/revm-jit/Cargo.toml b/crates/revm-jit/Cargo.toml index b7e594b..93e41aa 100644 --- a/crates/revm-jit/Cargo.toml +++ b/crates/revm-jit/Cargo.toml @@ -30,3 +30,9 @@ color-eyre.workspace = true default = ["llvm"] llvm = ["dep:revm-jit-llvm"] cranelift = ["dep:revm-jit-cranelift"] + +[[bin]] +name = "revm-jit" +path = "src/main.rs" +required-features = ["llvm"] +doc = false diff --git a/crates/revm-jit/src/bytecode.rs b/crates/revm-jit/src/bytecode.rs index e2e3472..791c157 100644 --- a/crates/revm-jit/src/bytecode.rs +++ b/crates/revm-jit/src/bytecode.rs @@ -77,7 +77,7 @@ impl<'a> Iterator for RawBytecodeIter<'a> { impl std::iter::FusedIterator for RawBytecodeIter<'_> {} -/// An opcode and its immediate data. Returned by [`RawBytecodeIterator`]. +/// An opcode and its immediate data. Returned by [`RawBytecodeIter`]. #[derive(Clone, Copy, PartialEq, Eq, PartialOrd, Ord)] pub struct RawOpcode<'a> { /// The opcode. diff --git a/crates/revm-jit/src/lib.rs b/crates/revm-jit/src/lib.rs index a4fbe81..a4f40d7 100644 --- a/crates/revm-jit/src/lib.rs +++ b/crates/revm-jit/src/lib.rs @@ -21,6 +21,11 @@ pub use cranelift::JitEvmCraneliftBackend; #[doc(inline)] pub use revm_jit_cranelift as cranelift; +#[doc(no_inline)] +pub use revm_interpreter as interpreter; +#[doc(no_inline)] +pub use revm_primitives as primitives; + mod compiler; pub use compiler::JitEvm; diff --git a/crates/revm-jit/src/main.rs b/crates/revm-jit/src/main.rs index 1552fb0..d574383 100644 --- a/crates/revm-jit/src/main.rs +++ b/crates/revm-jit/src/main.rs @@ -1,9 +1,7 @@ #![allow(missing_docs)] use revm_interpreter::opcode as op; -use revm_jit::JitEvm; -use revm_jit_core::{ContextStack, Ret}; -use revm_jit_llvm::JitEvmLlvmBackend; +use revm_jit::{ContextStack, JitEvm, Ret}; use std::path::PathBuf; fn main() -> color_eyre::Result<()> { @@ -13,8 +11,8 @@ fn main() -> color_eyre::Result<()> { let _ = color_eyre::install(); // Build the compiler. - let context = revm_jit_llvm::inkwell::context::Context::create(); - let backend = JitEvmLlvmBackend::new(&context).unwrap(); + let context = revm_jit::llvm::inkwell::context::Context::create(); + let backend = revm_jit::llvm::JitEvmLlvmBackend::new(&context).unwrap(); let mut jit = JitEvm::new(backend); jit.dump_to(Some(PathBuf::from("./target/")));