Skip to content

JSON output for create and install commands with multi_config cpp_info - #4656

Merged
lasote merged 4 commits into
conan-io:developfrom
jgsogo:issue/4606-multi-json
Mar 6, 2019
Merged

lasote merged 4 commits into
conan-io:developfrom
jgsogo:issue/4606-multi-json

Conversation

@jgsogo

@jgsogo jgsogo commented Mar 5, 2019

Copy link
Copy Markdown
Contributor

Changelog: Fix: JSON output for multi_config now works in install and create commands
Docs: omit

closes #4606

This PR fixes an error when trying to build the JSON output with a multi_config cpp_info, the custom json-handler written with dates in mind wasn't working properly when a CppInfo was to be dumped into json format.

It doesn't modify the output, it just dumps the information contained in the CppInfo object. The test emphasizes the duplicated information (default directories and rootpath) and the empty directory that is present in the output (builddirs). (Note.- This output is different from the one in the json generator, in that generator non-existing paths are being discarded and the output nodes are different: *_paths).

Full JSON in the test implemented is as follows:

{
    "error": false,
    "installed": [
        {
            "recipe": {
                "id": "name/version@user/channel",
                "downloaded": false,
                "exported": true,
                "error": null,
                "remote": null,
                "time": "2019-03-05T09:50:27.598141",
                "dependency": false,
                "name": "name",
                "version": "version",
                "user": "user",
                "channel": "channel"
            },
            "packages": [
                {
                    "id": "5ab84d6acfe1f23c4fae0ab88f26e3a396351ac9",
                    "downloaded": false,
                    "exported": false,
                    "error": null,
                    "remote": null,
                    "time": "2019-03-05T09:50:28.138290",
                    "built": true,
                    "cpp_info": {
                        "includedirs": [
                            "include"
                        ],
                        "libdirs": [
                            "lib"
                        ],
                        "resdirs": [
                            "res"
                        ],
                        "bindirs": [
                            "bin"
                        ],
                        "builddirs": [
                            ""
                        ],
                        "rootpath": "/private/var/folders/yq/14hmvxm96xd7gfgl37_tnrbh0000gn/T/tmpqh89_yjyconans/path with spaces/.conan/data/name/version/user/channel/package/5ab84d6acfe1f23c4fae0ab88f26e3a396351ac9",
                        "version": "version",
                        "filter_empty": true,
                        "configs": {
                            "release": {
                                "includedirs": [
                                    "include"
                                ],
                                "libdirs": [
                                    "lib"
                                ],
                                "resdirs": [
                                    "res"
                                ],
                                "bindirs": [
                                    "bin"
                                ],
                                "builddirs": [
                                    ""
                                ],
                                "libs": [
                                    "hello"
                                ],
                                "rootpath": "/private/var/folders/yq/14hmvxm96xd7gfgl37_tnrbh0000gn/T/tmpqh89_yjyconans/path with spaces/.conan/data/name/version/user/channel/package/5ab84d6acfe1f23c4fae0ab88f26e3a396351ac9",
                                "filter_empty": true
                            },
                            "debug": {
                                "includedirs": [
                                    "include"
                                ],
                                "libdirs": [
                                    "lib-debug"
                                ],
                                "resdirs": [
                                    "res"
                                ],
                                "bindirs": [
                                    "bin"
                                ],
                                "builddirs": [
                                    ""
                                ],
                                "libs": [
                                    "hello_d"
                                ],
                                "rootpath": "/private/var/folders/yq/14hmvxm96xd7gfgl37_tnrbh0000gn/T/tmpqh89_yjyconans/path with spaces/.conan/data/name/version/user/channel/package/5ab84d6acfe1f23c4fae0ab88f26e3a396351ac9",
                                "filter_empty": true
                            }
                        }
                    }
                }
            ]
        }
    ]
}

@ghost ghost assigned jgsogo Mar 5, 2019
@ghost ghost added the stage: review label Mar 5, 2019
@jgsogo jgsogo added this to the 1.13 milestone Mar 5, 2019
@jgsogo
jgsogo marked this pull request as ready for review March 5, 2019 10:14
@jgsogo
jgsogo requested a review from lasote March 5, 2019 10:36
@lasote

lasote commented Mar 6, 2019

Copy link
Copy Markdown
Contributor

The duplicated information has to be discussed:

  • To confirm that the information is also duplicated in the CMake generator.
  • Take a decision of how it should be (consistent everywhere)

@lasote
lasote merged commit 4609d08 into conan-io:develop Mar 6, 2019
@ghost ghost removed the stage: review label Mar 6, 2019
@jgsogo
jgsogo deleted the issue/4606-multi-json branch March 6, 2019 11:41
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.

Circular reference on conan install --json if using multi configuration packages

3 participants