kanidm / concread

Concurrently Readable Data Structures for Rust
Mozilla Public License 2.0
339 stars 15 forks source link

fails to build on armel, mipsel, powerpc #89

Closed tjaalton closed 1 year ago

tjaalton commented 1 year ago
error[E0432]: unresolved import `std::sync::atomic::AtomicU64`
  --> /<<PKGBUILDDIR>>/vendor/concread/src/threadcache/mod.rs:18:25
   |
18 | use std::sync::atomic::{AtomicU64, Ordering};
   |                         ^^^^^^^^^
   |                         |
   |                         no `AtomicU64` in `sync::atomic`
   |                         help: a similar name exists in the module: `AtomicU8`

error[E0599]: no method named `clone` found for struct `Arc<_>` in the current scope
   --> /<<PKGBUILDDIR>>/vendor/concread/src/threadcache/mod.rs:106:48
    |
106 |                 inv_up_to_txid: inv_up_to_txid.clone(),
    |                                                ^^^^^ method not found in `Arc<_>`

Some errors have detailed explanations: E0432, E0599.
For more information about an error, try `rustc --explain E0432`.
error: could not compile `concread` due to 2 previous errors`
Firstyear commented 1 year ago

What CPU did you attempt this on? In general we do not support 32 bit platforms due to the nature of this library.

tjaalton commented 1 year ago

armel, mips, powerpc builds on Debian.

The docs (https://doc.rust-lang.org/std/sync/atomic/) also say that these platforms don't have AtomicU64 or AtomicI64. There is https://github.com/taiki-e/portable-atomic that would be of help here.

Firstyear commented 1 year ago

What were you trying to build is probably a better question here. The threadcache should be gated behind it's own feature regardless.

Saying this, I'm not super interested to support 32 bit platforms. The two large users of this library are Kanidm and 389-ds - both of which do NOT support 32 bit platforms.

tjaalton commented 1 year ago

I've packaged concread separately so that 389-ds can drop the vendored stuff, but in the meantime it does still build those and that's when I found that it (too) failed on these archs.

Firstyear commented 1 year ago

The problem here is 389-ds is not supported on 32bit platforms - so I think you should not be packaging it for these arches anyway.

Regardless, we have merged a feature that disables the thread cache by default since it's a testing feature only, so this should assist.

Firstyear commented 1 year ago

PS: Also worth pointing out that 389-ds is stuck on an old version of concread due to limitations of which rust compiler versions are supported in rh. So it's likely you'll hit similar in debian :(

tjaalton commented 1 year ago

Thanks, I've hid threadcache behind the config option locally.

We have rustc 1.64, and I don't need to worry about backports :)