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

Add example of calling source code from src/ #301

Closed
recmo opened this issue Jun 4, 2019 · 16 comments
Closed

Add example of calling source code from src/ #301

recmo opened this issue Jun 4, 2019 · 16 comments

Comments

@recmo
Copy link

recmo commented Jun 4, 2019

The example has all code put in benches/. In practical use this will want to call functions from src/. It is non-trivial to call these functions (a simple use wont work).

The quickstart example should show:

  • How to prefix the use statements (crate::, project_name::, etc.)
  • What the visibility of items need to be (pub or pub(crate) etc).
  • How to make it work when the project only has a main.rs.

That is, start with src/main.rs like so:

fn fibonacci(n: u64) -> u64 {
    match n {
        0 => 1,
        1 => 1,
        n => fibonacci(n-1) + fibonacci(n-2),
    }
}

pub fn main() {
    println!("The 1000th fibnonacci is {}", fibonacci(1000));
}

and explain what needs to be done to Criterion-bench that fibonacci function (without moving it).

I always struggle to get this working when I want to use Criterion in a new project. It would help me if the quickstart example covers this.

@recmo recmo changed the title Add example off calling source code from src/ Add example of calling source code from src/ Jun 4, 2019
@bheisler
Copy link
Owner

bheisler commented Jun 6, 2019

Hey, thanks for the suggestion.

That's a fair point. I'd initially assumed it would be obvious, but now I realize that it wouldn't be to new Rust programmers. I'll update the documentation next time I'm working on Criterion.rs.

