InfiniTimeOrg / InfiniTime

Firmware for Pinetime smartwatch written in C++ and based on FreeRTOS
GNU General Public License v3.0
2.64k stars 903 forks source link

Navigation external font breaks build with new `@swc/core` #1859

Closed FintasticMan closed 8 months ago

FintasticMan commented 9 months ago

Verification

What happened?

Since 44d1798f4f20ac4bf9f66690e49c4bd0b2d863ff, the build breaks when using a version of @swc/core newer than 1.3.39.

What should happen instead?

No response

Reproduction steps

  1. Install the npm packages required to build InfiniTime, lv_font_conv, lv_img_conv and @swc/core.
  2. Try to build the firmware with the BUILD_RESOURCES CMake option enabled.
  3. Notice the following error:
click to show error ```plaintext /home/finlay/programming/InfiniTime/node_modules/lv_img_conv/lib/image-q/utils/point.ts:85 this.r = point.r; ^ TypeError: Cannot read properties of undefined (reading 'r') at Point.from (/home/finlay/programming/InfiniTime/node_modules/lv_img_conv/lib/image-q/utils/point.ts:85:20) at ErrorDiffusionArray. (/home/finlay/programming/InfiniTime/node_modules/lv_img_conv/lib/image-q/image/array.ts:128:15) at step (/home/finlay/programming/InfiniTime/node_modules/lv_img_conv/lib/image-q/image/array.ts:205:23) at Object.next (/home/finlay/programming/InfiniTime/node_modules/lv_img_conv/lib/image-q/image/array.ts:146:20) at Immediate.next (/home/finlay/programming/InfiniTime/node_modules/lv_img_conv/lib/image-q/basicAPI.ts:163:33) at processImmediate (node:internal/timers:478:21) Traceback (most recent call last): File "/home/finlay/programming/InfiniTime/src/resources/generate-img.py", line 56, in main() File "/home/finlay/programming/InfiniTime/src/resources/generate-img.py", line 51, in main subprocess.check_call(line) File "/usr/lib/python3.11/subprocess.py", line 413, in check_call raise CalledProcessError(retcode, cmd) subprocess.CalledProcessError: Command '['/home/finlay/programming/InfiniTime/node_modules/.bin/lv_img_conv', '/home/finlay/programming/InfiniTime/src/resources/images/navigation1.png', '--force', '--output-file', 'navigation1.bin', '--color-format', 'CF_INDEXED_1_BIT', '--output-format', 'bin', '--binary-format', 'ARGB8565_RBSWAP']' returned non-zero exit status 1. ```

More details?

As a temporary solution, I've updated my pull request #1764 to pin @swc/core to version 1.3.39.

The issue seems to be caused by the use of the CF_INDEXED_1_BIT colour format. It is most likely an issue with lv_img_conv.

Version

main

Companion app

No response

FintasticMan commented 8 months ago

Fixed by #1863.