-
Notifications
You must be signed in to change notification settings - Fork 60
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
feature: add support for 32-bit architectures #302
Comments
Unless I'm mistaken, 32-bit platforms were never officially supported by this library so this is a feature request (not a bug). The README lists these 64-bit platforms under the Current Status section:
@fxamacker please correct me if I'm mistaken. |
Well, there are a lot of 32bit platforms still out there! :) From my initial look, I hope it wouldn't be too hard to update the variable types to (u)int64, so the sizes would be the same regardless of the architecture. This library is one of the (many) dependencies of packaging LXD for Debian, and I'd like to make it available on as many different architectures supported by Debian as possible. |
Spent a little bit of time this afternoon investigating further, and came up with this commit: 7a8157a. With that applied, the build and all tests succeed on both amd64 and i386 architectures running on Linux/golang1.17.5. |
Very interesting! BTW, changing data type from int to int64 or vice versa can introduce security issues or other runtime problems, so it usually involves a lot more work after initial coding changes. E.g. depending on the programming language, there might be runtime errors decoding > 2^32 items into map or other container data types on 32-bit arch. So adding support for 32-bit arch can require adding more tests and fuzzing on 32-bit & 64-bit platforms for multiple weeks each. And CI may need to be updated to add 32-bit platforms, etc. |
What version of fxamacker/cbor are you using?
2.3.0
Does this issue reproduce with the latest release?
Yes, this is the latest release
What OS and CPU architecture are you using (
go env
)?This was observed in build logs from Debian's buildd instances for i386 and armhf:
What did you do?
Build the library and run the tests on any 32bit system.
What did you expect to see?
All tests pass.
What did you see instead?
The text was updated successfully, but these errors were encountered: