Skip to content

Add revision information to plan.json #10980

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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

fgaz
Copy link
Member

@fgaz fgaz commented Jun 8, 2025

Closes #6186


Template Α: This PR modifies behaviour or interface

Include the following checklist in your PR:

QA Notes

  • cd to any project that uses packages from hackage
  • Run cabal build --dry all to produce a plan.json
  • inspect dist-newstyle/cache/plan.json
    • it should contain a pkg-revision field under all remote-repo or secure-repo packages
    • the field should correspond to the latest hackage revision published before the used index-state

@fgaz fgaz added re: cabal-plan Concerning functionality offered by `cabal-plan` type: enhancement labels Jun 8, 2025
@fgaz fgaz force-pushed the plan.json-revisions branch 4 times, most recently from fad4496 to 7c04a29 Compare June 8, 2025 12:36
@fgaz fgaz requested a review from mpickering June 8, 2025 12:39
@fgaz fgaz marked this pull request as ready for review June 8, 2025 12:39
Copy link
Collaborator

@geekosaur geekosaur left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tests would be nice, granting that we'd have to find a stable repo that has revision fields.

@fgaz fgaz force-pushed the plan.json-revisions branch from 7c04a29 to 538a5aa Compare June 8, 2025 14:24
@fgaz
Copy link
Member Author

fgaz commented Jun 8, 2025

I'm trying to write one using withRemoteRepo

@fgaz fgaz force-pushed the plan.json-revisions branch 2 times, most recently from 6475619 to e4d9b28 Compare June 8, 2025 14:58
@fgaz
Copy link
Member Author

fgaz commented Jun 8, 2025

Okay, this should work, please have a look ^_^

@fgaz fgaz added the squash+merge me Tell Mergify Bot to squash-merge label Jun 8, 2025
Copy link
Collaborator

@mpickering mpickering left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Perhaps the revision should be adjacent to "repo" in the RepoTarballPackage but either way it seems good to get the info into the plan.json somehow.

@fgaz fgaz removed the squash+merge me Tell Mergify Bot to squash-merge label Jun 8, 2025
@fgaz
Copy link
Member Author

fgaz commented Jun 8, 2025

I put it there because I thought it didn't apply to all repo types (RepoLocalNoIndex in particular), but indeed it's a bit weird to have it inside repo.
And even though I don't really see a use case for exposing revisions from local repos, I don't see any disadvantage either, so maybe I should just do it.

@geekosaur
Copy link
Collaborator

"If it's there, someone will come up with a use for it". And consistent behavior is generally a good thing.

@fgaz
Copy link
Member Author

fgaz commented Jun 8, 2025

Now I wonder if we should just have it at top level, next to pkg-name and pkg-version.
It's just a field that can be extracted from any cabal file that contains it anyway

@mpickering
Copy link
Collaborator

Now I wonder if we should just have it at top level, next to pkg-name and pkg-version. It's just a field that can be extracted from any cabal file that contains it anyway

That doesn't seem too bad to me.

@ulysses4ever
Copy link
Collaborator

@fgaz 3.16 is rapidly approaching. Do you want to push this over the line?

@fgaz fgaz force-pushed the plan.json-revisions branch from e4d9b28 to 30159cf Compare July 9, 2025 07:22
@fgaz
Copy link
Member Author

fgaz commented Jul 9, 2025

I moved it to the top-level unit info.


3.16 is rapidly approaching. Do you want to push this over the line?

@ulysses4ever It'd be nice, however I'm planning to open another pr that adds source-repository-package revision information, and I'll need both for my purposes, so waiting for the next release is fine by me.

@fgaz fgaz force-pushed the plan.json-revisions branch from 30159cf to 7bb4dcb Compare July 9, 2025 08:20
@ulysses4ever
Copy link
Collaborator

3.16 looks out of reach by now sadly. Looking forward to see it in 3.18!

@fgaz fgaz force-pushed the plan.json-revisions branch from 7bb4dcb to a56a512 Compare July 10, 2025 09:25
@fgaz
Copy link
Member Author

fgaz commented Jul 10, 2025

Windows is failing :-/

GHCi exited with ExitFailure (-1073741510) (use -v for more information)

@geekosaur
Copy link
Collaborator

geekosaur commented Jul 11, 2025

Windows validates are getting wedged and killed-but-undead by GHA timeout for some reason. I canceled the jobs and am trying again to see if they wedge at the same place this time.


ETA: no, they're really undead. The actions panel said I canceled them successfully, the UI thinks they're still running and when I went back to the actions panel it said "Waiting for pending jobs" meaning they're still running despite their logs saying they cleaned up and terminated and the post-job saying it got their statuses. This smells like some GHA hosage.


ETA: just more UI hosage: shift-reloading got me it having restarted them as expected, and I'm tracking it running lib-tests now.

@geekosaur
Copy link
Collaborator

geekosaur commented Jul 11, 2025

Okay, it's failing as mentioned above, after tests\ok.test.hs repeatably. So, what test follows that and why is it failing this way? Can cabal-testsuite (or tasty) be convinced to show what tests it's running/planning to run?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
re: cabal-plan Concerning functionality offered by `cabal-plan` type: enhancement
Projects
None yet
Development

Successfully merging this pull request may close these issues.

plan.json should contain the Hackage revision number
5 participants