From 78d87bfa917029b0cc037c6e3d033c8f2839370f Mon Sep 17 00:00:00 2001 From: jackwener Date: Sat, 28 Jan 2023 12:02:41 +0800 Subject: [PATCH] chore: update cranelift-module --- datafusion/common/Cargo.toml | 2 +- datafusion/jit/src/jit.rs | 21 +++++++++++++++------ 2 files changed, 16 insertions(+), 7 deletions(-) diff --git a/datafusion/common/Cargo.toml b/datafusion/common/Cargo.toml index b2bd45310eea..d75747f807a5 100644 --- a/datafusion/common/Cargo.toml +++ b/datafusion/common/Cargo.toml @@ -42,7 +42,7 @@ pyarrow = ["pyo3", "arrow/pyarrow"] apache-avro = { version = "0.14", default-features = false, features = ["snappy"], optional = true } arrow = { version = "31.0.0", default-features = false } chrono = { version = "0.4", default-features = false } -cranelift-module = { version = "0.89.0", optional = true } +cranelift-module = { version = "0.92.0", optional = true } num_cpus = "1.13.0" object_store = { version = "0.5.0", default-features = false, optional = true } parquet = { version = "31.0.0", default-features = false, optional = true } diff --git a/datafusion/jit/src/jit.rs b/datafusion/jit/src/jit.rs index 57e4c8c5d1dc..674d38b42a18 100644 --- a/datafusion/jit/src/jit.rs +++ b/datafusion/jit/src/jit.rs @@ -129,17 +129,26 @@ impl JIT { // Next, declare the function to jit. Functions must be declared // before they can be called, or defined. - let id = self.module.declare_function( - &name, - Linkage::Export, - &self.ctx.func.signature, - )?; + let id = self + .module + .declare_function(&name, Linkage::Export, &self.ctx.func.signature) + .map_err(|e| { + DataFusionError::Internal(format!( + "failed in declare the function to jit: {e:?}" + )) + })?; // Define the function to jit. This finishes compilation, although // there may be outstanding relocations to perform. Currently, jit // cannot finish relocations until all functions to be called are // defined. For now, we'll just finalize the function below. - self.module.define_function(id, &mut self.ctx)?; + self.module + .define_function(id, &mut self.ctx) + .map_err(|e| { + DataFusionError::Internal(format!( + "failed in define the function to jit: {e:?}" + )) + })?; // Now that compilation is finished, we can clear out the context state. self.module.clear_context(&mut self.ctx);