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

Doesn't work when compiling the binary in debug mode #24

Closed
mainrs opened this issue Aug 30, 2020 · 5 comments
Closed

Doesn't work when compiling the binary in debug mode #24

mainrs opened this issue Aug 30, 2020 · 5 comments

Comments

@mainrs
Copy link

mainrs commented Aug 30, 2020

I always have problems when running my compiled binary in debug mode. For some reason inventory's iterator doesn't return anything. I always have to run the binary in release mode. This makes it harder to fix panics as the lines where they happen are unknown and not displayed in the stacktrace.

Not sure if this is related to #7...

OS: Windows 10 2004
rustc: 1.46.0 (does happen with earlier versions as well)
inventory: 0.1.8

@mainrs
Copy link
Author

mainrs commented Aug 31, 2020

Disabling incremental builds does resolve this:

# Cargo.toml
[profile.dev]
incremental = false

@mainrs
Copy link
Author

mainrs commented Sep 2, 2020

Doing a little more research and it seems that this problem is blocked by rust-lang/rust#47384. Someone also mentioned the incremental = false fix there: rust-lang/rust#47384 (comment)

@thegwan
Copy link

thegwan commented Feb 28, 2021

Also came across this issue. It seems that in release mode things work ok, but in debug mode the module in the crate has to actually be used for it to be properly submitted to the inventory

@mathstuf
Copy link
Contributor

I came across this behavior recently. It was working in the 2015 edition, but broke when changing to the 2018 edition.

@dtolnay
Copy link
Owner

dtolnay commented Jun 30, 2022

This is fixed in rustc 1.62.0 / inventory 0.3.0.

@dtolnay dtolnay closed this as completed Jun 30, 2022
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

4 participants