-
-
Notifications
You must be signed in to change notification settings - Fork 148
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
fix(subscriber): fix compilation on targets without 64-bit atomics #282
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
## Motivation Currently, the `console-subscriber` crate does not compile on targets without 64-bit atomic operations, such as `mipsel-unknown-linux-musl`. This is because a 64-bit atomic is used to store the last task ID that polled a resource. ## Solution This branch changes this code to use the `AtomicCell` type from `crossbeam-utils`, instead. `AtomicCell` will use atomic operations on targets that support 64-bit atomics, and fall back to using a mutex on platforms that don't have 64-bit atomic operations. This should fix the build on those platforms. Fixes #279
@spacemeowx2, would you mind checking out this branch and verifying that it does, in fact, fix the build issues you reported in #279? I wasn't able to easily verify the fix, as I'm running NixOS, and the Thank you! |
It compiles with e0afa98 Thanks! |
@spacemeowx2 great, thanks for checking that for me! |
hawkw
added a commit
that referenced
this pull request
Feb 18, 2022
## 0.1.3 (2022-02-18) #### Bug Fixes * record timestamps for updates last (#289) ([703f1aa](703f1aa), closes [#266](266)) * use monotonic `Instant`s for all timestamps (#288) ([abc0830](abc0830), closes [#286](286)) * bail rather than panic when encountering clock skew (#287) ([24db8c6](24db8c6), closes [#286](286)) * fix compilation on targets without 64-bit atomics (#282) ([5590fdb](5590fdb), closes [#279](279))
hawkw
added a commit
that referenced
this pull request
Feb 18, 2022
#### Features * add `Builder::filter_env_var` builder parameter (#276) ([dbdb149](dbdb149), closes [#206](206)) #### Bug Fixes * record timestamps for updates last (#289) ([703f1aa](703f1aa), closes [#266](266)) * use monotonic `Instant`s for all timestamps (#288) ([abc0830](abc0830), closes [#286](286)) * bail rather than panic when encountering clock skew (#287) ([24db8c6](24db8c6), closes [#286](286)) * fix compilation on targets without 64-bit atomics (#282) ([5590fdb](5590fdb), closes [#279](279))
hawkw
added a commit
that referenced
this pull request
Feb 18, 2022
#### Features * add `Builder::filter_env_var` builder parameter (#276) ([dbdb149](dbdb149), closes [#206](206)) #### Bug Fixes * record timestamps for updates last (#289) ([703f1aa](703f1aa), closes [#266](266)) * use monotonic `Instant`s for all timestamps (#288) ([abc0830](abc0830), closes [#286](286)) * bail rather than panic when encountering clock skew (#287) ([24db8c6](24db8c6), closes [#286](286)) * fix compilation on targets without 64-bit atomics (#282) ([5590fdb](5590fdb), closes [#279](279))
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Motivation
Currently, the
console-subscriber
crate does not compile on targetswithout 64-bit atomic operations, such as
mipsel-unknown-linux-musl
.This is because a 64-bit atomic is used to store the last task ID that
polled a resource.
Solution
This branch changes this code to use the
AtomicCell
type fromcrossbeam-utils
, instead.AtomicCell
will use atomic operations ontargets that support 64-bit atomics, and fall back to using a mutex on
platforms that don't have 64-bit atomic operations. This should fix the
build on those platforms.
Fixes #279