Skip to content

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

@FintasticMan

Description

@FintasticMan

Verification

  • I searched for similar bug reports (including closed issues) and found none was relevant.

What happened?

Since 44d1798, 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
/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.<anonymous> (/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 <module>
    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

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions