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

Duplicate cargo future incompatibilities reports #11594

Closed
rwxroot opened this issue Jan 18, 2023 · 3 comments · Fixed by #11648
Closed

Duplicate cargo future incompatibilities reports #11594

rwxroot opened this issue Jan 18, 2023 · 3 comments · Fixed by #11648
Labels
A-future-incompat Area: future incompatible reporting C-enhancement Category: enhancement

Comments

@rwxroot
Copy link

rwxroot commented Jan 18, 2023

Problem

I have been getting warnings for the traitobject v0.1.0 crate and the number of future incompatibility reports has reached to 950, with the size of the .future-incompat-report.json file at 38kB.

image

Steps

No response

Possible Solution(s)

Check and return an id if it already exists.

Notes

No response

Version

cargo 1.66.1 (ad779e08b 2023-01-10)
release: 1.66.1
commit-hash: ad779e08be893e57a9e17a810223a3e966f8c0d8
commit-date: 2023-01-10
host: x86_64-unknown-linux-gnu
libgit2: 1.5.0 (sys:0.16.0 vendored)
libcurl: 7.83.1-DEV (sys:0.4.55+curl-7.83.1 vendored ssl:OpenSSL/1.1.1q)
os: Fedora 37.0.0 [64-bit]
@rwxroot rwxroot added the C-bug Category: bug label Jan 18, 2023
@ehuss
Copy link
Contributor

ehuss commented Jan 18, 2023

Can you say more about what this issue is about? What kind of concerns do you have? It is normal for cargo to increment the ID number for each build. It only keeps the last 5 entries on disk.

@rwxroot
Copy link
Author

rwxroot commented Jan 18, 2023

Can you say more about what this issue is about? What kind of concerns do you have? It is normal for cargo to increment the ID number for each build. It only keeps the last 5 entries on disk.

Thank you for your response. The issue here is the increment in ID. Shouldn't it be just 1 since the report is just for the one crate?

@ehuss
Copy link
Contributor

ehuss commented Jan 18, 2023

Yea, if the report is identical to an existing one on-disk, it sounds reasonable to reuse an existing ID and avoid writing to the file. I think the code for that would likely go around here.

@ehuss ehuss added A-future-incompat Area: future incompatible reporting C-enhancement Category: enhancement and removed C-bug Category: bug labels Jan 18, 2023
peterallin added a commit to peterallin/cargo that referenced this issue Jan 29, 2023
peterallin added a commit to peterallin/cargo that referenced this issue Jan 29, 2023
peterallin added a commit to peterallin/cargo that referenced this issue Jan 29, 2023
peterallin added a commit to peterallin/cargo that referenced this issue Jan 29, 2023
peterallin added a commit to peterallin/cargo that referenced this issue Jan 29, 2023
bors added a commit that referenced this issue Jan 30, 2023
Avoid saving the same future_incompat warning multiple times

### What does this PR try to resolve?

Each time a build, that causes future_incompat warnings, is run, a report about each
warning is created and saved to disk with a new id quicky filling up the JSON file. This PR
adds a check if the report is already on disk and avoids saving a new instance of it.

Fixes #11594.

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

Perform a build that gives one or more future_incompat warnings, and see that they
are added to the  JSON file only once when the build is repeated.
@bors bors closed this as completed in 87ce527 Jan 30, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-future-incompat Area: future incompatible reporting C-enhancement Category: enhancement
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants