-
Notifications
You must be signed in to change notification settings - Fork 38.7k
test: fix feature_addrman.py on big-endian systems
#27529
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
test: fix feature_addrman.py on big-endian systems
#27529
Conversation
The test `feature_addrman.py` currently serializes the addrdb without specifying endianness for `int`s, so the machine's native byte order is used (see https://docs.python.org/3/library/struct.html#byte-order-size-and-alignment) and the generated `peers.dat` would be invalid on big-endian systems. Fix this by explicitly specifying little-endian serialization via the `<` character in `struct.pack(...)`.
|
The following sections might be updated with supplementary metadata relevant to reviewers and maintainers. ReviewsSee the guideline for information on the review process.
If your review is incorrectly listed, please react with 👎 to this comment and the bot will ignore it on the next update. |
|
There is |
|
See #28087 |
maflcko
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
review lgtm. Will test later with #28087
lgtm ACK 53c990a 🔚
Show signature
Signature:
untrusted comment: signature from minisign secret key on empty file; verify via: minisign -Vm "${path_to_any_empty_file}" -P RWTRmVTMeKV5noAMqVlsMugDDCyyTSbA3Re5AkUrhvLVln0tSaFWglOw -x "${path_to_this_whole_four_line_signature_blob}"
RUTRmVTMeKV5npGrKx1nqXCw5zeVHdtdYURB/KlyA/LMFgpNCs+SkW9a8N95d+U4AP1RJMi+krxU1A3Yux4bpwZNLvVBKy0wLgM=
trusted comment: lgtm ACK 53c990ad3406ee945305af84af98d2f020e5f316 🔚
Q4OT2tQTqBObBcrKRFcksXJ+Hmk4cjXI0J1/jP0WyRJv9KJBww/yqNmqG4wmwyFsKkVg4cftn3+JzTrEqVQqCA==
|
tested as well, so my recommendation would be to merge this before ##28087 |
fad0b67 ci: Use qemu-user through container engine (MarcoFalke) Pull request description: Currently the CI containers always run on the host architecture, and only wrap `bitcoind` into `qemu-user` when needed. This has many issues: * The `i386` tasks can not be run on non-x86 hosts. * `config.guess` isn't present when building the CI image, which is fine. But it prints a warning, see bitcoin/bitcoin#27739 (review) * The python tests are run on the host architecture, making it harder to find architecture specific bugs. See for example bitcoin/bitcoin#27529 (comment) * All modern container engines support automatic dispatch to qemu-user, so it seems redundant to re-invent the wheel. Fix all issues by: * removing `HOST` from `ci/test/00_setup_env.sh`. * removing `QEMU_USER_CMD` and `ci/test/wrap-qemu.sh`. * removing `DPKG_ADD_ARCH` where possible, and pruning `PACKAGES` where possible. * specifying the architecture in `CI_IMAGE_NAME_TAG` to be used by the container engine. ACKs for top commit: fanquake: ACK fad0b67 - this seems ok to me, and removes complexity from our CI system. Tree-SHA512: 85e79f9f570e292d70a629d112fd4a6e6217d96226a1b665ed13485f616d84720ad2126b7d4b22fc603049f72fa7f2163b56a6bc276319fcd8b0496304ea4157
…tems 53c990a test: fix `feature_addrman.py` on big-endian systems (Sebastian Falbesoner) Pull request description: The test `feature_addrman.py` currently serializes the addrdb without specifying endianness for `int`s, so the machine's native byte order is used (see https://docs.python.org/3/library/struct.html#byte-order-size-and-alignment) and the generated `peers.dat` would be invalid on big-endian systems (our internal (de)serializers always use little-endian, see `ser_{read,write}data32`). Fix this by explicitly specifying little-endian serialization via the `<` character in `struct.pack(...)`. This is not detected by CI as we unfortunately don't run functional tests on big-endian systems there (I think we definitely should!). ACKs for top commit: MarcoFalke: lgtm ACK 53c990a 🔚 Tree-SHA512: 513af6f1f785a713e7a8ef3a57fcd3fe2520a7d537f63a9c8e1f4bdea4c2f605fd4c35001623d6b13458883dbc256f24943684ab8f224055c22bf8d8eeee5fe2
The test `feature_addrman.py` currently serializes the addrdb without specifying endianness for `int`s, so the machine's native byte order is used (see https://docs.python.org/3/library/struct.html#byte-order-size-and-alignment) and the generated `peers.dat` would be invalid on big-endian systems. Fix this by explicitly specifying little-endian serialization via the `<` character in `struct.pack(...)`. Github-Pull: bitcoin#27529 Rebased-From: 53c990a
The test
feature_addrman.pycurrently serializes the addrdb without specifying endianness forints, so the machine's native byte order is used (see https://docs.python.org/3/library/struct.html#byte-order-size-and-alignment) and the generatedpeers.datwould be invalid on big-endian systems (our internal (de)serializers always use little-endian, seeser_{read,write}data32). Fix this by explicitly specifying little-endian serialization via the<character instruct.pack(...).This is not detected by CI as we unfortunately don't run functional tests on big-endian systems there (I think we definitely should!).