In the meantime, though - benchmarks in the benchmarks directory are compiled as though they were a separate crate, so all the usual limitations that implies are in force. The benchmarks can only call functions that are publically visible outside of the crate (so pub(crate) won't work), and you will have to import things as use my_crate:my_module::my_function;. If you're using Rust 2015, you'll even need to add the extern crate my_crate declaration to the benchmarks.

Edit: Right, you also asked about the main.rs file - for application crates that's the root of the crate so it should suffice to just use my_crate::my_function, but I don't remember if it's possible to benchmark application crates at all. If not, the standard workaround (and a common way to design Rust apps) is to have most of the code in a library crate and then make the application crate be a thin wrapper that just contains the main and maybe some things like command-line argument parsing.

@shepmaster
Copy link

That's a fair point. I'd initially assumed it would be obvious, but now I realize that it wouldn't be to new Rust programmers. I'll update the documentation next time I'm working on Criterion.rs.

I’m likewise of the opinion that crates shouldn’t need to reiterate basics for the language, but there’s no harm other than spending the maintainers time on something other than pure feature development.

That being said, multiple people have asked the same thing on Stack Overflow:

@fearofcode
Copy link

For fellow noobs finding this in a Google search for whom it is not obvious, since "extern crate" and various other things that you find in docs about doing testing don't work, try this:

  • Move code you want to call from criterion into src/lib.rs (assuming you are doing a simple cargo new crate_name)
  • Make anything you want to call public by putting pub in front of it
  • You should then be able to call it from a criterion bench of the kind in the user guide by typing:
use crate_name::{StructIWantToUse, OtherThingIWantToUse};

where crate_name is your crate name and `StructIWantToUse is, in this case, a struct you want to use in a benchmark.

No doubt obvious to others and if it's the wrong way to do it, sorry, but getting something to run that is bad and should be improved is better than not getting anything to run at all and having every combination of extern crate, use crate::*, etc you can think of result in a compilation error.

Also, don't worry if your editor puts a squiggle under the crate_name part of use crate_name. Just see if it compiles.

@brundonsmith
Copy link

brundonsmith commented Dec 31, 2019

@fearofcode my project structure is the following:

raytracer/
  Cargo.toml
  benches/
    my_bench.rs
  src/
    vec3.rs
    ...

The sample code for criterion worked in my_bench.rs, so the overall configuration is correct.

In my_bench.rs I've tried:

  • use crate::vec3::Vec3;
  • use raytracer::vec3::Vec3;
  • use vec3::Vec3;

But all three fail to compile. Any idea what I'm doing wrong?

Edit: Following the stackoverflow link, I tried this which partly worked:

#[path = "../src/vec3.rs"]
mod vec3;
use crate::vec3::Vec3;

Except that a use statement within that module now fails to resolve. I guess I could do #[path ...]s for every module in my crate, in the benchmarks root, but it seems like there should be a better way.

@shepmaster
Copy link

shepmaster commented Dec 31, 2019

Following the stackoverflow link, I tried this which partly worked

You followed the part of my answer where I said in bold “don’t do this“ and also:

it's very likely that this won't work because your code in foo.rs needs supporting code from other files that won't be included.

Instead, follow the rest of the answer that shows how to create a library. That’s the correct solution.

@rask
Copy link

rask commented Apr 7, 2020

Same trouble here, followed the starting guide but nothing seems to work.

proj/
    benches/
        my_bench.rs
    src/
        lib.rs
    Cargo.toml
    ...

Where lib.rs contains a pub fn foobar() { ... }, and in my_bench.rs I have use proj::foobar;, as shown in the Getting Started guide.

The benchmark fails to compile:

use of undeclared type or module `proj`

In Cargo.toml I have crate name as proj as well. The crate was initially created with Cargo, and is set to use the 2018 edition.

EDIT:

Aaaah, now I fixed it, sorry for the hassle.

My issue was that I was building a cdylib only, and adding rlib support allowed Criterion.rs to find the crate properly.

@bheisler
Copy link
Owner

Huh, I didn't know that was a requirement. I'll add that to the documentation.

@giraffekey
Copy link

I just ran into this same issue, caused some frustration, the rlib solution worked but I had to go searching for this issue to find it.

@giraffekey
Copy link

Adding a project with rask's project structure in an examples directory would be helpful, it was the first thing I checked for.

@giraffekey
Copy link

I should mention, the reason it wasn't working for me was because I'm using Neon, which seems to be incompatible with Criterion.

@madandrija
Copy link

I went through the example and didn't get it 😁 The comment and the SO answer from another comment helped though

@kpflugshaupt
Copy link

kpflugshaupt commented Jul 26, 2022

I just ran into this same issue, caused some frustration, the rlib solution worked but I had to go searching for this issue to find it.

Huh, I didn't know that was a requirement. I'll add that to the documentation.

Coming here two years later, I was very glad to find this. It's bound to hit anybody who tries to benchmark a Python module written in Rust.
As performance is the main reason to do this, it's not an exotic use-case.

May I respectfully request that this be put into the documentation?

To sum up:

If you develop a Python extension using PyO3 / maturin, and you want to use Criterion to benchmark your code (do, it's great!), add "rlib" to your crate-type in Cargo.toml:

[lib]
name = "whatever_name"
crate-type = ["cdylib", "rlib"]

[dependencies]
pyo3 = { version = "0.16.5", features = ["extension-module"] }

This will allow Criterion to import the code, while not adding any build overhead (at least, not noticeably)

@se7entyse7en
Copy link

se7entyse7en commented Aug 25, 2022

I also have pyo3-asyncio as a dependency and in this case, it seems that adding "rlib" as create-type is not enough. When I run cargo bench the linker still complains about missing symbols 😭:

└─> $ cargo bench
   Compiling ohmyfpg v0.1.0-dev.18 (/Users/se7entyse7en/Projects/se7entyse7en/ohmyfpg)
error: linking with `cc` failed: exit status: 1
  |
  = note: "cc" "-Wl,-exported_symbols_list,/var/folders/56/y8258xjs1nq1l8gd_yzpkn_h0000gn/T/rustclaYA00/list" "-m64" "-arch" "x86_64" "/var/folders/56/y8258xjs1nq1l8gd_yzpkn_h0000gn/T/rustclaYA00/symbols.o" "/Users/se7entyse7en/Projects/se7entyse7en/ohmyfpg/target/release/deps/ohmyfpg.ohmyfpg.0ce9d21d-cgu.0.rcgu.o" "/Users/se7entyse7en/Projects/se7entyse7en/ohmyfpg/target/release/deps/ohmyfpg.ohmyfpg.0ce9d21d-cgu.1.rcgu.o" "/Users/se7entyse7en/Projects/se7entyse7en/ohmyfpg/target/release/deps/ohmyfpg.ohmyfpg.0ce9d21d-cgu.10.rcgu.o" "/Users/se7entyse7en/Projects/se7entyse7en/ohmyfpg/target/release/deps/ohmyfpg.ohmyfpg.0ce9d21d-cgu.11.rcgu.o" "/Users/se7entyse7en/Projects/se7entyse7en/ohmyfpg/target/release/deps/ohmyfpg.ohmyfpg.0ce9d21d-cgu.12.rcgu.o" "/Users/se7entyse7en/Projects/se7entyse7en/ohmyfpg/target/release/deps/ohmyfpg.ohmyfpg.0ce9d21d-cgu.13.rcgu.o" "/Users/se7entyse7en/Projects/se7entyse7en/ohmyfpg/target/release/deps/ohmyfpg.ohmyfpg.0ce9d21d-cgu.14.rcgu.o" "/Users/se7entyse7en/Projects/se7entyse7en/ohmyfpg/target/release/deps/ohmyfpg.ohmyfpg.0ce9d21d-cgu.15.rcgu.o" "/Users/se7entyse7en/Projects/se7entyse7en/ohmyfpg/target/release/deps/ohmyfpg.ohmyfpg.0ce9d21d-cgu.2.rcgu.o" "/Users/se7entyse7en/Projects/se7entyse7en/ohmyfpg/target/release/deps/ohmyfpg.ohmyfpg.0ce9d21d-cgu.3.rcgu.o" "/Users/se7entyse7en/Projects/se7entyse7en/ohmyfpg/target/release/deps/ohmyfpg.ohmyfpg.0ce9d21d-cgu.4.rcgu.o" "/Users/se7entyse7en/Projects/se7entyse7en/ohmyfpg/target/release/deps/ohmyfpg.ohmyfpg.0ce9d21d-cgu.5.rcgu.o" "/Users/se7entyse7en/Projects/se7entyse7en/ohmyfpg/target/release/deps/ohmyfpg.ohmyfpg.0ce9d21d-cgu.6.rcgu.o" "/Users/se7entyse7en/Projects/se7entyse7en/ohmyfpg/target/release/deps/ohmyfpg.ohmyfpg.0ce9d21d-cgu.7.rcgu.o" "/Users/se7entyse7en/Projects/se7entyse7en/ohmyfpg/target/release/deps/ohmyfpg.ohmyfpg.0ce9d21d-cgu.8.rcgu.o" "/Users/se7entyse7en/Projects/se7entyse7en/ohmyfpg/target/release/deps/ohmyfpg.ohmyfpg.0ce9d21d-cgu.9.rcgu.o" "/Users/se7entyse7en/Projects/se7entyse7en/ohmyfpg/target/release/deps/ohmyfpg.2ilbaqslxnx00dpy.rcgu.o" "-L" "/Users/se7entyse7en/Projects/se7entyse7en/ohmyfpg/target/release/deps" "-L" "/Users/se7entyse7en/Projects/se7entyse7en/ohmyfpg/target/release/build/ring-b5dfd54c4b4fcaa4/out" "-L" "/Users/se7entyse7en/.rustup/toolchains/stable-x86_64-apple-darwin/lib/rustlib/x86_64-apple-darwin/lib" "/Users/se7entyse7en/Projects/se7entyse7en/ohmyfpg/target/release/deps/libpyo3_asyncio-4ebf71785e0b5ede.rlib" "/Users/se7entyse7en/Projects/se7entyse7en/ohmyfpg/target/release/deps/libscram-7ae242ba39ff797e.rlib" "/Users/se7entyse7en/Projects/se7entyse7en/ohmyfpg/target/release/deps/libring-673fdd7d6d773387.rlib" "/Users/se7entyse7en/Projects/se7entyse7en/ohmyfpg/target/release/deps/libspin-0f4b34b464220bac.rlib" "/Users/se7entyse7en/Projects/se7entyse7en/ohmyfpg/target/release/deps/libuntrusted-3ae4b46418fbd325.rlib" "/Users/se7entyse7en/Projects/se7entyse7en/ohmyfpg/target/release/deps/librand-e797c72e7f27453a.rlib" "/Users/se7entyse7en/Projects/se7entyse7en/ohmyfpg/target/release/deps/librand_chacha-fd1c39d9b96301d4.rlib" "/Users/se7entyse7en/Projects/se7entyse7en/ohmyfpg/target/release/deps/libppv_lite86-37cbc6bc95947da7.rlib" "/Users/se7entyse7en/Projects/se7entyse7en/ohmyfpg/target/release/deps/librand_core-3556845860cbc789.rlib" "/Users/se7entyse7en/Projects/se7entyse7en/ohmyfpg/target/release/deps/libgetrandom-f5a930f3ed59565a.rlib" "/Users/se7entyse7en/Projects/se7entyse7en/ohmyfpg/target/release/deps/libbase64-2c2d798fbc5c6a08.rlib" "/Users/se7entyse7en/Projects/se7entyse7en/ohmyfpg/target/release/deps/libregex-e40ba1ab36fe478e.rlib" "/Users/se7entyse7en/Projects/se7entyse7en/ohmyfpg/target/release/deps/libaho_corasick-28aa93ffeb3bfc25.rlib" "/Users/se7entyse7en/Projects/se7entyse7en/ohmyfpg/target/release/deps/libregex_syntax-b30c9fe5f2f23f32.rlib" "/Users/se7entyse7en/Projects/se7entyse7en/ohmyfpg/target/release/deps/libtokio-c172a31c0d2994c3.rlib" "/Users/se7entyse7en/Projects/se7entyse7en/ohmyfpg/target/release/deps/libsignal_hook_registry-9f98b611eb8776d1.rlib" "/Users/se7entyse7en/Projects/se7entyse7en/ohmyfpg/target/release/deps/libnum_cpus-cf2d2aa0859cbf48.rlib" "/Users/se7entyse7en/Projects/se7entyse7en/ohmyfpg/target/release/deps/libsocket2-3a6e4be6e45ee2e6.rlib" "/Users/se7entyse7en/Projects/se7entyse7en/ohmyfpg/target/release/deps/libonce_cell-0c13a4ade623907f.rlib" "/Users/se7entyse7en/Projects/se7entyse7en/ohmyfpg/target/release/deps/libbytes-9d715ee3132df6f5.rlib" "/Users/se7entyse7en/Projects/se7entyse7en/ohmyfpg/target/release/deps/libmio-ca2de3eb154d1eaf.rlib" "/Users/se7entyse7en/Projects/se7entyse7en/ohmyfpg/target/release/deps/liblog-14e6ea6af396690e.rlib" "/Users/se7entyse7en/Projects/se7entyse7en/ohmyfpg/target/release/deps/libfutures-6cf6a53c77b01a7c.rlib" "/Users/se7entyse7en/Projects/se7entyse7en/ohmyfpg/target/release/deps/libfutures_executor-2bd78f0a7bce2e63.rlib" "/Users/se7entyse7en/Projects/se7entyse7en/ohmyfpg/target/release/deps/libfutures_util-26d6680b5c109eb3.rlib" "/Users/se7entyse7en/Projects/se7entyse7en/ohmyfpg/target/release/deps/libmemchr-ea7097d53eca69af.rlib" "/Users/se7entyse7en/Projects/se7entyse7en/ohmyfpg/target/release/deps/libfutures_io-9db976bbf691f6e0.rlib" "/Users/se7entyse7en/Projects/se7entyse7en/ohmyfpg/target/release/deps/libslab-288f3d10d58cda45.rlib" "/Users/se7entyse7en/Projects/se7entyse7en/ohmyfpg/target/release/deps/libfutures_channel-be2f51255fbecc39.rlib" "/Users/se7entyse7en/Projects/se7entyse7en/ohmyfpg/target/release/deps/libpin_project_lite-ab6e48f36cee4e47.rlib" "/Users/se7entyse7en/Projects/se7entyse7en/ohmyfpg/target/release/deps/libfutures_sink-7459188426dc0d15.rlib" "/Users/se7entyse7en/Projects/se7entyse7en/ohmyfpg/target/release/deps/libfutures_task-2239de3f0edede6c.rlib" "/Users/se7entyse7en/Projects/se7entyse7en/ohmyfpg/target/release/deps/libpin_utils-7f282e32ca5e46af.rlib" "/Users/se7entyse7en/Projects/se7entyse7en/ohmyfpg/target/release/deps/libfutures_core-b71b0c28155a6aa3.rlib" "/Users/se7entyse7en/Projects/se7entyse7en/ohmyfpg/target/release/deps/libpyo3-913629c20f98e13f.rlib" "/Users/se7entyse7en/Projects/se7entyse7en/ohmyfpg/target/release/deps/libparking_lot-7b0ebae6da7612a5.rlib" "/Users/se7entyse7en/Projects/se7entyse7en/ohmyfpg/target/release/deps/libparking_lot_core-c6f5e1528074e5b2.rlib" "/Users/se7entyse7en/Projects/se7entyse7en/ohmyfpg/target/release/deps/libcfg_if-f8d0c70fdc7931c9.rlib" "/Users/se7entyse7en/Projects/se7entyse7en/ohmyfpg/target/release/deps/libsmallvec-f0cbe8616292f974.rlib" "/Users/se7entyse7en/Projects/se7entyse7en/ohmyfpg/target/release/deps/liblock_api-9f5045f1f32a09e2.rlib" "/Users/se7entyse7en/Projects/se7entyse7en/ohmyfpg/target/release/deps/libscopeguard-e4f795773d283111.rlib" "/Users/se7entyse7en/Projects/se7entyse7en/ohmyfpg/target/release/deps/libpyo3_ffi-6405a598dc7b35c3.rlib" "/Users/se7entyse7en/Projects/se7entyse7en/ohmyfpg/target/release/deps/liblibc-9255a145b70a66c7.rlib" "/Users/se7entyse7en/Projects/se7entyse7en/ohmyfpg/target/release/deps/libunindent-213361d0bf7d2d8b.rlib" "/Users/se7entyse7en/.rustup/toolchains/stable-x86_64-apple-darwin/lib/rustlib/x86_64-apple-darwin/lib/libstd-10116371125a6aff.rlib" "/Users/se7entyse7en/.rustup/toolchains/stable-x86_64-apple-darwin/lib/rustlib/x86_64-apple-darwin/lib/libpanic_unwind-39e96d52875d1707.rlib" "/Users/se7entyse7en/.rustup/toolchains/stable-x86_64-apple-darwin/lib/rustlib/x86_64-apple-darwin/lib/libobject-5291a2db2306cf06.rlib" "/Users/se7entyse7en/.rustup/toolchains/stable-x86_64-apple-darwin/lib/rustlib/x86_64-apple-darwin/lib/libmemchr-390f7d5c905d1758.rlib" "/Users/se7entyse7en/.rustup/toolchains/stable-x86_64-apple-darwin/lib/rustlib/x86_64-apple-darwin/lib/libaddr2line-294943fd09f0dfee.rlib" "/Users/se7entyse7en/.rustup/toolchains/stable-x86_64-apple-darwin/lib/rustlib/x86_64-apple-darwin/lib/libgimli-5b8fe2191a96c1eb.rlib" "/Users/se7entyse7en/.rustup/toolchains/stable-x86_64-apple-darwin/lib/rustlib/x86_64-apple-darwin/lib/librustc_demangle-6c345d2ae2af194e.rlib" "/Users/se7entyse7en/.rustup/toolchains/stable-x86_64-apple-darwin/lib/rustlib/x86_64-apple-darwin/lib/libstd_detect-7fb258730717fc35.rlib" "/Users/se7entyse7en/.rustup/toolchains/stable-x86_64-apple-darwin/lib/rustlib/x86_64-apple-darwin/lib/libhashbrown-95d7b07281459669.rlib" "/Users/se7entyse7en/.rustup/toolchains/stable-x86_64-apple-darwin/lib/rustlib/x86_64-apple-darwin/lib/libminiz_oxide-1830aefa1e824398.rlib" "/Users/se7entyse7en/.rustup/toolchains/stable-x86_64-apple-darwin/lib/rustlib/x86_64-apple-darwin/lib/libadler-6c20c3f29e08f382.rlib" "/Users/se7entyse7en/.rustup/toolchains/stable-x86_64-apple-darwin/lib/rustlib/x86_64-apple-darwin/lib/librustc_std_workspace_alloc-392d2b6b8e347168.rlib" "/Users/se7entyse7en/.rustup/toolchains/stable-x86_64-apple-darwin/lib/rustlib/x86_64-apple-darwin/lib/libunwind-ed102691bd84ae29.rlib" "/Users/se7entyse7en/.rustup/toolchains/stable-x86_64-apple-darwin/lib/rustlib/x86_64-apple-darwin/lib/libcfg_if-f8a76297049f40d0.rlib" "/Users/se7entyse7en/.rustup/toolchains/stable-x86_64-apple-darwin/lib/rustlib/x86_64-apple-darwin/lib/liblibc-35af506aebbb3abd.rlib" "/Users/se7entyse7en/.rustup/toolchains/stable-x86_64-apple-darwin/lib/rustlib/x86_64-apple-darwin/lib/liballoc-e149d7d6ef6750c5.rlib" "/Users/se7entyse7en/.rustup/toolchains/stable-x86_64-apple-darwin/lib/rustlib/x86_64-apple-darwin/lib/librustc_std_workspace_core-cdd7c9a0360e9a15.rlib" "/Users/se7entyse7en/.rustup/toolchains/stable-x86_64-apple-darwin/lib/rustlib/x86_64-apple-darwin/lib/libcore-504c8436d3cdf687.rlib" "/Users/se7entyse7en/.rustup/toolchains/stable-x86_64-apple-darwin/lib/rustlib/x86_64-apple-darwin/lib/libcompiler_builtins-68d0fd74539b07e1.rlib" "-framework" "Security" "-liconv" "-lSystem" "-lresolv" "-lc" "-lm" "-liconv" "-L" "/Users/se7entyse7en/.rustup/toolchains/stable-x86_64-apple-darwin/lib/rustlib/x86_64-apple-darwin/lib" "-o" "/Users/se7entyse7en/Projects/se7entyse7en/ohmyfpg/target/release/deps/libohmyfpg.dylib" "-Wl,-dead_strip" "-dynamiclib" "-Wl,-dylib" "-nodefaultlibs"
  = note: Undefined symbols for architecture x86_64:
            "_PyExc_ValueError", referenced from:
                _$LT$T$u20$as$u20$pyo3..type_object..PyTypeObject$GT$::type_object::hdb0f2dfcc854d9ee in libpyo3-913629c20f98e13f.rlib(pyo3-913629c20f98e13f.pyo3.6883f49f-cgu.0.rcgu.o)
            "_PyExc_RuntimeError", referenced from:
                _$LT$T$u20$as$u20$pyo3..type_object..PyTypeObject$GT$::type_object::h8fe713c841d3bfc5 in libpyo3-913629c20f98e13f.rlib(pyo3-913629c20f98e13f.pyo3.6883f49f-cgu.0.rcgu.o)
            "_PyObject_GenericGetDict", referenced from:
                pyo3::pyclass::create_type_object_impl::hf94ead5e28fd2100 in libpyo3-913629c20f98e13f.rlib(pyo3-913629c20f98e13f.pyo3.6883f49f-cgu.8.rcgu.o)
            "_PyObject_GenericSetDict", referenced from:
                pyo3::pyclass::create_type_object_impl::hf94ead5e28fd2100 in libpyo3-913629c20f98e13f.rlib(pyo3-913629c20f98e13f.pyo3.6883f49f-cgu.8.rcgu.o)
            "_PyType_FromSpec", referenced from:
                pyo3::pyclass::create_type_object_impl::hf94ead5e28fd2100 in libpyo3-913629c20f98e13f.rlib(pyo3-913629c20f98e13f.pyo3.6883f49f-cgu.8.rcgu.o)
            "_PyDict_New", referenced from:
                pyo3::types::dict::PyDict::new::h032cac5de7053211 in libpyo3-913629c20f98e13f.rlib(pyo3-913629c20f98e13f.pyo3.6883f49f-cgu.14.rcgu.o)
            "_PyObject_Str", referenced from:
                _$LT$pyo3..types..any..PyAny$u20$as$u20$core..fmt..Display$GT$::fmt::h99ed711601fd16da in libpyo3-913629c20f98e13f.rlib(pyo3-913629c20f98e13f.pyo3.6883f49f-cgu.4.rcgu.o)
                _$LT$pyo3..exceptions..PyIOError$u20$as$u20$core..fmt..Display$GT$::fmt::h988cb779bc53b8d0 in libpyo3-913629c20f98e13f.rlib(pyo3-913629c20f98e13f.pyo3.6883f49f-cgu.0.rcgu.o)
            "_PyUnicode_AsEncodedString", referenced from:
                pyo3::types::string::PyString::to_string_lossy::h98fc361fb1fda7a6 in libpyo3-913629c20f98e13f.rlib(pyo3-913629c20f98e13f.pyo3.6883f49f-cgu.4.rcgu.o)
            "_PyBytes_Size", referenced from:
                pyo3::types::string::PyString::to_string_lossy::h98fc361fb1fda7a6 in libpyo3-913629c20f98e13f.rlib(pyo3-913629c20f98e13f.pyo3.6883f49f-cgu.4.rcgu.o)
            "_PyObject_VectorcallMethod", referenced from:
                pyo3::types::any::PyAny::call_method0::h6c9579833bb1c1cd in libpyo3-913629c20f98e13f.rlib(pyo3-913629c20f98e13f.pyo3.6883f49f-cgu.4.rcgu.o)
            "_PyCMethod_New", referenced from:
                pyo3::types::function::PyCFunction::internal_new_from_pointers::h760b5724eda639a6 in libpyo3-913629c20f98e13f.rlib(pyo3-913629c20f98e13f.pyo3.6883f49f-cgu.7.rcgu.o)
            "_PyObject_Repr", referenced from:
                _$LT$pyo3..types..traceback..PyTraceback$u20$as$u20$core..fmt..Debug$GT$::fmt::hf7358cb4d6ac107f in libpyo3-913629c20f98e13f.rlib(pyo3-913629c20f98e13f.pyo3.6883f49f-cgu.11.rcgu.o)
                _$LT$pyo3..types..floatob..PyFloat$u20$as$u20$core..fmt..Debug$GT$::fmt::h7685a8a358583dfb in libpyo3-913629c20f98e13f.rlib(pyo3-913629c20f98e13f.pyo3.6883f49f-cgu.3.rcgu.o)
                _$LT$pyo3..exceptions..PyIOError$u20$as$u20$core..fmt..Debug$GT$::fmt::h71818b9e686e4c3e in libpyo3-913629c20f98e13f.rlib(pyo3-913629c20f98e13f.pyo3.6883f49f-cgu.0.rcgu.o)
            "_PyGILState_Release", referenced from:
                _$LT$pyo3..gil..GILGuard$u20$as$u20$core..ops..drop..Drop$GT$::drop::h9a4e5dbe2dd9078f in libpyo3-913629c20f98e13f.rlib(pyo3-913629c20f98e13f.pyo3.6883f49f-cgu.11.rcgu.o)
            "_PyGILState_Ensure", referenced from:
                pyo3::gil::GILGuard::acquire_unchecked::h4483eb6509be041f (.llvm.12996647851161946214) in libpyo3-913629c20f98e13f.rlib(pyo3-913629c20f98e13f.pyo3.6883f49f-cgu.11.rcgu.o)
            "_PyErr_PrintEx", referenced from:
                pyo3::err::PyErr::take::h13e09712dfb81d3a in libpyo3-913629c20f98e13f.rlib(pyo3-913629c20f98e13f.pyo3.6883f49f-cgu.6.rcgu.o)
                pyo3::err::PyErr::print::hc2b4279361b4a372 in libpyo3-913629c20f98e13f.rlib(pyo3-913629c20f98e13f.pyo3.6883f49f-cgu.6.rcgu.o)
                pyo3::err::PyErr::print_and_set_sys_last_vars::h05167e9c723c04f5 in libpyo3-913629c20f98e13f.rlib(pyo3-913629c20f98e13f.pyo3.6883f49f-cgu.6.rcgu.o)
            "_PyBaseObject_Type", referenced from:
                pyo3::once_cell::GILOnceCell$LT$T$GT$::init::h7dccdb93e4d49ba8 in ohmyfpg.ohmyfpg.0ce9d21d-cgu.2.rcgu.o
                pyo3::once_cell::GILOnceCell$LT$T$GT$::init::hbfc4ada3f049b890 in libpyo3_asyncio-4ebf71785e0b5ede.rlib(pyo3_asyncio-4ebf71785e0b5ede.pyo3_asyncio.59033d10-cgu.10.rcgu.o)
            "_PyImport_Import", referenced from:
                pyo3::types::module::PyModule::import::h054c66967f2429f8 in libpyo3-913629c20f98e13f.rlib(pyo3-913629c20f98e13f.pyo3.6883f49f-cgu.9.rcgu.o)
            "_PyErr_Print", referenced from:
                pyo3::err::panic_after_error::ha6f432dd22f401c7 in libpyo3-913629c20f98e13f.rlib(pyo3-913629c20f98e13f.pyo3.6883f49f-cgu.6.rcgu.o)
            "_PyObject_SetAttrString", referenced from:
                pyo3::once_cell::GILOnceCell$LT$T$GT$::init::hd2a8ceabf6c07762 in libpyo3-913629c20f98e13f.rlib(pyo3-913629c20f98e13f.pyo3.6883f49f-cgu.9.rcgu.o)
            "_PyObject_DelItem", referenced from:
                pyo3::impl_::pyclass::assign_sequence_item_from_mapping::hec195af42b3da49f in libpyo3-913629c20f98e13f.rlib(pyo3-913629c20f98e13f.pyo3.6883f49f-cgu.5.rcgu.o)
            "_PyUnicode_InternInPlace", referenced from:
                pyo3::once_cell::GILOnceCell$LT$T$GT$::init::h0714237d89363819 in libpyo3-913629c20f98e13f.rlib(pyo3-913629c20f98e13f.pyo3.6883f49f-cgu.9.rcgu.o)
                pyo3::once_cell::GILOnceCell$LT$T$GT$::init::ha5192acdbe784557 in libpyo3-913629c20f98e13f.rlib(pyo3-913629c20f98e13f.pyo3.6883f49f-cgu.9.rcgu.o)
                pyo3::once_cell::GILOnceCell$LT$T$GT$::init::hd724c00eae382481 in libpyo3-913629c20f98e13f.rlib(pyo3-913629c20f98e13f.pyo3.6883f49f-cgu.9.rcgu.o)
            "_PyUnicode_FromStringAndSize", referenced from:
                pyo3::once_cell::GILOnceCell$LT$T$GT$::init::h0714237d89363819 in libpyo3-913629c20f98e13f.rlib(pyo3-913629c20f98e13f.pyo3.6883f49f-cgu.9.rcgu.o)
                pyo3::once_cell::GILOnceCell$LT$T$GT$::init::ha5192acdbe784557 in libpyo3-913629c20f98e13f.rlib(pyo3-913629c20f98e13f.pyo3.6883f49f-cgu.9.rcgu.o)
                pyo3::once_cell::GILOnceCell$LT$T$GT$::init::hd724c00eae382481 in libpyo3-913629c20f98e13f.rlib(pyo3-913629c20f98e13f.pyo3.6883f49f-cgu.9.rcgu.o)
                pyo3::types::module::PyModule::import::h054c66967f2429f8 in libpyo3-913629c20f98e13f.rlib(pyo3-913629c20f98e13f.pyo3.6883f49f-cgu.9.rcgu.o)
                _$LT$pyo3..err..PyDowncastErrorArguments$u20$as$u20$pyo3..err..err_state..PyErrArguments$GT$::arguments::h34b8ff56525ce8e7 in libpyo3-913629c20f98e13f.rlib(pyo3-913629c20f98e13f.pyo3.6883f49f-cgu.6.rcgu.o)
                core::ops::function::FnOnce::call_once$u7b$$u7b$vtable.shim$u7d$$u7d$::hc0e7ee7fc60f5ebc (.llvm.3792877480674101327) in libpyo3-913629c20f98e13f.rlib(pyo3-913629c20f98e13f.pyo3.6883f49f-cgu.1.rcgu.o)
                pyo3::conversion::ToBorrowedObject::with_borrowed_ptr::h0d8ae23c14398741 in libpyo3-913629c20f98e13f.rlib(pyo3-913629c20f98e13f.pyo3.6883f49f-cgu.15.rcgu.o)
                ...
            "_PyObject_IsTrue", referenced from:
                pyo3::types::any::PyAny::is_true::h6c2ca9a4658887d3 in libpyo3-913629c20f98e13f.rlib(pyo3-913629c20f98e13f.pyo3.6883f49f-cgu.4.rcgu.o)
            "__Py_NoneStruct", referenced from:
                pyo3_asyncio::TaskLocals::with_running_loop::h8e0714cd49ef246d in libpyo3_asyncio-4ebf71785e0b5ede.rlib(pyo3_asyncio-4ebf71785e0b5ede.pyo3_asyncio.59033d10-cgu.0.rcgu.o)
                pyo3_asyncio::generic::set_result::hc7d3094d0fdfb4a0 in libpyo3_asyncio-4ebf71785e0b5ede.rlib(pyo3_asyncio-4ebf71785e0b5ede.pyo3_asyncio.59033d10-cgu.7.rcgu.o)
                _$LT$$LP$$RP$$u20$as$u20$pyo3..conversion..IntoPy$LT$pyo3..instance..Py$LT$pyo3..types..any..PyAny$GT$$GT$$GT$::into_py::h1b75a1f4a89b93c6 in libpyo3-913629c20f98e13f.rlib(pyo3-913629c20f98e13f.pyo3.6883f49f-cgu.15.rcgu.o)
            "_PyLong_FromSsize_t", referenced from:
                pyo3::impl_::pyclass::get_sequence_item_from_mapping::h5ec6ca4222ea61e4 in libpyo3-913629c20f98e13f.rlib(pyo3-913629c20f98e13f.pyo3.6883f49f-cgu.5.rcgu.o)
                pyo3::impl_::pyclass::assign_sequence_item_from_mapping::hec195af42b3da49f in libpyo3-913629c20f98e13f.rlib(pyo3-913629c20f98e13f.pyo3.6883f49f-cgu.5.rcgu.o)
            "_PyObject_Malloc", referenced from:
                pyo3::pyclass::create_type_object_impl::hf94ead5e28fd2100 in libpyo3-913629c20f98e13f.rlib(pyo3-913629c20f98e13f.pyo3.6883f49f-cgu.8.rcgu.o)
            "_PyObject_SetAttr", referenced from:
                pyo3::conversion::ToBorrowedObject::with_borrowed_ptr::ha1bcf86b6a6dffcf in ohmyfpg.ohmyfpg.0ce9d21d-cgu.8.rcgu.o
                pyo3::conversion::ToBorrowedObject::with_borrowed_ptr::h4cc17e0704ce7b72 in libpyo3-913629c20f98e13f.rlib(pyo3-913629c20f98e13f.pyo3.6883f49f-cgu.5.rcgu.o)
                pyo3::conversion::ToBorrowedObject::with_borrowed_ptr::h5024f6f390b37e3e in libpyo3-913629c20f98e13f.rlib(pyo3-913629c20f98e13f.pyo3.6883f49f-cgu.14.rcgu.o)
            "_PyErr_Fetch", referenced from:
                pyo3::err::PyErr::take::h13e09712dfb81d3a in libpyo3-913629c20f98e13f.rlib(pyo3-913629c20f98e13f.pyo3.6883f49f-cgu.6.rcgu.o)
            "_PyUnicode_AsUTF8AndSize", referenced from:
                pyo3::impl_::extract_argument::FunctionDescription::extract_arguments_fastcall::h0d11d0ab95efb5f3 in ohmyfpg.ohmyfpg.0ce9d21d-cgu.9.rcgu.o
                pyo3::types::string::PyString::to_string_lossy::h98fc361fb1fda7a6 in libpyo3-913629c20f98e13f.rlib(pyo3-913629c20f98e13f.pyo3.6883f49f-cgu.4.rcgu.o)
                pyo3::types::string::_$LT$impl$u20$pyo3..conversion..FromPyObject$u20$for$u20$$RF$str$GT$::extract::hf64957492608d257 in libpyo3-913629c20f98e13f.rlib(pyo3-913629c20f98e13f.pyo3.6883f49f-cgu.4.rcgu.o)
                pyo3::types::string::_$LT$impl$u20$pyo3..conversion..FromPyObject$u20$for$u20$alloc..string..String$GT$::extract::h002425630b457484 in libpyo3-913629c20f98e13f.rlib(pyo3-913629c20f98e13f.pyo3.6883f49f-cgu.3.rcgu.o)
                pyo3::impl_::extract_argument::FunctionDescription::extract_arguments_tuple_dict::hcc8a5e2ef4f5884d in libpyo3_asyncio-4ebf71785e0b5ede.rlib(pyo3_asyncio-4ebf71785e0b5ede.pyo3_asyncio.59033d10-cgu.8.rcgu.o)
            "_PyModule_Create2", referenced from:
                pyo3::impl_::pymodule::ModuleDef::make_module::hc6ed2af7554b3ead in libpyo3-913629c20f98e13f.rlib(pyo3-913629c20f98e13f.pyo3.6883f49f-cgu.7.rcgu.o)
            "_PyException_SetCause", referenced from:
                pyo3::err::PyErr::set_cause::h89ae9d908e1a1d3f in libpyo3-913629c20f98e13f.rlib(pyo3-913629c20f98e13f.pyo3.6883f49f-cgu.6.rcgu.o)
            "_PyObject_SetItem", referenced from:
                pyo3::impl_::pyclass::assign_sequence_item_from_mapping::hec195af42b3da49f in libpyo3-913629c20f98e13f.rlib(pyo3-913629c20f98e13f.pyo3.6883f49f-cgu.5.rcgu.o)
            "_Py_IsInitialized", referenced from:
                parking_lot::once::Once::call_once_force::_$u7b$$u7b$closure$u7d$$u7d$::h33275b2b6c586203 (.llvm.12996647851161946214) in libpyo3-913629c20f98e13f.rlib(pyo3-913629c20f98e13f.pyo3.6883f49f-cgu.11.rcgu.o)
                core::ops::function::FnOnce::call_once$u7b$$u7b$vtable.shim$u7d$$u7d$::h8c8b534593d246a9 (.llvm.12996647851161946214) in libpyo3-913629c20f98e13f.rlib(pyo3-913629c20f98e13f.pyo3.6883f49f-cgu.11.rcgu.o)
            "_PyException_GetCause", referenced from:
                pyo3::impl_::extract_argument::argument_extraction_error::h8914f7b50d156406 in libpyo3-913629c20f98e13f.rlib(pyo3-913629c20f98e13f.pyo3.6883f49f-cgu.15.rcgu.o)
            "_PyDict_SetItem", referenced from:
                pyo3::conversion::ToBorrowedObject::with_borrowed_ptr::h0c97cf4645a345fa in ohmyfpg.ohmyfpg.0ce9d21d-cgu.8.rcgu.o
                pyo3::conversion::ToBorrowedObject::with_borrowed_ptr::h1e49cbc7b36b23a6 in libpyo3_asyncio-4ebf71785e0b5ede.rlib(pyo3_asyncio-4ebf71785e0b5ede.pyo3_asyncio.59033d10-cgu.4.rcgu.o)
            "_PyObject_GetItem", referenced from:
                pyo3::impl_::pyclass::get_sequence_item_from_mapping::h5ec6ca4222ea61e4 in libpyo3-913629c20f98e13f.rlib(pyo3-913629c20f98e13f.pyo3.6883f49f-cgu.5.rcgu.o)
            "_PyObject_GetAttr", referenced from:
                pyo3::conversion::ToBorrowedObject::with_borrowed_ptr::hedf2f82d83ab96cb in ohmyfpg.ohmyfpg.0ce9d21d-cgu.4.rcgu.o
                pyo3::conversion::ToBorrowedObject::with_borrowed_ptr::h27107c36ebc15bc3 in libpyo3_asyncio-4ebf71785e0b5ede.rlib(pyo3_asyncio-4ebf71785e0b5ede.pyo3_asyncio.59033d10-cgu.6.rcgu.o)
                pyo3::conversion::ToBorrowedObject::with_borrowed_ptr::hb8cabddf81945b1c in libpyo3_asyncio-4ebf71785e0b5ede.rlib(pyo3_asyncio-4ebf71785e0b5ede.pyo3_asyncio.59033d10-cgu.6.rcgu.o)
                pyo3_asyncio::generic::cancelled::h0b2f3b5a5779fd68 in libpyo3_asyncio-4ebf71785e0b5ede.rlib(pyo3_asyncio-4ebf71785e0b5ede.pyo3_asyncio.59033d10-cgu.7.rcgu.o)
                pyo3_asyncio::generic::set_result::hc7d3094d0fdfb4a0 in libpyo3_asyncio-4ebf71785e0b5ede.rlib(pyo3_asyncio-4ebf71785e0b5ede.pyo3_asyncio.59033d10-cgu.7.rcgu.o)
                pyo3::types::any::PyAny::getattr::h215546aa979fdd7c in libpyo3-913629c20f98e13f.rlib(pyo3-913629c20f98e13f.pyo3.6883f49f-cgu.4.rcgu.o)
                pyo3::types::typeobject::PyType::name::he4f986a102ea3e04 in libpyo3-913629c20f98e13f.rlib(pyo3-913629c20f98e13f.pyo3.6883f49f-cgu.3.rcgu.o)
                ...
            "_PyList_New", referenced from:
                pyo3::types::module::PyModule::index::h81733ab8bc6e8baf in libpyo3-913629c20f98e13f.rlib(pyo3-913629c20f98e13f.pyo3.6883f49f-cgu.9.rcgu.o)
            "_PyObject_Free", referenced from:
                pyo3::pyclass::create_type_object_impl::hf94ead5e28fd2100 in libpyo3-913629c20f98e13f.rlib(pyo3-913629c20f98e13f.pyo3.6883f49f-cgu.8.rcgu.o)
            "_PyExc_SystemError", referenced from:
                _$LT$T$u20$as$u20$pyo3..type_object..PyTypeObject$GT$::type_object::h4815892495ce1a32 in ohmyfpg.ohmyfpg.0ce9d21d-cgu.13.rcgu.o
                _$LT$T$u20$as$u20$pyo3..type_object..PyTypeObject$GT$::type_object::hb578c4d472c7e730 in libpyo3_asyncio-4ebf71785e0b5ede.rlib(pyo3_asyncio-4ebf71785e0b5ede.pyo3_asyncio.59033d10-cgu.14.rcgu.o)
                _$LT$T$u20$as$u20$pyo3..type_object..PyTypeObject$GT$::type_object::hdb25731dbc5338c6 in libpyo3-913629c20f98e13f.rlib(pyo3-913629c20f98e13f.pyo3.6883f49f-cgu.0.rcgu.o)
            "_PyObject_Call", referenced from:
                pyo3::conversion::ToBorrowedObject::with_borrowed_ptr::hedf2f82d83ab96cb in ohmyfpg.ohmyfpg.0ce9d21d-cgu.4.rcgu.o
                pyo3::conversion::ToBorrowedObject::with_borrowed_ptr::h27107c36ebc15bc3 in libpyo3_asyncio-4ebf71785e0b5ede.rlib(pyo3_asyncio-4ebf71785e0b5ede.pyo3_asyncio.59033d10-cgu.6.rcgu.o)
                pyo3::conversion::ToBorrowedObject::with_borrowed_ptr::hb8cabddf81945b1c in libpyo3_asyncio-4ebf71785e0b5ede.rlib(pyo3_asyncio-4ebf71785e0b5ede.pyo3_asyncio.59033d10-cgu.6.rcgu.o)
            "_PyExc_AttributeError", referenced from:
                pyo3::types::module::PyModule::index::h81733ab8bc6e8baf in libpyo3-913629c20f98e13f.rlib(pyo3-913629c20f98e13f.pyo3.6883f49f-cgu.9.rcgu.o)
            "_PyType_GenericAlloc", referenced from:
                pyo3::pyclass_init::PyClassInitializer$LT$T$GT$::create_cell::h185f51dc3f5fa46c in ohmyfpg.ohmyfpg.0ce9d21d-cgu.11.rcgu.o
                pyo3::pyclass_init::PyClassInitializer$LT$T$GT$::create_cell::h47163a23e9378946 in libpyo3_asyncio-4ebf71785e0b5ede.rlib(pyo3_asyncio-4ebf71785e0b5ede.pyo3_asyncio.59033d10-cgu.15.rcgu.o)
            "__Py_Dealloc", referenced from:
                pyo3::conversion::ToBorrowedObject::with_borrowed_ptr::h48424c59d102faa4 in ohmyfpg.ohmyfpg.0ce9d21d-cgu.4.rcgu.o
                pyo3::conversion::ToBorrowedObject::with_borrowed_ptr::hc944e48ea30a104d in ohmyfpg.ohmyfpg.0ce9d21d-cgu.4.rcgu.o
                pyo3::conversion::ToBorrowedObject::with_borrowed_ptr::hedf2f82d83ab96cb in ohmyfpg.ohmyfpg.0ce9d21d-cgu.4.rcgu.o
                pyo3::conversion::ToBorrowedObject::with_borrowed_ptr::h0c97cf4645a345fa in ohmyfpg.ohmyfpg.0ce9d21d-cgu.8.rcgu.o
                pyo3::conversion::ToBorrowedObject::with_borrowed_ptr::ha1bcf86b6a6dffcf in ohmyfpg.ohmyfpg.0ce9d21d-cgu.8.rcgu.o
                pyo3::conversion::ToBorrowedObject::with_borrowed_ptr::h4cc17e0704ce7b72 in libpyo3-913629c20f98e13f.rlib(pyo3-913629c20f98e13f.pyo3.6883f49f-cgu.5.rcgu.o)
                pyo3::impl_::pyclass::get_sequence_item_from_mapping::h5ec6ca4222ea61e4 in libpyo3-913629c20f98e13f.rlib(pyo3-913629c20f98e13f.pyo3.6883f49f-cgu.5.rcgu.o)
                ...
            "_PyDict_Next", referenced from:
                pyo3::impl_::extract_argument::FunctionDescription::extract_arguments_tuple_dict::hcc8a5e2ef4f5884d in libpyo3_asyncio-4ebf71785e0b5ede.rlib(pyo3_asyncio-4ebf71785e0b5ede.pyo3_asyncio.59033d10-cgu.8.rcgu.o)
            "_PyObject_CallNoArgs", referenced from:
                pyo3::types::any::PyAny::call0::h33c9723cccf1b15e in libpyo3-913629c20f98e13f.rlib(pyo3-913629c20f98e13f.pyo3.6883f49f-cgu.4.rcgu.o)
            "_PyType_IsSubtype", referenced from:
                std::panicking::try::hde5c69cb17bc9ce2 in ohmyfpg.ohmyfpg.0ce9d21d-cgu.2.rcgu.o
                std::panicking::try::hea789ed6028065bf in libpyo3_asyncio-4ebf71785e0b5ede.rlib(pyo3_asyncio-4ebf71785e0b5ede.pyo3_asyncio.59033d10-cgu.3.rcgu.o)
            "_PyExc_Exception", referenced from:
                _$LT$T$u20$as$u20$pyo3..type_object..PyTypeObject$GT$::type_object::h941a85a01ded913d in ohmyfpg.ohmyfpg.0ce9d21d-cgu.13.rcgu.o
                pyo3::once_cell::GILOnceCell$LT$T$GT$::init::h336b49545f9703e0 in ohmyfpg.ohmyfpg.0ce9d21d-cgu.2.rcgu.o
                pyo3::once_cell::GILOnceCell$LT$T$GT$::init::h99e937c0e8a80465 in ohmyfpg.ohmyfpg.0ce9d21d-cgu.2.rcgu.o
                pyo3::once_cell::GILOnceCell$LT$T$GT$::init::hb2fb81cadd5acf84 in ohmyfpg.ohmyfpg.0ce9d21d-cgu.2.rcgu.o
                pyo3::once_cell::GILOnceCell$LT$T$GT$::init::hd0141b91223fdccc in ohmyfpg.ohmyfpg.0ce9d21d-cgu.2.rcgu.o
                pyo3::once_cell::GILOnceCell$LT$T$GT$::init::h9f38f7a2246332b6 in libpyo3_asyncio-4ebf71785e0b5ede.rlib(pyo3_asyncio-4ebf71785e0b5ede.pyo3_asyncio.59033d10-cgu.10.rcgu.o)
            "_PyErr_GivenExceptionMatches", referenced from:
                pyo3::types::module::PyModule::index::h81733ab8bc6e8baf in libpyo3-913629c20f98e13f.rlib(pyo3-913629c20f98e13f.pyo3.6883f49f-cgu.9.rcgu.o)
            "_PyList_Append", referenced from:
                pyo3::conversion::ToBorrowedObject::with_borrowed_ptr::hc944e48ea30a104d in ohmyfpg.ohmyfpg.0ce9d21d-cgu.4.rcgu.o
                pyo3::conversion::ToBorrowedObject::with_borrowed_ptr::h369dc0ebc32f8d23 in libpyo3-913629c20f98e13f.rlib(pyo3-913629c20f98e13f.pyo3.6883f49f-cgu.15.rcgu.o)
            "_PyExc_TypeError", referenced from:
                pyo3::err::PyErr::from_value::hd3cc63a7058e7498 in libpyo3-913629c20f98e13f.rlib(pyo3-913629c20f98e13f.pyo3.6883f49f-cgu.6.rcgu.o)
                pyo3::err::err_state::PyErrState::into_ffi_tuple::h465bd51d65a00b44 in libpyo3-913629c20f98e13f.rlib(pyo3-913629c20f98e13f.pyo3.6883f49f-cgu.1.rcgu.o)
                pyo3::impl_::extract_argument::argument_extraction_error::h8914f7b50d156406 in libpyo3-913629c20f98e13f.rlib(pyo3-913629c20f98e13f.pyo3.6883f49f-cgu.15.rcgu.o)
                _$LT$T$u20$as$u20$pyo3..type_object..PyTypeObject$GT$::type_object::h77e34c8f9be302be in libpyo3-913629c20f98e13f.rlib(pyo3-913629c20f98e13f.pyo3.6883f49f-cgu.0.rcgu.o)
            "_PyModule_GetName", referenced from:
                pyo3::types::module::PyModule::name::h5053031725f5a616 in libpyo3-913629c20f98e13f.rlib(pyo3-913629c20f98e13f.pyo3.6883f49f-cgu.9.rcgu.o)
            "_PyTuple_SetItem", referenced from:
                pyo3::conversion::ToBorrowedObject::with_borrowed_ptr::hedf2f82d83ab96cb in ohmyfpg.ohmyfpg.0ce9d21d-cgu.4.rcgu.o
                pyo3::types::tuple::_$LT$impl$u20$pyo3..conversion..IntoPy$LT$pyo3..instance..Py$LT$pyo3..types..any..PyAny$GT$$GT$$u20$for$u20$$LP$T0$C$T1$RP$$GT$::into_py::h656c74d1b454d212 in ohmyfpg.ohmyfpg.0ce9d21d-cgu.8.rcgu.o
                pyo3::types::tuple::_$LT$impl$u20$pyo3..conversion..IntoPy$LT$pyo3..instance..Py$LT$pyo3..types..any..PyAny$GT$$GT$$u20$for$u20$$LP$T0$C$$RP$$GT$::into_py::h12af0b154e5a6729 in libpyo3-913629c20f98e13f.rlib(pyo3-913629c20f98e13f.pyo3.6883f49f-cgu.15.rcgu.o)
                _$LT$T$u20$as$u20$pyo3..err..err_state..PyErrArguments$GT$::arguments::h0cebbbebb5f9b8ce in libpyo3-913629c20f98e13f.rlib(pyo3-913629c20f98e13f.pyo3.6883f49f-cgu.3.rcgu.o)
                pyo3::types::tuple::_$LT$impl$u20$pyo3..conversion..IntoPy$LT$pyo3..instance..Py$LT$pyo3..types..tuple..PyTuple$GT$$GT$$u20$for$u20$$LP$T0$C$T1$RP$$GT$::into_py::h9cbfa1ba8be2066b in libpyo3_asyncio-4ebf71785e0b5ede.rlib(pyo3_asyncio-4ebf71785e0b5ede.pyo3_asyncio.59033d10-cgu.4.rcgu.o)
                pyo3::types::tuple::_$LT$impl$u20$pyo3..conversion..IntoPy$LT$pyo3..instance..Py$LT$pyo3..types..tuple..PyTuple$GT$$GT$$u20$for$u20$$LP$T0$C$T1$RP$$GT$::into_py::ha963024cc84516f0 in libpyo3_asyncio-4ebf71785e0b5ede.rlib(pyo3_asyncio-4ebf71785e0b5ede.pyo3_asyncio.59033d10-cgu.4.rcgu.o)
            "_PyExc_BaseException", referenced from:
                _$LT$T$u20$as$u20$pyo3..type_object..PyTypeObject$GT$::type_object::h0370106eb35a5c05 in ohmyfpg.ohmyfpg.0ce9d21d-cgu.13.rcgu.o
                pyo3::once_cell::GILOnceCell$LT$T$GT$::init::h049a6b0900ea127f in libpyo3-913629c20f98e13f.rlib(pyo3-913629c20f98e13f.pyo3.6883f49f-cgu.9.rcgu.o)
            "_PyBytes_FromStringAndSize", referenced from:
                pyo3::types::bytes::_$LT$impl$u20$pyo3..conversion..IntoPy$LT$pyo3..instance..Py$LT$pyo3..types..any..PyAny$GT$$GT$$u20$for$u20$$RF$$u5b$u8$u5d$$GT$::into_py::heab328571edbf998 in libpyo3-913629c20f98e13f.rlib(pyo3-913629c20f98e13f.pyo3.6883f49f-cgu.5.rcgu.o)
            "_PyExc_OSError", referenced from:
                _$LT$T$u20$as$u20$pyo3..type_object..PyTypeObject$GT$::type_object::he3a56184cc7b24e5 in ohmyfpg.ohmyfpg.0ce9d21d-cgu.13.rcgu.o
            "_PyErr_NormalizeException", referenced from:
                pyo3::err::PyErr::make_normalized::he25d4c6592d2ec50 in libpyo3-913629c20f98e13f.rlib(pyo3-913629c20f98e13f.pyo3.6883f49f-cgu.6.rcgu.o)
            "_PyTuple_New", referenced from:
                pyo3::conversion::ToBorrowedObject::with_borrowed_ptr::hedf2f82d83ab96cb in ohmyfpg.ohmyfpg.0ce9d21d-cgu.4.rcgu.o
                pyo3::types::tuple::_$LT$impl$u20$pyo3..conversion..IntoPy$LT$pyo3..instance..Py$LT$pyo3..types..any..PyAny$GT$$GT$$u20$for$u20$$LP$T0$C$T1$RP$$GT$::into_py::h656c74d1b454d212 in ohmyfpg.ohmyfpg.0ce9d21d-cgu.8.rcgu.o
                pyo3::types::tuple::_$LT$impl$u20$pyo3..conversion..IntoPy$LT$pyo3..instance..Py$LT$pyo3..types..any..PyAny$GT$$GT$$u20$for$u20$$LP$T0$C$$RP$$GT$::into_py::h12af0b154e5a6729 in libpyo3-913629c20f98e13f.rlib(pyo3-913629c20f98e13f.pyo3.6883f49f-cgu.15.rcgu.o)
                _$LT$T$u20$as$u20$pyo3..err..err_state..PyErrArguments$GT$::arguments::h0cebbbebb5f9b8ce in libpyo3-913629c20f98e13f.rlib(pyo3-913629c20f98e13f.pyo3.6883f49f-cgu.3.rcgu.o)
                pyo3::types::tuple::_$LT$impl$u20$pyo3..conversion..IntoPy$LT$pyo3..instance..Py$LT$pyo3..types..tuple..PyTuple$GT$$GT$$u20$for$u20$$LP$T0$C$T1$RP$$GT$::into_py::h9cbfa1ba8be2066b in libpyo3_asyncio-4ebf71785e0b5ede.rlib(pyo3_asyncio-4ebf71785e0b5ede.pyo3_asyncio.59033d10-cgu.4.rcgu.o)
                pyo3::types::tuple::_$LT$impl$u20$pyo3..conversion..IntoPy$LT$pyo3..instance..Py$LT$pyo3..types..tuple..PyTuple$GT$$GT$$u20$for$u20$$LP$T0$C$T1$RP$$GT$::into_py::ha963024cc84516f0 in libpyo3_asyncio-4ebf71785e0b5ede.rlib(pyo3_asyncio-4ebf71785e0b5ede.pyo3_asyncio.59033d10-cgu.4.rcgu.o)
            "_PyErr_NewExceptionWithDoc", referenced from:
                pyo3::err::PyErr::new_type::h659d82008cf9dca1 in libpyo3-913629c20f98e13f.rlib(pyo3-913629c20f98e13f.pyo3.6883f49f-cgu.6.rcgu.o)
            "_PyBytes_AsString", referenced from:
                pyo3::types::string::PyString::to_string_lossy::h98fc361fb1fda7a6 in libpyo3-913629c20f98e13f.rlib(pyo3-913629c20f98e13f.pyo3.6883f49f-cgu.4.rcgu.o)
            "_PyErr_Restore", referenced from:
                ohmyfpg::bindings::__pyfunction_connect::hb3ea43f4f2040b28 in ohmyfpg.ohmyfpg.0ce9d21d-cgu.5.rcgu.o
                ohmyfpg::bindings::_::_$LT$impl$u20$pyo3..impl_..pyclass..PyMethods$LT$ohmyfpg..bindings..PyConnection$GT$$u20$for$u20$pyo3..impl_..pyclass..PyClassImplCollector$LT$ohmyfpg..bindings..PyConnection$GT$$GT$::py_methods::ITEMS::__wrap::hda94d84b16dc8a84 (.llvm.10971881702748161107) in ohmyfpg.ohmyfpg.0ce9d21d-cgu.5.rcgu.o
                pyo3::impl_::pyclass::tp_dealloc::hd33d3996118416ec in ohmyfpg.ohmyfpg.0ce9d21d-cgu.8.rcgu.o
                pyo3_asyncio::generic::_::_$LT$impl$u20$pyo3..impl_..pyclass..PyMethods$LT$pyo3_asyncio..generic..PyDoneCallback$GT$$u20$for$u20$pyo3..impl_..pyclass..PyClassImplCollector$LT$pyo3_asyncio..generic..PyDoneCallback$GT$$GT$::py_methods::ITEMS::__wrap::h5b9afe000e965cd9 (.llvm.5829919595951925386) in libpyo3_asyncio-4ebf71785e0b5ede.rlib(pyo3_asyncio-4ebf71785e0b5ede.pyo3_asyncio.59033d10-cgu.7.rcgu.o)
                pyo3::err::PyErr::take::h13e09712dfb81d3a in libpyo3-913629c20f98e13f.rlib(pyo3-913629c20f98e13f.pyo3.6883f49f-cgu.6.rcgu.o)
                pyo3::err::PyErr::print::hc2b4279361b4a372 in libpyo3-913629c20f98e13f.rlib(pyo3-913629c20f98e13f.pyo3.6883f49f-cgu.6.rcgu.o)
                pyo3::err::PyErr::print_and_set_sys_last_vars::h05167e9c723c04f5 in libpyo3-913629c20f98e13f.rlib(pyo3-913629c20f98e13f.pyo3.6883f49f-cgu.6.rcgu.o)
                ...
          ld: symbol(s) not found for architecture x86_64
          clang: error: linker command failed with exit code 1 (use -v to see invocation)
          

error: could not compile `ohmyfpg` due to previous error

My Cargo.toml:

[package]
name = "ohmyfpg"
version = "0.1.0-dev.18"
edition = "2021"

# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
[lib]
name = "ohmyfpg"
crate-type = ["cdylib", "rlib"]

[dependencies]
pyo3 = { version = "0.16.5", features = ["extension-module"] }
pyo3-asyncio = { version = "0.16", features = ["tokio-runtime"] }
tokio = "1.19.2"
...some other stuff...

[dev-dependencies]
criterion = { version = "0.3.6", features = ["async_tokio"] }

[[bench]]
name = "my_benchmark"
harness = false

[package.metadata.maturin]
python-source = "python"

Probably it would be just easier to separate the Rust core from the FFI using workspaces and add criterion only to the Rust core.

@sondrelg
Copy link

sondrelg commented Oct 5, 2022

Running into the same issue as you @se7entyse7en. Did you ever resolve it?

@se7entyse7en
Copy link

@sondrelg yes, I was able to overcome this by using two different cargo workspaces:

  • a "core" one that is a pure Rust project,
  • a "binding" one that contains only the bindings to Python (with pyo3 and pyo3-asyncio).

Then I used criterion only in the "core" one.

This is the project. As you can see here there's actually no criterion because in the end I only tested it and didn't commit, but you can see how the two workspaces are structured:

I hope it helps.

@sondrelg
Copy link

sondrelg commented Oct 8, 2022

I took a stab at splitting my project into two workspaces, but have concluded that it's not worth it for my use-case. It just adds too much complexity. Since I'm writing a Python package I think I'll just benchmark it with Python and call it a day.

Running criterion did work in the rust-only workspace though, so this is definitely an option for others 🙂

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests