This commit is contained in:
Jaroslaw Konik 2025-05-20 07:00:00 +02:00
parent 4509375666
commit 6bce009e04
3 changed files with 3 additions and 15 deletions

View file

@ -1,7 +0,0 @@
[build]
# Without this flag, when linking static libruby, the linker removes symbols
# (such as `_rb_ext_ractor_safe`) which it thinks are dead code... but they are
# not, and they need to be included for the `embed` feature to work with static
# Ruby.
# rustflags = ["-C", "link-args=-lz", "-C", "link-dead-code=on"]
rustflags = ["-C", "link-args=-lz"]

3
build.rs Normal file
View file

@ -0,0 +1,3 @@
fn main() {
println!("cargo:rustc-link-lib=z"); // TODO: if features Ruby
}

View file

@ -76,14 +76,6 @@ impl RubyThread {
let mut variable_in_this_stack_frame: VALUE = 0;
ruby_init_stack(&mut variable_in_this_stack_frame as *mut VALUE as *mut _);
rb_sys::ruby_init();
let opts = ["-e", ""];
let mut argv = vec![];
argv.extend(opts.iter().map(|s| CString::new(*s).unwrap()));
let mut argv = argv
.iter()
.map(|cs| cs.as_ptr() as *mut _)
.collect::<Vec<_>>();
ruby_options(argv.len() as i32, argv.as_mut_ptr());
};
while let Ok(f) = receiver.recv() {
let ruby = Ruby::get().expect("Failed to get a handle to Ruby API");