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

thingbuf can't compile on macos #54

Closed
guswynn opened this issue Mar 16, 2022 · 1 comment
Closed

thingbuf can't compile on macos #54

guswynn opened this issue Mar 16, 2022 · 1 comment

Comments

@guswynn
Copy link

guswynn commented Mar 16, 2022

I think this is definitely a problem with the std implementation, so i asked in the zulip lib channel, but there is probably a way around this with AssertUnwindSafe:

2022-03-16 8:29:56 I > cargo +1.56.0 build
   Compiling testing v0.1.0 (/Users/gus/repos/testing)
error[E0277]: the type `UnsafeCell<libc::unix::bsd::apple::pthread_cond_t>` may contain interior mutability and a reference may not be safely transferrable across a catch_unwind boundary
 --> src/main.rs:6:5
  |
6 |     safe(std::thread::current());
  |     ^^^^ `UnsafeCell<libc::unix::bsd::apple::pthread_cond_t>` may contain interior mutability and a reference may not be safely transferrable across a catch_unwind boundary
  |
  = help: within `std::thread::Inner`, the trait `RefUnwindSafe` is not implemented for `UnsafeCell<libc::unix::bsd::apple::pthread_cond_t>`
  = note: required because it appears within the type `std::sys::unix::condvar::Condvar`
  = note: required because it appears within the type `*const std::sys::unix::condvar::Condvar`
  = note: required because it appears within the type `Unique<std::sys::unix::condvar::Condvar>`
  = note: required because it appears within the type `Box<std::sys::unix::condvar::Condvar>`
  = note: required because it appears within the type `std::sys_common::condvar::Condvar`
  = note: required because it appears within the type `Condvar`
  = note: required because it appears within the type `std::sys_common::thread_parker::generic::Parker`
  = note: required because it appears within the type `std::thread::Inner`
  = note: required because of the requirements on the impl of `UnwindSafe` for `Arc<std::thread::Inner>`
  = note: required because it appears within the type `Thread`
note: required by a bound in `safe`
 --> src/main.rs:1:12
  |
1 | fn safe<U: std::panic::UnwindSafe>(u: U) {}
  |            ^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `safe`

For more information about this error, try `rustc --explain E0277`.
error: could not compile `testing` due to previous error
hawkw added a commit that referenced this issue Mar 16, 2022
This fixes a compilation error that occurs on macOS due to
`std::thread::Thread` not being `UnwindSafe` on that platform. It's kind
of sad that we have to do this, but I think it's probably fine.

Fixes #54

Signed-off-by: Eliza Weisman <[email protected]>
@hawkw
Copy link
Owner

hawkw commented Mar 16, 2022

PR #53 should fix this. I also added a macOS CI run, but unfortunately, I can't actually confirm that it fixes the compilation error because GitHub Actions is down :/

hawkw added a commit that referenced this issue Mar 16, 2022
This fixes a compilation error that occurs on macOS due to
`std::thread::Thread` not being `UnwindSafe` on that platform. It's kind
of sad that we have to do this, but I think it's probably fine.

Fixes #54

Signed-off-by: Eliza Weisman <[email protected]>
@hawkw hawkw closed this as completed in d0d0cd9 Mar 16, 2022
hawkw added a commit that referenced this issue Mar 16, 2022
<a name="v0.1.1"></a>
### v0.1.1 (2022-03-16)

#### Performance

*   elide bounds checks when indexing (#51)
    ([27ea0ec](27ea0ec))
* **mpsc:**  remove panics from wait queue (#50)
  ([f61993f](f61993f))

#### Bug Fixes

* **mpsc:**  compilation error on macOS (#53)
  ([d0d0cd9](d0d0cd9),
  closes [#54](#54))
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

2 participants