You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
While packaging stuff for debian I noticed some build failures on 32-bit architectures.
The first is in rkyv_derive and happens with default features.
error: literal out of range for `usize`
--> rkyv_derive/src/archive.rs:785:41
|
785 | 4_294_967_296..=18_446_744_073_709_551_615 => IntRepr::U64,
| ^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= note: the literal `18_446_744_073_709_551_615` does not fit into the type `usize` whose range is `0..=4294967295`
My fix was to change the match statement to.
let int_repr = match data.variants.len() as u128 {
This works, but I'm not sure what if-any impact it has on optimisation of the code. Possiblly something with cfg attributes would be more efficient.
After fixing that, I ran into a second issue in the rkyv crate, but only when the (non-default) size_64 option is enabled.
error[E0599]: the method `as_ptr` exists for struct `rel_ptr::RelPtr<T, i64>`, but its trait bounds were not satisfied
--> rkyv/src/boxed.rs:19:27
|
19 | unsafe { &*self.0.as_ptr() }
| ^^^^^^ method cannot be called on `rel_ptr::RelPtr<T, i64>` due to unsatisfied trait bounds
|
::: rkyv/src/rel_ptr/mod.rs:267:1
|
267 | pub struct RelPtr<T: ArchivePointee + ?Sized, O> {
| ------------------------------------------------ method `as_ptr` not found for this
|
= note: the following trait bounds were not satisfied:
`i64: Offset`
And a bunch more similar errors, I don't know if it makes any sense to build rkyv with the size_64 option on a system that can't actually handle data structures that size.
The text was updated successfully, but these errors were encountered:
58eb31f fixes the data.variants.len() issue. For the second issue with size_64, you're correct. rkyv only the use of pointer offsets that can actually be supported by the target architecture. Otherwise you could end up in tricky situations with getelementptr and friends. Does that resolve this issue?
The compiler error has been fixed, so I'm closing this issue. The size_64 feature (now renamed to pointer_width_64) does not work on 32-bit and lower machines.
While packaging stuff for debian I noticed some build failures on 32-bit architectures.
The first is in rkyv_derive and happens with default features.
My fix was to change the match statement to.
let int_repr = match data.variants.len() as u128 {
This works, but I'm not sure what if-any impact it has on optimisation of the code. Possiblly something with cfg attributes would be more efficient.
After fixing that, I ran into a second issue in the rkyv crate, but only when the (non-default) size_64 option is enabled.
And a bunch more similar errors, I don't know if it makes any sense to build rkyv with the size_64 option on a system that can't actually handle data structures that size.
The text was updated successfully, but these errors were encountered: