<div dir="ltr">Hi, <div><br></div><div>We faced this issue at work too. The typical issue is "I want to depend on this particular branch of a third party repository". Pinning packages locally would work, but we want something that we can push on CI and build servers, and share in the team (and keep in the git history of the project). </div><div><br></div><div>The solution we came up with is as follows: in our dev repository `project`, we keep a particular opam repository `project/opam-repository`. This repository contains shadow opam packages. For instance, if I want to depend on branch bar of a public project foo, we just add a new version of the opam package for foo in `project/opam-repository/packages`, with an explicit version number, and with an url like `path-to-project-foo#bar`. Then, we keep a opam file in `project` that specifies the explicit dependencies (given version of public package) and the dev dependencies (home brewed version of public packages). The dev dependencies can only be met using the shadow opam files. </div><div><br></div><div>Then, our CI/build scripts use something like </div><div>```</div><div>opam remote remove shadow-opam-repository </div><div>opam remote add shadow-opam-repository ./opam-repository</div><div>opam update</div><div>opam pin add --no-action project ./ -y </div><div>opam install --deps-only project -y</div><div>```</div><div><br></div><div>Changing version of packages for all devs and our servers is done by commiting changes either to the opam-repository or to the opam file in the project.</div><div><br></div><div>Hope that helps. </div><div>Thomas</div><div><br></div><div><br></div><div><br></div><div><br></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Tue, May 5, 2015 at 9:19 PM, Malcolm Matalka <span dir="ltr"><<a href="mailto:mmatalka@gmail.com" target="_blank">mmatalka@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Each project I have has its own opam repo which I put as higher priority<br>
to the basic one. Does this do what you want?<br>
<div class="HOEnZb"><div class="h5"><br>
Trevor Smith <<a href="mailto:trevorsummerssmith@gmail.com">trevorsummerssmith@gmail.com</a>> writes:<br>
<br>
> Hi all,<br>
><br>
> We're using opam internally at work. I have two use cases for our internal<br>
> libraries:<br>
><br>
> 1) "dev dependencies" -- I want what is in the repo.<br>
> 2) "explicit dependency" -- I want a given version.<br>
><br>
> opam has #2 covered.<br>
><br>
> However it is not clear to me how to do #1 correctly. I can, on a given<br>
> machine (ie not on an opam repository), pin a given package to a git repo.<br>
> But locally pinning isn't what I want. I want a package in an opam<br>
> repository to say "I depend upon this other dev package" so that our build<br>
> boxes, and various developer machines will all do the same thing, and I<br>
> don't need to separately pin everything on each box.<br>
><br>
> Has anyone else encountered this situation before?<br>
><br>
> Thoughts? Thanks.<br>
><br>
> Trevor<br>
</div></div><div class="HOEnZb"><div class="h5">> _______________________________________________<br>
> Platform mailing list<br>
> <a href="mailto:Platform@lists.ocaml.org">Platform@lists.ocaml.org</a><br>
> <a href="http://lists.ocaml.org/listinfo/platform" target="_blank">http://lists.ocaml.org/listinfo/platform</a><br>
_______________________________________________<br>
Platform mailing list<br>
<a href="mailto:Platform@lists.ocaml.org">Platform@lists.ocaml.org</a><br>
<a href="http://lists.ocaml.org/listinfo/platform" target="_blank">http://lists.ocaml.org/listinfo/platform</a><br>
</div></div></blockquote></div><br></div>