Skip to content

beta: cargo metadata uses inconsistent encodings of ids with branch = master dependencies #8756

@Nemo157

Description

@Nemo157

Problem
When encoding ids of git dependencies using branch = "master" the encoding used in the packages list and the resolve list can be inconsistent on 1.47-beta. This is a regression in this output from 1.46 causing issues in cargo-* plugins that try to use the resolve graph from cargo metadata.

Steps

> git clone https://github.com/Monadic-Cat/mbot
Cloning into 'mbot'...
[...]
> cd mbot && git checkout 0921041f531eaee1a6151253a75cf2ad32626cc0
HEAD is now at 0921041 support embedding whole current dependency list in binaries

> cargo +stable metadata --format-version 1 | jq -r '(.packages[] | select(.name == "mice") | .id), (.resolve.nodes[].deps[] | select(.name == "mice") | .pkg)'
mice 0.9.0 (git+https://github.com/Monadic-Cat/mice#264dd2d713e232709588bac3ad3ffef0aeb7eb2c)
mice 0.9.0 (git+https://github.com/Monadic-Cat/mice#264dd2d713e232709588bac3ad3ffef0aeb7eb2c)

> cargo +stable --version -v
cargo 1.46.0 (149022b1d 2020-07-17)
release: 1.46.0
commit-hash: 149022b1d8f382e69c1616f6a46b69ebf59e2dea
commit-date: 2020-07-17


> cargo +beta metadata --format-version 1 | jq -r '(.packages[] | select(.name == "mice") | .id), (.resolve.nodes[].deps[] | select(.name == "mice") | .pkg)'
mice 0.9.0 (git+https://github.com/Monadic-Cat/mice?branch=master#264dd2d713e232709588bac3ad3ffef0aeb7eb2c)
mice 0.9.0 (git+https://github.com/Monadic-Cat/mice#264dd2d713e232709588bac3ad3ffef0aeb7eb2c)

> cargo +beta --version -v
cargo 1.47.0-beta (f3c7e066a 2020-08-28)
release: 1.47.0
commit-hash: f3c7e066ad66e05439cf8eab165a2de580b41aaf
commit-date: 2020-08-28

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions