Conversation
kit-ty-kate
left a comment
There was a problem hiding this comment.
I'd be interested in a crash course on OpamPp at the next meeting to be able to understand the new Repos_configSyntax module better but overall otherwise that looks fine to me.
We might also want to discuss removing the soft/hard upgrade distinction.
src/format/opamFile.ml
Outdated
| (fun ~pos:_ repos -> | ||
| let repos, errs = List.split repos in | ||
| let repos = List.filter_map Fun.id repos in | ||
| let map = OpamRepositoryName.Map.of_list repos in | ||
| let errs = List.flatten errs in | ||
| map, errs) | ||
| (fun (map, _errs) -> | ||
| OpamRepositoryName.Map.bindings map | ||
| |> List.map (fun x -> Some x, [])) |
There was a problem hiding this comment.
These two functions can be done more efficiently in one fold each
| [WARNING] Errors in ${BASEDIR}/OPAM/repo/repos-config, some fields have been ignored: | ||
| - At ${BASEDIR}/OPAM/repo/repos-config:2:16-2:23:: | ||
| expected url | ||
| - In ${BASEDIR}/OPAM/repo/repos-config: |
There was a problem hiding this comment.
what is the reason we're loosing the position here?
There was a problem hiding this comment.
OpamFormat.section does not keep positions
There was a problem hiding this comment.
In the new version, there is also the same issue, it is because the error is checked after parsing errors.
732f755 to
da9c9bb
Compare
|
New implem, simpler, and that permit to introduce repository variables & repositories config option update via |
| ### # --- | ||
| ### <OPAM/repo/repos-config> | ||
| opam-version: "2.0" | ||
| ### opam repo --all |
There was a problem hiding this comment.
It seems that we can have no repo configured...
kit-ty-kate
left a comment
There was a problem hiding this comment.
lgtm modulo history cleanup and the handful of comments
7fbfc6f to
a493f44
Compare
|
Discussed in dev meeting: the windows error originates from #6417 (no CI was run on the examples of upgrade proposed during the review). There is an issue with opam system lock and windows to investigate. |
… one Recreating the lock reopened the fd on the lock file causing a block when the write lock was taken.
a493f44 to
e9cf578
Compare
|
Good to go once rebased and the documentation updated |
It is quite difficult and misleading to repository related information in the
repos-configfile (like in #4933 and #6283).The current format contain a list with a some optional elements, which complicated the parsing
The PR implements a new syntax for this file: each repository is a section with it's own defined labeled fields:
Adding then a new field is quite easy.
This change implies an hard upgrade (no best effort loading if read only) to update the opam root.
fix #6327
TODO: