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

Not working fine on macOS #52

Open
50U10FCA7 opened this issue Sep 8, 2022 · 7 comments
Open

Not working fine on macOS #52

50U10FCA7 opened this issue Sep 8, 2022 · 7 comments

Comments

@50U10FCA7
Copy link

50U10FCA7 commented Sep 8, 2022

Inventory stops collecting anything on MacOS in some cases. Think it's because of fn pointers inside plugin, but not sure.

Here's MRE (see GitHub actions):
https://github.com/50U10FCA7/inventory_issue_test

@tyranron
Copy link

tyranron commented Sep 8, 2022

@trevyn
Copy link

trevyn commented Sep 8, 2022

This works for me with:

[profile.dev]
incremental = false

[profile.release]
codegen-units = 1

@50U10FCA7
Copy link
Author

Still unclear why this problem appears, but linkme crate has the same issue: https://github.com/50U10FCA7/inventory_issue_test/runs/8305029222?check_suite_focus=true#step:4:24

Looks like problem with linkage on macOS.

@Bajix
Copy link

Bajix commented Nov 8, 2022

It would be an appropriate use of panic to include static assertions that check the CARGO_PROFILE__CODEGEN_UNITS env variable as a way of making sure that should inventory be a dependency this is not overlooked.

@inferiorhumanorgans
Copy link

[profile.dev]
incremental = false

[profile.release]
codegen-units = 1

This is definitely not working for me. Only some instances of inventory::submit! are being picked up even if I blow away the target directory.

$ uname -rv
uname -rv
18.7.0 Darwin Kernel Version 18.7.0: Tue Jun 22 19:37:08 PDT 2021; root:xnu-4903.278.70~1/RELEASE_X86_64
$ ld -v
@(#)PROGRAM:ld  PROJECT:ld64-530
BUILD 18:57:17 Dec 13 2019
configured to support archs: armv6 armv7 armv7s arm64 arm64e arm64_32 i386 x86_64 x86_64h armv6m armv7k armv7m armv7em
LTO support using: LLVM version 11.0.0, (clang-1100.0.33.17) (static support for 23, runtime is 23)
TAPI support using: Apple TAPI version 11.0.0 (tapi-1100.0.11)
$ rustc --version
rustc 1.72.0-nightly (fe7454bf4 2023-06-19)
$ grep -A2 -F '[profile.' Cargo.toml
[profile.dev]
incremental = false

--
[profile.release]
codegen-units = 1

$

@Ragora
Copy link

Ragora commented Sep 7, 2023

Been trying to figure this out as well, but I haven't ever gotten it to report anything but empty results so far. Also, the codegen units fix doesn't seem to work in my case either.

@velvia
Copy link

velvia commented Apr 26, 2024

I saw this problem for 0.3 and the following did fix it for me, at least for tests.

[profile.dev]
incremental = false

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

7 participants