Closed aaronyegx closed 3 weeks ago
Hi @tejlmand , can you take a look? Maybe we need a fix like this? or:
I'm not able to reproduce this, on main (1ec5ce05f9f) Environment:
OS: Windows 10 Toolchain: Zephyr SDK 0.16.8
Tried with python 3.10/ python 3.11/ west 1.0.0/ west 1.2.0/ west 1.3.0a2
Could you try to find out which board file is causing this? Are you sure it's in-tree?
Could you try to find out which board file is causing this? Are you sure it's in-tree?
I think the issue is in the scripts/list_boards.py. I think some Windows does not use utf-8 encoding by default, could you check the changes in https://github.com/zephyrproject-rtos/zephyr/issues/79745#issuecomment-2410522982. It seems the change can address the compiling issue in my site.
I think the issue is in the scripts/list_boards.py. I think some Windows does not use utf-8 encoding by default
Sure, but it's the decoding of some board file which is causing this. I'd like to know which one
could you check the changes in #79745 (comment). It seems the change can address the compiling issue in my site.
I don't have issues to begin with, so I wouldn't know what I'm fixing.
I think the issue is in the scripts/list_boards.py. I think some Windows does not use utf-8 encoding by default
Sure, but it's the decoding of some board file which is causing this. I'd like to know which one
could you check the changes in #79745 (comment). It seems the change can address the compiling issue in my site.
I don't have issues to begin with, so I wouldn't know what I'm fixing.
I am using apollo4p_evb.
So reading up on open
in python, it can depend on the system encoding.
Linux:
Python 3.12.7 (main, Oct 1 2024, 02:05:46) [GCC 11.4.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import locale
>>> locale.getencoding()
'UTF-8'
Windows:
Python 3.11.9 (tags/v3.11.9:de54cf5, Apr 2 2024, 10:12:12) [MSC v.1938 64 bit (AMD64)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> import locale
>>> locale.getencoding()
'cp1252'
This does feel fragile, and maybe we should take a look at https://peps.python.org/pep-0540/
I am using apollo4p_evb.
Yes, but the commands fails when trying to dump/list boards, so it might be another board that is causing the issue.
What's the output of west -vvv boards
?
I am using apollo4p_evb.
Yes, but the commands fails when trying to dump/list boards, so it might be another board that is causing the issue.
What's the output of
west -vvv boards
?
PS C:\ambiqcodes\ambiqzephyr\zephyr> west -vvv boards
args namespace: Namespace(help=None, zephyr_base=None, verbose=3, command='boards', format='{name}', name_re=None, arch_roots=[], board_roots=[], soc_roots=[], board=None, board_dir=None)
Traceback (most recent call last):
File "C:\Python310\Lib\runpy.py", line 196, in _run_module_as_main
return _run_code(code, main_globals, None,
File "C:\Python310\Lib\runpy.py", line 86, in _run_code
exec(code, run_globals)
File "C:\Python310\Scripts\west.exe__main__.py", line 7, in
As I expected, the apollo4p_evb
board file itself has no issues, but other files with UTF-8 characters do:
$ rg "[^\x00-\x7F]" -g "board.yml"
boards/ezurio/mg100/board.yml
3: full_name: Sentrius™ MG100 Gateway
boards/beagle/beaglev_fire/board.yml
3: full_name: BeagleV®-Fire
boards/intel/socfpga_std/cyclonev_socdk/board.yml
3: full_name: Cyclone® V SoC Development Kit
boards/intel/socfpga/agilex5_socdk/board.yml
3: full_name: Agilex™ 5 SoC FPGA Development Kit
Opened #79832 to set the encoding.
Describe the bug
After doing the "west update" and executing the "pip3 install -r %HOMEPATH%\zephyrproject\zephyr\scripts\requirements.txt", we cannot build the samples. It always report "UnicodeDecodeError: 'gbk' codec can't decode byte 0xa2 in position 46".
To Reproduce
Expected behavior
No compiling error reports.
Impact
We cannot continue to develop until this issue getting resolved.
Logs and console output
PS C:\ambiqcodes\ambiqzephyr> west build -b apollo4p_evb .\zephyr\samples\hello_world\ -p -- west build: making build dir C:\ambiqcodes\ambiqzephyr\build pristine -- west build: generating a build system Loading Zephyr default modules (Zephyr base). -- Application: C:/ambiqcodes/ambiqzephyr/zephyr/samples/hello_world -- CMake version: 3.22.3 -- Found Python3: C:/Python310/python.exe (found suitable version "3.10.5", minimum required is "3.10") found components: Interpreter -- Cache files will be written to: C:/ambiqcodes/ambiqzephyr/zephyr/.cache -- Zephyr version: 3.7.99 (C:/ambiqcodes/ambiqzephyr/zephyr) -- Found west (found suitable version "1.0.0", minimum required is "0.14.0") CMake Error at C:/ambiqcodes/ambiqzephyr/zephyr/cmake/modules/boards.cmake:198 (message): Error finding board: apollo4p_evb
Error message: Traceback (most recent call last):
UnicodeDecodeError: 'gbk' codec can't decode byte 0xa2 in position 46: illegal multibyte sequence
Environment (please complete the following information):
Additional context