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

Does not compile on 32-bit systems #146

Open
jackpot51 opened this issue Feb 7, 2023 · 6 comments
Open

Does not compile on 32-bit systems #146

jackpot51 opened this issue Feb 7, 2023 · 6 comments

Comments

@jackpot51
Copy link

error[E0599]: the method `view_bits_mut` exists for type `u64`, but its trait bounds were not satisfied
   --> aml/src/value.rs:525:23
    |
525 |                 value.view_bits_mut::<bitvec::order::Lsb0>()[0..length].clone_from_bitslice(bits);
    |                       ^^^^^^^^^^^^^ method cannot be called on `u64` due to unsatisfied trait bounds
    |
    = note: the following trait bounds were not satisfied:
            `u64: BitStore`
            which is required by `u64: BitView`
@rw-vanc
Copy link
Contributor

rw-vanc commented Feb 7, 2023

From BitStore in the docs:
BitStore is the simpler of the two parameters. It refers to the integer type
used to hold bits. It must be one of the Rust unsigned integer fundamentals:
u8, u16, u32, usize, and on 64-bit systems only, u64.

@IsaacWoods
Copy link
Member

Hm, yeah weird. Not sure I understand why BitStore can't be implemented for u64 regardless of the platform's pointer size, but I must be missing something.

  1. We should definitely be testing a 32-bit platform on CI if you guys are interested in it compiling
  2. We need a different crate / workaround to handle the functionality bitvec is doing for us but on 32-bit too

@rw-vanc
Copy link
Contributor

rw-vanc commented Feb 9, 2023

We definitely need to support 32 bit, i686 is one of Redox's supported architectures. It looks to me like the use of BitStore is just an optimization, although I did not confirm that. I was able to use conditional compilation to avoid the compilation error, (only use the bitvec optimization for fields of 32 bits or less when on x86) but I don't have a good way of testing that my implementation functions correctly.

@rw-vanc
Copy link
Contributor

rw-vanc commented Mar 2, 2023

Please prioritize this if you can, we are trying to port to v86 in-browser boot, and it requires a 32-bit executable.

@IsaacWoods
Copy link
Member

IsaacWoods commented Mar 3, 2023

Temporary hack is now merged and published as aml v0.16.3 - this will be fixed more elegantly in the future but hopefully this should allow you to move forward in the meantime.

Leaving this open to track.

@jackpot51 jackpot51 reopened this Mar 5, 2023
@jackpot51
Copy link
Author

jackpot51 commented Mar 5, 2023

I can confirm it is fixed, if you want to leave it open I will

@IsaacWoods IsaacWoods mentioned this issue Mar 8, 2023
5 tasks
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

3 participants