Skip to content

Conversation

sgillespie
Copy link
Collaborator

Fixes #11173

I couldn't seem to find a reliable way to test this, either with the integration tests or checking the build plan. Feel free to let me know if there's a better way.

Template B: This PR does not modify behaviour or interface

E.g. the PR only touches documentation or tests, does refactorings, etc.

Include the following checklist in your PR:

  • Patches conform to the coding conventions.
  • Is this a PR that fixes CI? If so, it will need to be backported to older cabal release branches (ask maintainers for directions).

Copy link
Collaborator

@ulysses4ever ulysses4ever left a comment

Choose a reason for hiding this comment

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

I had a more principled way to fix it in mind initially leveraging the fact that repoTarballPkgsWithMetadata only contains secure, so, named, repositories by construction. But I didn't find time to implement it, so maybe we should just go ahead with this patch.

A little help for future generations may be to leave a comment that all repos here are secure ones and will have a name so we're sorting Justs, so that should not have any surprises.

@sgillespie
Copy link
Collaborator Author

I had a more principled way to fix it in mind initially leveraging the fact that repoTarballPkgsWithMetadata only contains secure, so, named, repositories by construction. But I didn't find time to implement it, so maybe we should just go ahead with this patch.

A little help for future generations may be to leave a comment that all repos here are secure ones and will have a name so we're sorting Justs, so that should not have any surprises.

I suspected this might be the case, but I was trying to keep it consistent. I'm happy to iterate on this a bit more.

@ulysses4ever
Copy link
Collaborator

thanks @sgillespie for adding the comment! You're now welcome to add a merge label so that the bot handles it onwards. You probably want the "squash+merge" label since the second commit is logically attached to the first.

@sgillespie
Copy link
Collaborator Author

I attempted the RepoSecure by construction method by creating a new data type SecureRepo to carry around (to avoid going back and forth between Justs). However, I'm still learning the codebase and would appreciate feedback on whether this is consistent with the project conventions, or if there's a better way to approach it. Thanks for reviewing my PR!

@sgillespie sgillespie force-pushed the fix/exe-incomplete-record-selectors branch 2 times, most recently from 2beb057 to 2b0c150 Compare September 22, 2025 21:20
@ulysses4ever
Copy link
Collaborator

hey @sgillespie! Sorry for radio silence here.

I was looking at your latest patch. While sensible on its own, it adds a bit of redundancy in the Repo space. E.g., ideally, you'd expect Repo to use your new SecureRepo type. But that would be a hefty refactoring that would touch many places. I'm not eager to go there...

When reading your patch, I realized that there's already a repoName function in place that works for any Repo, so maybe it should suffice? https://github.com/sgillespie/cabal/blob/2b0c150d2246f5e8d2362aa71a912616a82556a9/cabal-install/src/Distribution/Client/Types/Repo.hs#L224

@sgillespie sgillespie force-pushed the fix/exe-incomplete-record-selectors branch from b68e241 to b0390ab Compare October 8, 2025 20:45
There's already a total `repoName` that returns `remoteRepoName`
for remote repos.

Resolves: haskell#11208
@sgillespie sgillespie force-pushed the fix/exe-incomplete-record-selectors branch from b0390ab to de8c1b5 Compare October 8, 2025 20:46
@sgillespie
Copy link
Collaborator Author

When reading your patch, I realized that there's already a repoName function in place that works for any Repo, so maybe it should suffice? https://github.com/sgillespie/cabal/blob/2b0c150d2246f5e8d2362aa71a912616a82556a9/cabal-install/src/Distribution/Client/Types/Repo.hs#L224

Thanks for the suggestion! As far as I can tell, that works for me here. I've applied that and rebased away all of my other attempts.

Copy link
Collaborator

@ulysses4ever ulysses4ever left a comment

Choose a reason for hiding this comment

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

Terrific, thanks! The merge bot will take care of it by the end of the week.

@ulysses4ever ulysses4ever added the merge me Tell Mergify Bot to merge label Oct 9, 2025
@mergify mergify bot added the ready and waiting Mergify is waiting out the cooldown period label Oct 9, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
merge me Tell Mergify Bot to merge ready and waiting Mergify is waiting out the cooldown period
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Refactor to avoid incomplete record selection warning in cabal-install
3 participants