bazhenov / tango

Rust microbenchmarking harness based on paired-testing methodology
MIT License
68 stars 1 forks source link

Symbol error when trying to run #22

Closed FilipAndersson245 closed 5 months ago

FilipAndersson245 commented 5 months ago

Hello, I am trying to integrate tango into nutshell, but when I add the default factorial bench it breaks when I try to run it.

image

FilipAndersson245 commented 5 months ago

I tried the latest dev and got the same error image It seem like it does not build as a dylibrary correctly?

FilipAndersson245 commented 5 months ago

Is there anything that limits when you can use tango? I have added the build.rs file

fn main() {
    println!("cargo:rustc-link-arg-benches=-rdynamic");
    println!("cargo:rerun-if-changed=build.rs");
}
bazhenov commented 5 months ago

Just to make sure, this is Linux, right? Can you please share the code?

FilipAndersson245 commented 5 months ago

Just to make sure, this is Linux, right? Can you please share the code?

Yes this is linux, through (WSL), It worked when I Tested on another repo at least.

https://github.com/FilipAndersson245/nushell/tree/tango

bazhenov commented 5 months ago

Ok, I figured it out. In nushell build script is in scripts/build.rs as noted in Cargo.toml

[package]
authors = ["The Nushell Project Developers"]
build = "scripts/build.rs"

you need to put println directives in this file. Particularly in non windows version

#[cfg(not(windows))]
fn main() {
    println!("cargo:rustc-link-arg-benches=-rdynamic");
    println!("cargo:rerun-if-changed=build.rs");
}
FilipAndersson245 commented 5 months ago

Thanks this worked, had totally missed there was already an custom build script, at a non default location :D