-
Notifications
You must be signed in to change notification settings - Fork 157
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
Having a default of std-atomics is problematic for 32 bit archs #323
Comments
So, at a high level: I don't intend to force everyone using That's the main reason I added the All of that said, we should be able to just disable the default features for leaf crates that depend on |
Isn’t portable atomic already mandatory as a dependency? Also, I think we should either trust portable atomic or not. I’m happy with not, but we will then need to reconsider the use of 64 bit operations and/or perhaps the applicability of metrics for 32 bit archs. Wdyt? |
I do trust I do realize that this perhaps feels like circular logic/silliness -- "you told me |
Sure, but aren’t we getting the std lib atomics still with portable atomic when supported by the target? I believe we are but my understanding could be off.
No problem at all! Just seeking the best outcome. I’m also happy for the decision to be that 32 bit support is out and clearly stated as a non-goal.
I’m unsure if you can “opt out” of the default features with cargo. Unless you mean to remove the default from metrics, and make it the default from the leaf crates then, on the basis that features are additive? |
Hey @tobz - I'm happy to close out this issue if you'd prefer. I'm actually thinking of experimenting with an open-metrics implementation that is suitable for no-std/no-alloc environments and thus more suitable than me. I therefore don't want to bend your original requirements here. |
Under the hood, essentially, but not at a type level. Our implementation of If we provide both, with the standard library ones behind a feature flag, then we always know that our maximal architecture support footprint is whatever
You can, by setting [dependencies]
metrics = { version = "0.20.1", default-features = false, features = ["maybe_one_of_the_defaults"] } Overall, this really should just boil down to using |
I tried that and couldn't get it to work. Perhaps I was doing something wrong. |
Hmmm, that's really weird. I'll take a shot today at putting my own suggestion into practice and try and see what's going on there. |
I believe this is resolved as of #347. |
Further to #313, I believe we have a problem given that std-atomics are a default feature for the metrics crate. As with any feature, you cannot "unset" it. Therefore, when depending on, say, metrics-utils, the default feature will be enabled no matter what your target is.
The std-atomics default was added back in for 65d965c.
Perhaps I'm missing something though? Or would it be better to have the std-atomics feature as the default for the other "leaf" crates?
That said, shouldn't the portable atomic library enable Atomic64 where it is available i.e. do we need the std-atomics feature at all?
For completeness, I'm trying to depend on both metrics-exporter-prometheus and metrics-util.
The text was updated successfully, but these errors were encountered: