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

Binary dependencies are not listed in metadata.packages or metadata.resolve #10607

Closed
Alexendoo opened this issue Apr 27, 2022 · 0 comments · Fixed by #11550
Closed

Binary dependencies are not listed in metadata.packages or metadata.resolve #10607

Alexendoo opened this issue Apr 27, 2022 · 0 comments · Fixed by #11550
Labels
C-bug Category: bug Z-bindeps Nightly: binary artifact dependencies

Comments

@Alexendoo
Copy link
Member

Problem

An artifact = "bin" dependency that doesn't specifiy lib = true will not appear in the packages or resolve properties of cargo metadata

It is listed in the dependencies of the dependant package

Steps

cargo new binary
cargo new --lib library

echo 'binary = { path = "../binary", artifact = "bin" }' >> library/Cargo.toml

cargo +nightly metadata -Zbindeps --manifest-path=library/Cargo.toml

Gives

{
    "packages": [
        {
            "name": "library",
            "version": "0.1.0",
            "id": "library 0.1.0 (path+file:///.../library)",
            "license": null,
            "license_file": null,
            "description": null,
            "source": null,
            "dependencies": [
                {
                    "name": "binary",
                    "source": null,
                    "req": "*",
                    "kind": null,
                    "rename": null,
                    "optional": false,
                    "uses_default_features": true,
                    "features": [],
                    "artifact": {
                        "kinds": [
                            "bin"
                        ],
                        "lib": false,
                        "target": null
                    },
                    "target": null,
                    "registry": null,
                    "path": "...\\binary"
                }
            ],
            "targets": [
                {
                    "kind": [
                        "lib"
                    ],
                    "crate_types": [
                        "lib"
                    ],
                    "name": "library",
                    "src_path": "...\\library\\src\\lib.rs",
                    "edition": "2021",
                    "doc": true,
                    "doctest": true,
                    "test": true
                }
            ],
            "features": {},
            "manifest_path": "...\\library\\Cargo.toml",
            "metadata": null,
            "publish": null,
            "authors": [],
            "categories": [],
            "keywords": [],
            "readme": null,
            "repository": null,
            "homepage": null,
            "documentation": null,
            "edition": "2021",
            "links": null,
            "default_run": null,
            "rust_version": null
        }
    ],
    "workspace_members": [
        "library 0.1.0 (path+file:///.../library)"
    ],
    "resolve": {
        "nodes": [
            {
                "id": "library 0.1.0 (path+file:///.../library)",
                "dependencies": [],
                "deps": [],
                "features": []
            }
        ],
        "root": "library 0.1.0 (path+file:///.../library)"
    },
    "target_directory": "...\\library\\target",
    "version": 1,
    "workspace_root": "...\\library",
    "metadata": null
}

Possible Solution(s)

No response

Notes

No response

Version

cargo 1.62.0-nightly (edffc4ada 2022-04-19)
release: 1.62.0-nightly
commit-hash: edffc4ada3d77799e5a04eeafd9b2f843d29fc23
commit-date: 2022-04-19
host: x86_64-pc-windows-msvc
libgit2: 1.4.2 (sys:0.14.2 vendored)
libcurl: 7.80.0-DEV (sys:0.4.51+curl-7.80.0 vendored ssl:Schannel)
os: Windows 10.0.19044 (Windows 10 Pro) [64-bit]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-bug Category: bug Z-bindeps Nightly: binary artifact dependencies
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants