Bug 194529 - [patch] devel/ocaml-opam run depends on rsync
Summary: [patch] devel/ocaml-opam run depends on rsync
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Some People
Assignee: John Marino
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-10-22 11:16 UTC by Michael Grünewald
Modified: 2015-03-15 13:06 UTC (History)
2 users (show)

See Also:


Attachments
Patch to run depend on rsync (452 bytes, patch)
2014-10-22 11:16 UTC, Michael Grünewald
no flags Details | Diff
upgrade to 1.2.0 and add optionnal dependencies (2.29 KB, patch)
2014-11-01 17:27 UTC, joris
joris: maintainer-approval+
Details | Diff
upgrade to 1.2.0 and add optionnal dependencies (4.08 KB, patch)
2014-11-01 18:00 UTC, joris
no flags Details | Diff
upgrade to 1.2.0 and add optionnal dependencies (3.34 KB, patch)
2014-11-02 14:13 UTC, joris
no flags Details | Diff
upgrade to 1.2.0 and add optionnal dependencies (3.77 KB, patch)
2014-11-02 14:18 UTC, joris
no flags Details | Diff
upgrade to 1.2.0 and add optionnal dependencies (5.84 KB, patch)
2015-03-13 10:04 UTC, joris
joris: maintainer-approval+
Details | Diff
upgrade to 1.2.0 and add optionnal dependencies (5.84 KB, patch)
2015-03-13 10:06 UTC, joris
joris: maintainer-approval+
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Michael Grünewald 2014-10-22 11:16:28 UTC
Created attachment 148560 [details]
Patch to run depend on rsync

Opam uses rsync to make a private copy of a local package repository. If rsync is not installed, adding a local package repository to an Opam installation will fail:

----8<----
[160] (llea) opam/master > opam remote add local `pwd`
local      Synchronizing with /usr/home/michael/System/opam
Updating /data/opam/repo/compiler-index ...
Updating /data/opam/compilers/ ...
Updating /data/opam/repo/package-index ...
Updating /data/opam/packages/ ...
[WARNING] dev-repo is an unknown field in /data/opam/repo/default/packages/eliom/eliom.4.1.0/opam: is your OPAM up-to-date ?
[WARNING] dev-repo is an unknown field in /data/opam/repo/default/packages/ocsigenserver/ocsigenserver.2.5/opam: is your OPAM up-to-date ?
Updating the cache of metadata (/data/opam/state.cache) ...
'opam remote add local /usr/home/michael/System/opam' failed.
Fatal error:
"rsync": command not found.
Exit 1
---->8----

We therefore need to RUN_DEPEND on rsync.
Comment 1 Michael Grünewald 2014-10-28 14:56:39 UTC
This is of course devel/ocaml-opam and not devel/opam-ocaml.
Comment 2 John Marino freebsd_committer freebsd_triage 2014-11-01 09:24:17 UTC
We need maintainer approval, notifying (auto-assigner failed because port origin was wrong)
Comment 3 joris 2014-11-01 16:06:58 UTC
I remember discussing this in a private mail thread, don't remember if it was with you. Like I said, i don't think adding a hard dependency to rsync is a good idea, since you can use opam without it, like you can use opam with only rsync and no git. Maybe adding a note ? Or is there a way to specify optionnal dependencies ?
Comment 4 John Marino freebsd_committer freebsd_triage 2014-11-01 16:10:11 UTC
using the options framework is a good idea.

you have to decide if the RSYNC option is on by default or not (I would probably saw it should be for the purposes of having more useful binary packages)

You can perhaps split all the protocols into options.
Comment 5 joris 2014-11-01 17:27:38 UTC
Created attachment 148892 [details]
upgrade to 1.2.0 and add optionnal dependencies

Ok, here is a patch to add rsync, git, and wget as optionnal dependencies, and i took the opportunity to upgrade the port to the latest 1.2.0 version. I can open a new PR if you prefer.
Comment 6 joris 2014-11-01 17:42:31 UTC
Oops sorry i was too eager, i'll post an update when i can. The patch is not good.
Comment 7 joris 2014-11-01 18:00:05 UTC
Created attachment 148896 [details]
upgrade to 1.2.0 and add optionnal dependencies
Comment 8 John Marino freebsd_committer freebsd_triage 2014-11-01 22:37:07 UTC
At first glance, I'm fine with everything except the MANPAGES option.  Since MANPAGES doesn't pull in any dependencies, they should be installed unconditionally without possibility of disabling them (note man pages are considered separately from "documentation").

Basically, unless you need doxygen or sphinx or something that that to generate the manpages, they are always installed.

So maybe you can update the patch accordingly.  I'll commit it then.
Comment 9 joris 2014-11-02 14:13:50 UTC
Created attachment 148929 [details]
upgrade to 1.2.0 and add optionnal dependencies

Ok, i've removed the MANPAGES option.
Comment 10 joris 2014-11-02 14:18:49 UTC
Created attachment 148930 [details]
upgrade to 1.2.0 and add optionnal dependencies

Sorry, i just realized pkg-descr was still pointing to the ocamlpro website while opam.ocaml.org is probably a better place now. I thought it had been fixed a while ago.
Comment 11 John Marino freebsd_committer freebsd_triage 2014-11-02 15:37:51 UTC
I had to reorder some lines to make portlint happy.  That was easy, but this doesn't build in poudriere because ocaml-opam tries to download something during the build phase which is completely illegal.  fetching has to happen during fetch phase only.


======================<phase: build          >============================
===>  Building for ocaml-opam-1.2.0
gmake[1]: Entering directory '/wrkdirs/usr/ports/devel/ocaml-opam/work/ocaml-opam-cbe460b'
gmake -C src_ext lib-ext
gmake[2]: Entering directory '/wrkdirs/usr/ports/devel/ocaml-opam/work/ocaml-opam-cbe460b/src_ext'
[ -e  extlib-1.5.3.tar.gz ] || curl  -OL http://ocaml-extlib.googlecode.com/files/extlib-1.5.3.tar.gz
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed

  0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0curl: (6) Could not resolve host: ocaml-extlib.googlecode.com
Makefile:51: recipe for target 'extlib.download' failed
gmake[2]: *** [extlib.download] Error 6
gmake[2]: Leaving directory '/wrkdirs/usr/ports/devel/ocaml-opam/work/ocaml-opam-cbe460b/src_ext'
Makefile:29: recipe for target 'lib-ext' failed
gmake[1]: *** [lib-ext] Error 2
gmake[1]: Leaving directory '/wrkdirs/usr/ports/devel/ocaml-opam/work/ocaml-opam-cbe460b'
*** Error code 1



So what is the fix?
Comment 12 John Marino freebsd_committer freebsd_triage 2014-11-02 15:39:22 UTC
should  not extlib-1.5.3.tar.gz be in the distinfo file and fetched at the same time?  perhaps with EXTRACT_ONLY set to the main distfile?
Comment 13 joris 2014-11-02 15:40:01 UTC
I see. That is tricky, because i guess it means i have to create a bunch of ocaml ports to package all the ocaml dependencies opam needs. I'll need more time for this.
Comment 14 John Marino freebsd_committer freebsd_triage 2014-11-02 15:43:43 UTC
how many are we talking about, and can the pre-fetching idea work?

E.g. just fetch everything needed in the fetch phase and put in a place that ocaml-opam build will look for it and not attempt to fetch it.
Comment 15 joris 2014-11-02 15:46:35 UTC
It'll probably work, but while here, better create real ports for these libs i guess.
Comment 16 John Marino freebsd_committer freebsd_triage 2014-11-02 15:54:42 UTC
if this proposed ports are useful outside of opam, sure.
If they are *only* used for opam, then I'd prefer my approach.
Comment 17 John Marino freebsd_committer freebsd_triage 2014-11-14 08:40:10 UTC
Hi Joris, can we get a status update on this PR?
Comment 18 joris 2015-03-13 10:04:15 UTC
Created attachment 154263 [details]
upgrade to 1.2.0 and add optionnal dependencies

Hi, after a long time, here is a new patch
Comment 19 joris 2015-03-13 10:06:21 UTC
Created attachment 154264 [details]
upgrade to 1.2.0 and add optionnal dependencies

The patch in the right direction is better :>
Comment 20 Michael Grünewald 2015-03-14 14:40:39 UTC
Comment on attachment 154264 [details]
upgrade to 1.2.0 and add optionnal dependencies

Joris, it is great that you prepared an upgrade for opam!

Could you please produce a clean patch, rather than a git specific patch?
I think, you just need to remember to use the --no-headers options, when
using git diff:

http://stackoverflow.com/questions/4610744/can-i-get-a-patch-compatible-output-from-git-diff
Comment 21 Michael Grünewald 2015-03-14 14:40:39 UTC
Comment on attachment 154264 [details]
upgrade to 1.2.0 and add optionnal dependencies

Joris, it is great that you prepared an upgrade for opam!

Could you please produce a clean patch, rather than a git specific patch?
I think, you just need to remember to use the --no-headers options, when
using git diff:

http://stackoverflow.com/questions/4610744/can-i-get-a-patch-compatible-output-from-git-diff
Comment 22 Michael Grünewald 2015-03-14 14:40:40 UTC
Comment on attachment 154264 [details]
upgrade to 1.2.0 and add optionnal dependencies

Joris, it is great that you prepared an upgrade for opam!

Could you please produce a clean patch, rather than a git specific patch?
I think, you just need to remember to use the --no-headers options, when
using git diff:

http://stackoverflow.com/questions/4610744/can-i-get-a-patch-compatible-output-from-git-diff
Comment 23 John Marino freebsd_committer freebsd_triage 2015-03-14 14:57:24 UTC
the patch format doesn't bother me, extra paths can be stripped.
Comment 24 Michael Grünewald 2015-03-14 15:04:25 UTC
Applying with -p1 did not work well for me, because some paths are of the form
{a,b}/… and some others are /dev/null.  How did you manage to apply the patch.

(Let's hope I do not hit three times the Save Changes button this time.)
Comment 25 commit-hook freebsd_committer freebsd_triage 2015-03-15 13:05:55 UTC
A commit references this bug:

Author: marino
Date: Sun Mar 15 13:05:43 UTC 2015
New revision: 381326
URL: https://svnweb.freebsd.org/changeset/ports/381326

Log:
  devel/ocaml-opam: Upgrade version 1.1.1 => 1.2.0

  Add several options for protocols such as rsync, git, wget, Hg, etc,
  where the first three options are on by default.

  PR:		194529
  Suggested by:	Michael Gruenewald
  Final patch:	maintainer (Joris Giovannangeli)

Changes:
  head/devel/ocaml-opam/Makefile
  head/devel/ocaml-opam/distinfo
  head/devel/ocaml-opam/files/
  head/devel/ocaml-opam/pkg-descr
  head/devel/ocaml-opam/pkg-plist
Comment 26 John Marino freebsd_committer freebsd_triage 2015-03-15 13:06:52 UTC
Thanks, all.