Skip to content
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

Switch to nlohmann/json from json11 #31093

Merged
merged 7 commits into from
Jan 23, 2024
Merged

Conversation

mtribiere
Copy link
Contributor

Description

This is a work in progress to switch to a new JSON library. From json11 to nlohmann/json.
#24523

Verification
I do not posses any hardware so my testing capabilities are quite limited. However the CI and Unit test can give a good indicator.
Some tests in the driving simulator might also be a good idea.

@@ -39,26 +39,25 @@ void recv_log(int thread_cnt, int thread_msg_cnt) {

REQUIRE(buf[0] == CLOUDLOG_DEBUG);
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This test fail, but I'm not sure why it's here in the first place. If you got a JSON as a string, then buf[0] should be '{' right ?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

see

log_s += (char)levelnum;

common/swaglog.cc Outdated Show resolved Hide resolved
@adeebshihadeh
Copy link
Contributor

Verification I do not posses any hardware so my testing capabilities are quite limited. However the CI and Unit test can give a good indicator. Some tests in the driving simulator might also be a good idea.

This change should be well-tested by our CI. The last remaining json11 usage is in selfdrive/modeld/thneed. That doesn't build by default on PC, but you can build it with scons --pc-thneed. Once you get that building properly, I can test it.

@adeebshihadeh adeebshihadeh marked this pull request as draft January 22, 2024 00:57
@mtribiere
Copy link
Contributor Author

Thanks, will do asap

@mtribiere mtribiere marked this pull request as ready for review January 22, 2024 18:41
@mtribiere
Copy link
Contributor Author

@adeebshihadeh I hope it's good, it does compile and pass the CI

@adeebshihadeh adeebshihadeh changed the title WIP: Switch a new JSON library Switch to nlohmann/json from json11 Jan 23, 2024
@adeebshihadeh adeebshihadeh merged commit ee03648 into commaai:master Jan 23, 2024
26 checks passed
@adeebshihadeh
Copy link
Contributor

Thanks! Want to try #26739? It might be even easier than this one.

adeebshihadeh added a commit that referenced this pull request Jan 23, 2024
adeebshihadeh added a commit that referenced this pull request Jan 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants