Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update pyo3 requirement from 0.15 to 0.16 #7

Closed
wants to merge 3 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion datafusion-common/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ jit = ["cranelift-module"]
arrow = { version = "9.1", features = ["prettyprint"] }
parquet = { version = "9.1", features = ["arrow"], optional = true }
avro-rs = { version = "0.13", features = ["snappy"], optional = true }
pyo3 = { version = "0.15", optional = true }
pyo3 = { version = "0.16", optional = true }
sqlparser = "0.14"
ordered-float = "2.10"
cranelift-module = { version = "0.81.1", optional = true }
29 changes: 29 additions & 0 deletions datafusion-jit/src/jit.rs
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ pub struct JIT {
}

impl Default for JIT {
#[cfg(target_arch = "x86_64")]
fn default() -> Self {
let builder = JITBuilder::new(cranelift_module::default_libcall_names());
let module = JITModule::new(builder);
Expand All @@ -51,6 +52,28 @@ impl Default for JIT {
module,
}
}

#[cfg(target_arch = "aarch64")]
fn default() -> Self {
let mut flag_builder = settings::builder();
// On at least AArch64, "colocated" calls use shorter-range relocations,
// which might not reach all definitions; we can't handle that here, so
// we require long-range relocation types.
flag_builder.set("use_colocated_libcalls", "false").unwrap();
flag_builder.set("is_pic", "false").unwrap();
let isa_builder = cranelift_native::builder().unwrap_or_else(|msg| {
panic!("host machine is not supported: {}", msg);
});
let isa = isa_builder.finish(settings::Flags::new(flag_builder));
let builder =
JITBuilder::with_isa(isa, cranelift_module::default_libcall_names());
let module = JITModule::new(builder);
Self {
builder_context: FunctionBuilderContext::new(),
ctx: module.make_context(),
module,
}
}
}

impl JIT {
Expand All @@ -62,7 +85,13 @@ impl JIT {
{
let mut flag_builder = settings::builder();
flag_builder.set("use_colocated_libcalls", "false").unwrap();

#[cfg(target_arch = "x86_64")]
flag_builder.set("is_pic", "true").unwrap();

#[cfg(target_arch = "aarch64")]
flag_builder.set("is_pic", "false").unwrap();

flag_builder.set("opt_level", "speed").unwrap();
flag_builder.set("enable_simd", "true").unwrap();
let isa_builder = cranelift_native::builder().unwrap_or_else(|msg| {
Expand Down
2 changes: 1 addition & 1 deletion datafusion/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ smallvec = { version = "1.6", features = ["union"] }
rand = "0.8"
avro-rs = { version = "0.13", features = ["snappy"], optional = true }
num-traits = { version = "0.2", optional = true }
pyo3 = { version = "0.15", optional = true }
pyo3 = { version = "0.16", optional = true }
tempfile = "3"
parking_lot = "0.12"

Expand Down