Skip to content

--unit-graph outputs PackageId instead of PackageIdSpec #15445

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

Closed
qsctr opened this issue Apr 22, 2025 · 0 comments · Fixed by #15447
Closed

--unit-graph outputs PackageId instead of PackageIdSpec #15445

qsctr opened this issue Apr 22, 2025 · 0 comments · Fixed by #15447
Labels
A-build-execution Area: anything dealing with executing the compiler C-bug Category: bug S-accepted Status: Issue or feature is accepted, and has a team member available to help mentor or review

Comments

@qsctr
Copy link

qsctr commented Apr 22, 2025

Problem

The pkg_id fields in the output of cargo build --unit-graph are still in the PackageId format, while cargo metadata and build JSON messages have switched to PackageIdSpec (#12914, #13311). As a result, package information cannot be directly cross-referenced between the unit graph and cargo metadata and/or JSON messages.

Steps

Run cargo build --unit-graph -Z unstable-options on a project with a nightly cargo

Possible Solution(s)

Change the pkg_id field to be a PackageIdSpec instead, like the id field in cargo metadata and package_id field in JSON messages.

Notes

No response

Version

cargo 1.86.0-nightly (ce948f461 2025-02-14)
release: 1.86.0-nightly
commit-hash: ce948f4616e3d4277e30c75c8bb01e094910df39
commit-date: 2025-02-14
host: aarch64-apple-darwin
libgit2: 1.9.0 (sys:0.20.0 vendored)
libcurl: 8.7.1 (sys:0.4.79+curl-8.12.0 system ssl:(SecureTransport) LibreSSL/3.3.6)
ssl: OpenSSL 3.4.0 22 Oct 2024
os: Mac OS 15.3.1 [64-bit]
@qsctr qsctr added C-bug Category: bug S-triage Status: This issue is waiting on initial triage. labels Apr 22, 2025
@epage epage added A-unstable Area: nightly unstable support A-build-execution Area: anything dealing with executing the compiler S-accepted Status: Issue or feature is accepted, and has a team member available to help mentor or review and removed A-unstable Area: nightly unstable support S-triage Status: This issue is waiting on initial triage. labels Apr 22, 2025
brvtalcake added a commit to brvtalcake/cargo that referenced this issue Apr 22, 2025
brvtalcake added a commit to brvtalcake/cargo that referenced this issue Apr 23, 2025
changes summary :
	- change the `pkg_id` field of `struct SerializedUnit<'a>` to be `PackageIdSpec` instead of `PackageId`
	- change the unit-graph testcases to match the changes

(cleaning previous commits so every commit passes CI checks, as required)
github-merge-queue bot pushed a commit that referenced this issue Apr 23, 2025
### What does this PR try to resolve?

Fixes #15445, where there were still differences between the format of
package ids of "`cargo metadata` and build JSON messages", and
`--unit-graph` package ids.

### How should we test and review this PR?

Everything compiles correctly (and outputs what's expected). I also
fixed the testcases
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-build-execution Area: anything dealing with executing the compiler C-bug Category: bug S-accepted Status: Issue or feature is accepted, and has a team member available to help mentor or review
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants