run miri for a big-endian target#3312
Conversation
it is identical to HeapCellValueTag
by wrapping BranchNumber in an Arc. PermVarAllocation::Done had size 208 and is now down to 32. A Box rather than an Arc would be smaller, but it looks like BranchNumber/BranchDesignator are clones a bunch so I expect it to be beneficial to reduce allocations both of the Box itself as well as its content.
rather than passing an address as usize pass the ArenaHeader pointer similarly don't return a u8 ptr but use a ArenaHeader pointer instead Don't convert the pointer to a ConsPtr by going through native endian bytes in between. We are exploiting the fact that the 3 least significant bytes are zero for pointer to types of alignment 8 and we expect these to line up with the f, m, and tag field at the end of the ConsPtr struct, but using native endiannes for this would only work on big endian systems.
the old logic would be incorrect if the payload has higher alignment than the ArenaHeader i.e. when there is padding between the ArenaHeader and the Payload
|
Marking as draft while I fiddle with CI |
|
Why is it necessary to disable so much functionality for this? Would it not be much preferable if this functionality were tested on big-endian targets too, especially due to its criticality? |
8ac45c7 to
777c004
Compare
|
I got cross-compilation with the crypto-full and ffi features working. Not working is
|
71f1de3 to
7dbd441
Compare
|
I give up on getting openssl cross-compilation and running test via qemu working. As such I consider this ready. |
Well, with the caveat that it requires #3311 to actually pass CI. |
|
None of the hash functions or signing and key exchange functionality requires OpenSSL, is it really necessary to make so much optional? I would hope this compiles on many more platforms, at least that was a key motivation for me to implement much of the cryptographic functionality so that it does not require OpenSSL. |
Initially I hadn't cross-compilation working yet so I had to gate the crypto functions depending on ring. Given that I got cross-compilation of ring working the first commit adding the Having a way to build without non-rust dependencies might still be nice. |
Yes indeed, and much of the cryptographic functionality is entirely Rust-based. For instance, the Ed25519 and Curve25519 functionality for signing and key exchange, and |
|
Marking this as draft until I get around to dropping commit 9648607 from this PR. I intend to open a separate PR for making ring optional. |
It sounds like what could be useful also more generally is to compile Scryer exclusively with those parts that are implemented natively in Rust, so maybe |
ca0a2ec to
e94ab87
Compare
|
merged #3311 into this, to get the fix this is adding testing for, so that CI is green |
Currently I expect CI to fail, after #3311 this should pass.
Add a new
cryptofeature so that crypto dependencies can be disabled so that this works without having to setup native libraries and toolchain for the big-endian target.