Bug #121119 MySQL Shell currently fails to build on big-endian architectures
Submitted: 18 Aug 18:23 Modified: 20 Oct 20:30
Reporter: Lena Voytek (OCA) Email Updates:
Status: Closed Impact on me:
None 
Category:Shell General / Core Client Severity:S3 (Non-critical)
Version:9.7.0+ OS:Ubuntu (26.10 upcoming)
Assigned to: CPU Architecture:Other (s390x)

[18 Aug 18:23] Lena Voytek
Description:
I understand there are no officially supported big-endian architectures for MySQL Shell, however:

When attempting to build MySQL Shell for s390x, it fails with 

mysqlshdk/libs/db/mysql/binary_log.cc: error: ‘A’ was not declared in this scope
return static_cast<uint32_t>(A[0]) | (static_cast<uint32_t>(A[1]) << 8)

and

mysqlshdk/libs/db/mysql/binary_log.cc: error: unused parameter ‘ptr’ [-Werror=unused-parameter]
inline uint32_t uint4korr(const unsigned char *ptr) {

How to repeat:
Build MySQL Shell for s390x or another big-endian architecture

Suggested fix:
https://github.com/mysql/mysql-shell/pull/31
[19 Aug 17:04] OCA Admin
Contribution submitted via Github - Bug #121119 - Fix big-endian build failure due to incorrect variable name 
(*) Contribution by Lena Voytek (Github lvoytek, https://github.com/mysql/mysql-shell/pull/31#issuecomment-5341789363): I confirm the code being submitted is offered under the terms of the OCA, and that I am authorized to contribute it.

Contribution: git_patch_4307273729.txt (text/plain), 1.34 KiB.

[10 Sep 9:42] Pawel Andruszkiewicz
Thank you for your contribution.
[14 Sep 14:48] MySQL Admin
Posted by developer: Bug status updated to 'Patch pending'
[16 Sep 8:48] MySQL Admin
Posted by developer: Bug status updated to 'Patch approved'
[17 Sep 8:48] MySQL Admin
Posted by developer: Bug status updated to 'Documenting'
[20 Oct 20:30] Edward Gilmore
Posted by developer:
 
Added the following note to the MySQL Shell 26.10.0 release notes:
 
On s390x and other big-endian architectures, which are not officially
supported, MySQL Shell source builds could fail because the binary log
reader referenced an undeclared variable and left its buffer parameter
unused. The reader now uses the buffer parameter when decoding four-byte
integers. Errors were returned similar to the following:

mysqlshdk/libs/db/mysql/binary_log.cc: error: ‘A’ was not declared in
this scope return static_cast&lt;uint32_t&gt;(A[0]) 
(static_cast&lt;uint32_t&gt;(A[1]) lt;&lt 8)
mysqlshdk/libs/db/mysql/binary_log.cc: error: unused parameter ‘ptr’
[-Werror=unused-parameter] 

Our thanks to Lena Voytek for the contribution.