-
Notifications
You must be signed in to change notification settings - Fork 27
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
Pin depends #167
Pin depends #167
Conversation
cli/lock.ml
Outdated
local_opam_files [] | ||
|
||
let pull_pin_depends (pin_depends : (OpamPackage.t * OpamUrl.t) list) = | ||
(* TODO: Group pin-depends with the same url. *) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can this be taken care of or a ticket created for this?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I implemented it and removed the comment!
I just rebased and added a changelog entry. |
Thanks for the multiple rebase, I'll revive this PR. There are a couple things that I'd like to improve, in particular the interface for |
How it works: 1. The list of pinned packages is *not* excluded from the solution. 2. When creating package summaries for pins use the local opam file.
1. Pass pin packages to `calculate_opam` alongside `local_packages`. 2. The `url.src` field in opam files for pinned packages is updated. This is similar to how opam works on `opam pin ...`.
…f Lock The fact they are treated the same way by the solver is an implementation detail and fits better there than in Lock. Signed-off-by: Nathan Rebours <[email protected]>
…opam` Signed-off-by: Nathan Rebours <[email protected]>
It used to go through the pin_depends map twice Signed-off-by: Nathan Rebours <[email protected]>
Signed-off-by: Nathan Rebours <[email protected]>
Signed-off-by: Nathan Rebours <[email protected]>
Signed-off-by: Nathan Rebours <[email protected]>
Signed-off-by: Nathan Rebours <[email protected]>
Signed-off-by: Nathan Rebours <[email protected]>
I made a few improvements:
I need to test this a bit. |
Thank you for your work on this ! The mirage CI hasn't failed so that's a good sign. |
CHANGES: ### Added - When querying the solver for the local packages, if no explicit version was provided, use the value of the version field in the opam files instead of the default `zdev` if it is defined (tarides/opam-monorepo#183, @emillon) - Add a `-l`/`--lockfile` command line option to explicitly set the lockfile to use or generate in `pull` or `lock` (tarides/opam-monorepo#163, @NathanReb) - Honor `pin-depends` field in opam files. When present, these will be used by the solver (tarides/opam-monorepo#153, tarides/opam-monorepo#159, tarides/opam-monorepo#167, @rizo, @TheLortex, @NathanReb). ### Fixed - Improve `lock` performance (about 2x faster) by loading the repository state only once (tarides/opam-monorepo#188, tarides/opam-monorepo#192, @emillon) - Fix a bug where the dune-project parsing in the `pull` command would fail if it used CRLF for new lines. (tarides/opam-monorepo#191, @NathanReb) - Simply warn instead of exiting when the dune-project file can't be parsed by `pull` as it only use it to suggest updating the lang version for convenience (tarides/opam-monorepo#191, @NathanReb) - Fix a bug where `pull` and `lock` would expect the lockfile to sit in a different place and pull would fail. `pull` now simply looks for a `.opam.locked` file and pulls it unless there are multiple matching files in the repository's root. (tarides/opam-monorepo#163, @NathanReb) - Fix failure when a package is pinned to a specific commit. `lock` now skips resolution when the ref is actually a commit pointed by a remote branch or when it looks like a commit (hexadecimal characters only, at least 7 characters-long). (tarides/opam-monorepo#195, fixes tarides/opam-monorepo#127, @TheLortex)
This is a rebase of @rizo's PR: #159
Fixes #153