-
Notifications
You must be signed in to change notification settings - Fork 7k
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
Serializing issue on Windows when gcov_tool specified to twister at the command line #83823
Labels
area: Twister
Twister
area: Windows Support
Related to building Zephyr on Windows
bug
The issue is a bug, or the PR is fixing a bug
priority: low
Low impact/importance bug
Comments
@golowanow here
PosixPath , need to make this also work with WindowsPath .
|
@solsbarry, could you please check #84334 at your environment ? |
@golowanow That fixed the issue. Thank you very much, I appreciate the quick fix. |
golowanow
added a commit
to golowanow/zephyr
that referenced
this issue
Jan 22, 2025
Refactor Reporting to use custom ReportingJSONEncoder and encode all pathlib.Path derived instances there which are possible e.g. in 'environment.options' received from command line. Fixes: zephyrproject-rtos#83823 Signed-off-by: Dmitrii Golovanov <dmitrii.golovanov@intel.com>
RuibinChang
pushed a commit
to RuibinChang/zephyr
that referenced
this issue
Feb 10, 2025
Refactor Reporting to use custom ReportingJSONEncoder and encode all pathlib.Path derived instances there which are possible e.g. in 'environment.options' received from command line. (cherry picked from commit aa70508) Original-Fixes: zephyrproject-rtos#83823 Original-Signed-off-by: Dmitrii Golovanov <dmitrii.golovanov@intel.com> GitOrigin-RevId: aa70508 Cr-Build-Id: 8724909411128659441 Cr-Build-Url: https://cr-buildbucket.appspot.com/build/8724909411128659441 Copybot-Job-Name: zephyr-main-copybot-downstream Change-Id: Idbd613209173fc8c98a695b464737e1011d16c3b Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/third_party/zephyr/+/6196381 Commit-Queue: ChromeOS Prod (Robot) <chromeos-ci-prod@chromeos-bot.iam.gserviceaccount.com> Tested-by: ChromeOS Prod (Robot) <chromeos-ci-prod@chromeos-bot.iam.gserviceaccount.com> Bot-Commit: ChromeOS Prod (Robot) <chromeos-ci-prod@chromeos-bot.iam.gserviceaccount.com>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
area: Twister
Twister
area: Windows Support
Related to building Zephyr on Windows
bug
The issue is a bug, or the PR is fixing a bug
priority: low
Low impact/importance bug
Describe the bug

I have a on target unit test that I am executing with twister and asking it to generate a code coverage report for. The build failed with this error:
Here is a copy of the report being passed to json.dump

The issue is that I am specifying a gcov_tool at the command line call to twister
twister....--coverage --gcov-tool my_windows_path...
And as you can see somehow twister is turning the gcov_tool path into a WindowsPath variable and not a string. And apparently a Windows Path type can't be in a dictionary passed to json.dump. That is the issue.
In reports.py I updated jason_report() to convert WindowsPath types in the report to strings, and that caused it to build fine. I am not suggesting that is the best answer, but something like it.

You also have to add this at the top to get it to build
from pathlib import WindowsPath
Here is the text of that code if you want to try it.
To Reproduce
Steps to reproduce the behavior:
twister....--coverage --gcov-tool my_windows_path...
Expected behavior
The unit test should build without error
Impact
Can't include coverage in my on target unit tests when running on windows.
Environment (please complete the following information):
The text was updated successfully, but these errors were encountered: