Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@kit-ty-kate
Copy link
Member

@kit-ty-kate kit-ty-kate commented Sep 9, 2025

Extracted from #6625
Queued on #6679
To be merged at the same time as ocaml-opam/opam-rt#86

As mentioned in #6625, adding abstract types over repository roots allows us to simplify and ensure correctness when adding a new format of repository.

In its current form, this PR also changes a couple of unrelated thing that i failed to change back when extracting from #6625 (removal of some use and logic associated with OpamRepositoryConfig.repo_tarring) so it needs at least a cleanup before it is in a mergable state (on top of being queued on the already substantial #6679)

Comment on lines +2520 to +2522
let target = OpamRepositoryRoot.Dir.backup ~tmp_dir dir in
OpamRepositoryRoot.Dir.copy ~src:dir ~dst:target;
fun () -> OpamRepositoryRoot.Dir.copy ~src:target ~dst:dir)
Copy link
Collaborator

Choose a reason for hiding this comment

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

Why use Dir here instead of the abstraction OpamRepositoryRoot.t ?

Copy link
Member Author

Choose a reason for hiding this comment

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

This code is guarded under the else branch of if OpamFilename.exists tar so in this case we know that we're working with directories

Comment on lines 21 to 23
let safe_read_repo_file = function
| OpamRepositoryRoot.Dir dir ->
OpamFile.Repo.safe_read (OpamRepositoryPath.repo dir)
Copy link
Collaborator

Choose a reason for hiding this comment

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

better have this function is OpamRepositoryState (cf related comment in 6625)

Copy link
Member Author

Choose a reason for hiding this comment

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

I used the already existing OpamRepositoryRoot.delayed_read_repo function instead

@rjbou
Copy link
Collaborator

rjbou commented Oct 9, 2025

I've pushed some commits that contains some reviews proposals, left some comments. It is a very preliminary review comments, i still have some blind spot (that's why i refer to 6625 comments too).

@rjbou rjbou force-pushed the abstract-repository-root branch from 283ee7a to 17fd765 Compare October 10, 2025 17:28
@kit-ty-kate kit-ty-kate force-pushed the abstract-repository-root branch from 17fd765 to baf0725 Compare October 10, 2025 22:33
@kit-ty-kate kit-ty-kate marked this pull request as ready for review October 11, 2025 00:04
@kit-ty-kate kit-ty-kate removed PR: QUEUED Pending pull request, waiting for other work to be merged or closed PR: WIP Not for merge at this stage labels Oct 11, 2025
kit-ty-kate added a commit to kit-ty-kate/opam-rt that referenced this pull request Oct 11, 2025
@kit-ty-kate kit-ty-kate requested a review from rjbou October 11, 2025 22:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants