<div dir="ltr">Louis,<div><br></div><div>Thanks for your responses. Apologies for my late response. I only just got time to try this all out.</div><div><br></div><div>I tried out the workarounds but am not seeing it pick up new commits made to a git repo.</div><div><br></div><div>Example (not using dependencies):</div><div><br></div><div>1) Create package "foo" in a custom repo "my-repo". With url file set to a git repo.</div><div>2) Add repo.</div><div>3) opam install foo</div><div>4) Make new commit and push to foo's repo</div><div><following your suggested workflow><br></div><div>5) opam update -u my-repo</div><div><this returns Everything as up-to-date as possible.></div><div>6) opam install foo</div><div><package is already installed></div><div><br></div><div>I think I am missing something from your suggestions -- perhaps this is clearly not going to work because OPAM does not ever check the upstream git repo?). Was that workflow meant to only work with a pinned version?</div><div><br></div><div>Thanks.</div><div><br></div><div>Trevor</div></div><div class="gmail_extra"><br><div class="gmail_quote">On Sun, May 10, 2015 at 11:13 PM, Louis Gesbert <span dir="ltr"><<a href="mailto:louis.gesbert@ocamlpro.com" target="_blank">louis.gesbert@ocamlpro.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span class="">> 1) I think that `opam update -u <my-internal-repo>` and then `opam upgrade`<br>
> would indeed do what I need as a workaround.<br>
<br>
</span>`update -u` is "update then upgrade" so no need for the upgrade afterwards :)<br>
<span class=""><br>
> The incidental complexity the it creates isn't that big of a deal for<br>
> one-offs on my box, but when managing a team of devs, and build boxes one<br>
> wants something straightforward.<br>
> It seems though that to make that work with the build system and to not<br>
> have unintended updates one would then need 2 internal dev repos -- one<br>
> that had all of the git versioned ones, and another repo that had your<br>
> normal x.y.z versions.<br>
<br>
</span>Not sure I get what you are after exactly, but you could also put both version in the same repository! Making separate repositories would be useful if you want to easily configure hosts for the dev or release versions.<br>
<span class=""><br>
> 2) I like my suggested solution better because I think it adds no<br>
> incidental complexity -- one has to describe what needs describing (ie "I<br>
> want this dependency always updated"), and no extra lifecycle commands (ie<br>
> no explicit "update" after one has already pushed code). And adds a clear<br>
> functionality to the tool.<br>
><br>
> Agreed that updating a ton of packages could take a while -- but having a<br>
> clear tool (as in what I am suggesting) to define that gives the user that<br>
> flexibility -- it's my fault if I've decided to have 100 "alpha" packages.<br>
> I've asked for it.<br>
><br>
> So I'm clear -- are you saying that due to how updates are currently dealt<br>
> with within opam that the feature I'm suggesting probably would not happen?<br>
> (I haven't taken a look at how opam works).<br>
<br>
</span>Granted, there is already the mentionned-pinned-package-auto-update trick, but it's quite limited in scope -- I think it's good design otherwise to keep matters separate and provide atomic commands: the update of the internal metadata, and the installation of packages, are clearly distinct operations in OPAM. Higher-level operations can easily be built on top of it, and possibly added to OPAM, but we shouldn't put too much magic in the base operations: that makes things more difficult to handle, to understand and to debug.<br>
<br>
There is also a technical issue with what you propose: solving an installation is based on the current -- static -- metadata. So that metadata can't depend on updating other metadata, or resolving an installation would become a nightmare. That doesn't apply, though, if you only update the package source and not its metadata (like would be done with a repository package pointing to a VC repository, as opposed to a pinned package) -- it would be much easier to handle in that case, although it could become a bit inconsistent.<br>
<br>
With the fixes I mentionned earlier, a possibility would be to add a `--update-dev` option to `install` and `upgrade`, meaning something like:<br>
`opam install --update-dev foo`: get all installed development packages transitively related to `foo` (dependencies or dependent), update them first, then proceed with the installation, recompiling changed ones.<br>
<br>
For `install`, this would be more or less similar to `opam install foo $(opam list --rec --required-by foo)`, once we implement the changes to do related recompilations on install.<br>
<br>
Does that make sense ?<br>
<br>
Best,<br>
Louis<br>
<div class="HOEnZb"><div class="h5"><br>
><br>
> Thanks.<br>
><br>
> Trevor<br>
><br>
> On Sun, May 10, 2015 at 9:07 PM, Louis Gesbert <<a href="mailto:louis.gesbert@ocamlpro.com">louis.gesbert@ocamlpro.com</a>><br>
> wrote:<br>
><br>
> > OPAM normally never updates its metadata outside of `opam update`; this<br>
> > was inconvenient for pins, so a trick was added: when a pinned package is<br>
> > mentionned explicitely on an install command-line, it is first updated from<br>
> > its upstream. Updating all the time could get very slow if you have many<br>
> > packages pinned to their upstream, for example (like I do).<br>
> ><br>
> > As for reinstallations, OPAM does the minimum reinstallations to guarantee<br>
> > consistency, i.e. it recompiles only packages that depend on a changed one<br>
> > -- not the other way around. It will, however, mark packages that were<br>
> > changed after an update for reinstallation. This should work in a similar<br>
> > way for repository and pinned packages. However, that reinstallation will<br>
> > only take place on an `opam upgrade` without argument; it would probably be<br>
> > an improvement to process it as soon as it belongs to the dependency cone<br>
> > of changed packages.<br>
> ><br>
> > Now for the dirty (and not really working) workarounds:<br>
> > 1. `alias opam="opam update --dev; opam"`. (this would work with the fix<br>
> > above; and the option --dev doesn't exist at the moment, we only have an<br>
> > option --repositories. Adding it)<br>
> > 2. Instead of `opam install foo`, fun `opam install $(opam list -s --rec<br>
> > --required-by foo) foo`. This should trigger updates due to the trick<br>
> > above. The reinstallations are only done on `opam upgrade` though.<br>
> ><br>
> > So indeed, your only real option if you want to keep your stuff up-to-date<br>
> > is to run `opam update -u` beforehand (possibly with your dev-repo name, or<br>
> > --dev, depending on whether you use a custom repo or pinned packages).<br>
> ><br>
> > Now, if we were to handle planned recompilations more often than only on<br>
> > global `opam upgrade`, would that be enough to handle your use-case better ?<br>
> ><br>
> > Best,<br>
> > Louis<br>
> ><br>
> > > - Trevor Smith, 10/05/2015 19:55 -<br>
> > > Thanks Thomas.<br>
> > ><br>
> > > Would there be interest in making a feature to "always update this<br>
> > > dependency"? Suggested solution:<br>
> > ><br>
> > > A keyword in the version could trigger "always update". This would then<br>
> > > apply to both normal packages as well as pins. "Dev" already has meaning<br>
> > in<br>
> > > opam, perhaps "-alpha". This would then allow me to internally have a<br>
> > > single repo with normal versions alongside versions that are actively<br>
> > being<br>
> > > developed and changing multiple times per day. Eg:<br>
> > ><br>
> > > my-repo/my-package.1.0-alpha/url:<br>
> > > src: "ssh://somewhere/my-package.git"<br>
> > ><br>
> > > A dependent package (ie reverse dependency) "program" on: "my-package" {=<br>
> > > "1.0-alpha" } would then always check for updates and upgrade my-package<br>
> > > before doing anything with program. A build server could get the behavior<br>
> > > I'm looking for by "opam install --deps-only program" and getting<br>
> > whatever<br>
> > > is at head of my-package (or of the given branch as the case may be).<br>
> > ><br>
> > > I think this solution would be a nice composition of the ideas that opam<br>
> > > already has, and, I think, would be a strict improvement over the current<br>
> > > situation and does not introduce any incidental complexity. This thread<br>
> > > seems to indicate that others are interested in such a feature.<br>
> > ><br>
> > > Thoughts? Thanks!<br>
> > ><br>
> > > Trevor<br>
> > ><br>
> > ><br>
> > ><br>
> > > On Sun, May 10, 2015 at 5:50 PM, Thomas Gazagnaire <<br>
> > <a href="mailto:thomas@gazagnaire.org">thomas@gazagnaire.org</a>><br>
> > > wrote:<br>
> > ><br>
> > > > Consider two packages: lib and program. program depends upon lib.<br>
> > > ><br>
> > > ><br>
> > > > opam install lib<br>
> > > > # Make a new commit to lib and push it<br>
> > > > # Lib is now one commit newer<br>
> > > > # NB I am making _no_ changes to the internal opam repo<br>
> > > > opam install program<br>
> > > ><br>
> > > > lib does _not_ get recompiled.<br>
> > > ><br>
> > > > Is that the information you wanted?<br>
> > > ><br>
> > > ><br>
> > > > yes, when pin/dev packages are modified, you need to tell opam that you<br>
> > > > want to use the updated version (if available), so you need to run<br>
> > `opam<br>
> > > > update -u` before `opam install program`. Opam will check if there are<br>
> > new<br>
> > > > commits and recompile what needs to be recompiled.<br>
> > > ><br>
> > > > Thomas<br>
> > > ><br>
> > > ><br>
> > > > Also: I just tried opam update program and that also did not pick up<br>
> > the<br>
> > > > fact that lib is git pinned.<br>
> > > ><br>
> > > > Thoughts? Thanks.<br>
> > > ><br>
> > > > Trevor<br>
> > > ><br>
> > > > On Sun, May 10, 2015 at 1:17 PM, Thomas Gazagnaire <<br>
> > <a href="mailto:thomas@gazagnaire.org">thomas@gazagnaire.org</a>><br>
> > > > wrote:<br>
> > > ><br>
> > > >> I tried setting up the "option 1" -- using a repo url. This works fine<br>
> > > >> for clean installs, however it does not work for my use case for<br>
> > updates. I<br>
> > > >> didn't realize until I tried it out that this won't update upon any<br>
> > > >> dependent installation. As noted by Louis, pinning also does not<br>
> > reinstall<br>
> > > >> from a repo url when a dependent install happens -- it only updates<br>
> > the<br>
> > > >> meta-data.<br>
> > > >><br>
> > > >> What I would like is a way (ideally within opam) to say "when this<br>
> > > >> package dependend-upon it should always be checked for update and<br>
> > upgrade".<br>
> > > >><br>
> > > >> Am I correct in stating that currently there is no way to mark a<br>
> > package<br>
> > > >> as "update and upgrade this package whenever something that depends<br>
> > upon it<br>
> > > >> is installed"?<br>
> > > >><br>
> > > >><br>
> > > >> did you run `opam update -u <package>`? If a or dev or pinned package<br>
> > > >> changes it should normally trigger a recompilation of all the reverse<br>
> > > >> dependencies. how did you specify the packages in your repo?<br>
> > > >><br>
> > > >> Thomas<br>
> > > >><br>
> > > >><br>
> > > >> Thanks.<br>
> > > >><br>
> > > >> Trevor<br>
> > > >><br>
> > > >> On Fri, May 8, 2015 at 2:24 PM, Daniel Bünzli <<br>
> > > >> <a href="mailto:daniel.buenzli@erratique.ch">daniel.buenzli@erratique.ch</a>> wrote:<br>
> > > >><br>
> > > >>> Le vendredi, 8 mai 2015 à 20:09, Ashish Agarwal a écrit :<br>
> > > >>> > Louis, thanks for your suggestions. I'm trying them out, but one<br>
> > quick<br>
> > > >>> question: how can you query with tags. I tried `opam list -e<br>
> > foobar`, and I<br>
> > > >>> seem to get the same output no matter what I write for foobar.<br>
> > > >>><br>
> > > >>> This is not opam tags this is depexts tags (that correspond to<br>
> > > >>> platform). You can do for example:<br>
> > > >>><br>
> > > >>> opam search -s org:erratique<br>
> > > >>><br>
> > > >>> But it may not be entirely precise since opam-search matches not<br>
> > only in<br>
> > > >>> tags. I think opam-list should be able to filter by tags (I actually<br>
> > > >>> thought this was possible).<br>
> > > >>><br>
> > > >>> Best,<br>
> > > >>><br>
> > > >>> Daniel<br>
> > > >>><br>
> > > >>><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>
> > > >>><br>
> > > >><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>
> > > >><br>
> > > >><br>
> > > >><br>
> > > ><br>
> > > ><br>
> ><br>
</div></div></blockquote></div><br></div>