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

[question] Shouldn't export-pkg provide package revision (prev) in json output? #15041

Closed
1 task
tonichedgehog opened this issue Nov 2, 2023 · 2 comments · Fixed by #15042
Closed
1 task
Assignees
Labels
Milestone

Comments

@tonichedgehog
Copy link

What is your question?

Hi, I'm using the export-pkg command to create a Conan package of pre-built binaries, with the -f json format flag to capture information on the created package for further processing. But the exported package seems to have null for package revision (prev) in the json output. Am I missing something here, or is it perhaps intentional?

There is nothing wrong with the exported package, and when uploading it to a remote, the prev seems to be computed as expected. But it would be useful to obtain prev from the json output of export-pkg.

Conan version: 2.0.13
Os: Windows
Python: 3.11.2

Steps to reproduce with zlib from conan-center:

conan source --version 1.3 .
cd src
conan install ..

Then build zlib as an ordinary CMake project (might need to drop the CMAKE_INSTALL_PREFIX from the leading set() commands in zlib's CMakeLists.txt for the build to work), and create a Conan package of the results:

cmake --preset conan-default
cmake --build --preset conan-release
conan export-pkg --name zlib --version 1.3 -f json ..

{
    "graph": {
        "nodes": {
            "0": {
                "ref": "zlib/1.3#a422e59075096a9f747cf7566fade8f3",
                "id": "0",
                "recipe": "Consumer",
                "package_id": "7bfde258ff4f62f75668d0896dbddedaa7480a0f",
                "prev": null,
                "rrev": "a422e59075096a9f747cf7566fade8f3",
                "rrev_timestamp": 1698917024.6114771,
                "prev_timestamp": null,
                "remote": null,
                "binary_remote": null,
                "build_id": null,
                "binary": null,
                "invalid_build": false,
                "info_invalid": null,
                "name": "zlib",
                "user": null,
                "channel": null,
                "url": "https://github.com/conan-io/conan-center-index",
                "license": "Zlib",
                "author": null,
                "description": "A Massively Spiffy Yet Delicately Unobtrusive Compression Library (Also Free, Not to Mention Unencumbered by Patents)",
                "homepage": "https://zlib.net",
                "build_policy": null,
                "upload_policy": null,
                "revision_mode": "hash",
                "provides": null,
                "deprecated": null,
                "win_bash": null,
                "win_bash_run": null,
                "default_options": {
                    "shared": false,
                    "fPIC": true
                },
                "options_description": null,
                "version": "1.3",
                "topics": [
                    "zlib",
                    "compression"
                ],
                "package_type": "static-library",
                "settings": {
                    "os": "Windows",
                    "arch": "x86_64",
                    "compiler": "msvc",
                    "compiler.runtime": "dynamic",
                    "compiler.runtime_type": "Release",
                    "compiler.version": "193",
                    "build_type": "Release"
                },
                "options": {
                    "shared": "False"
                },
                "options_definitions": {
                    "shared": [
                        "True",
                        "False"
                    ]
                },
                "generators": [],
                "python_requires": null,
                "system_requires": {},
                "recipe_folder": "C:\\conan-center-index\\recipes\\zlib\\all",
                "source_folder": "C:\\conan-center-index\\recipes\\zlib\\all\\src",
                "build_folder": "C:\\conan-center-index\\recipes\\zlib\\all\\build",
                "generators_folder": "C:\\conan-center-index\\recipes\\zlib\\all\\build\\generators",
                "package_folder": "C:\\v2-home\\p\\b\\zlibdb728fe9aa094\\p",
                "cpp_info": {
                    "root": {
                        "includedirs": [
                            "include"
                        ],
                        "srcdirs": null,
                        "libdirs": [
                            "lib"
                        ],
                        "resdirs": null,
                        "bindirs": [
                            "bin"
                        ],
                        "builddirs": null,
                        "frameworkdirs": null,
                        "system_libs": null,
                        "frameworks": null,
                        "libs": null,
                        "defines": null,
                        "cflags": null,
                        "cxxflags": null,
                        "sharedlinkflags": null,
                        "exelinkflags": null,
                        "objects": null,
                        "sysroot": null,
                        "requires": null,
                        "properties": null
                    }
                },
                "conf_info": {},
                "label": "conanfile.py (zlib/1.3)",
                "dependencies": {},
                "context": "host",
                "test": false
            }
        },
        "root": {
            "0": "zlib/1.3#a422e59075096a9f747cf7566fade8f3%1698917024.6114771"
        },
        "overrides": {},
        "resolved_ranges": {}
    }
}

Thanks for your fantastic work,
/J

Have you read the CONTRIBUTING guide?

  • I've read the CONTRIBUTING guide
@memsharded
Copy link
Member

Thanks for your report @tonichedgehog

You are right, the revision is missing. Submitting a fix in #15042 for next 2.0.14.

@memsharded
Copy link
Member

Thanks for your fantastic work,

Thanks for your kind words! 🙂 🙂 🙂

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants