Skip to content
This repository has been archived by the owner on May 21, 2024. It is now read-only.

Use jsoncpp as a submodule #1462

Merged
merged 3 commits into from
Nov 26, 2019
Merged

Use jsoncpp as a submodule #1462

merged 3 commits into from
Nov 26, 2019

Conversation

lbonn
Copy link
Contributor

@lbonn lbonn commented Nov 26, 2019

No description provided.

Copy link
Collaborator

@pattivacek pattivacek left a comment

Choose a reason for hiding this comment

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

Looks good, just some questions to understand what's going on.

# amalgamate jsoncpp source at compile time
# note: jsoncpp has a CMake support that they intent to deprecate and is hard to
# integrate with.
execute_process(COMMAND ${CMAKE_CURRENT_SOURCE_DIR}/scripts/amalgamate-jsoncpp.sh ${CMAKE_CURRENT_SOURCE_DIR}/third_party/jsoncpp ${CMAKE_CURRENT_BINARY_DIR}/jsoncpp)
Copy link
Collaborator

Choose a reason for hiding this comment

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

Why do we have to do this amalgamation?

How else do they build if they are deprecating their CMake support?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Mainly meson https://github.com/open-source-parsers/jsoncpp/wiki/Building.

I've made another attempt by using CMake the "proper" way and mostly just add_subdirectory() but it was quite hard to control the compilation flags and I think I did not manage to remove the compilation of some internal test executable.

Just using the amalgamated source, like we were doing before, gives more flexibility.

Note that the amalgamation process is done at configure time and that cmake would have to be re-run after updating the submodule.

Copy link
Collaborator

Choose a reason for hiding this comment

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

Yeah, this seems fine, it's just a bit weird.

$<TARGET_OBJECTS:jsoncpp>
$<TARGET_OBJECTS:http>
Copy link
Collaborator

Choose a reason for hiding this comment

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

Why break the alphabetical ordering?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I will remove this, that's a relic of a previous version.

@@ -46,6 +46,23 @@ TEST(Utils, PrettyNameOk) {
EXPECT_FALSE(PrettyNameOk("foo-bar-123&"));
}

TEST(Utils, parseJSON) {
// this should not cause valgrind warnings
Copy link
Collaborator

Choose a reason for hiding this comment

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

Agreed... what warnings might it throw?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

There were some uninitialized memory accesses until 1.8.2 (but not in the ancient version we were using).

See open-source-parsers/jsoncpp#651 and open-source-parsers/jsoncpp#578.

src/virtual_secondary/virtualsecondary.cc Show resolved Hide resolved
Signed-off-by: Laurent Bonnans <laurent.bonnans@here.com>
Signed-off-by: Laurent Bonnans <laurent.bonnans@here.com>
There is a valgrind issue in 1.7.x

Signed-off-by: Laurent Bonnans <laurent.bonnans@here.com>
@codecov-io
Copy link

codecov-io commented Nov 26, 2019

Codecov Report

Merging #1462 into master will increase coverage by <.01%.
The diff coverage is 89.65%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #1462      +/-   ##
==========================================
+ Coverage   80.61%   80.61%   +<.01%     
==========================================
  Files         184      184              
  Lines       11068    11079      +11     
==========================================
+ Hits         8922     8931       +9     
- Misses       2146     2148       +2
Impacted Files Coverage Δ
src/libaktualizr/uptane/tuf.h 95.86% <ø> (ø) ⬆️
src/libaktualizr/utilities/types.cc 68.75% <0%> (ø) ⬆️
src/libaktualizr/crypto/keymanager.cc 88.74% <100%> (ø) ⬆️
src/uptane_generator/director_repo.cc 92.95% <100%> (ø) ⬆️
src/libaktualizr/primary/sotauptaneclient.cc 88.93% <100%> (+0.14%) ⬆️
src/libaktualizr/uptane/metawithkeys.cc 86.11% <100%> (ø) ⬆️
src/libaktualizr/crypto/crypto.cc 86.05% <100%> (ø) ⬆️
src/sota_tools/check.cc 61.42% <100%> (ø) ⬆️
src/libaktualizr/http/httpclient.cc 92.61% <100%> (ø) ⬆️
src/libaktualizr/primary/results.h 100% <100%> (ø) ⬆️
... and 17 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 8136440...371aab7. Read the comment docs.

@lbonn lbonn merged commit a99871b into master Nov 26, 2019
@lbonn lbonn deleted the fix/jsoncpp-submodule branch November 26, 2019 16:21
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants