Re: ocaml-extlib minimal build

2020-05-26 Thread Richard W.M. Jones
On Tue, May 26, 2020 at 11:19:11PM +0800, Andy Li wrote:
> Hi Richard,
> 
> Thank you for looking into this.
> 
> On Tue, May 26, 2020 at 6:51 PM Richard W.M. Jones  wrote:
> > I looked at the packages in Fedora which BR ocaml-extlib and it looks
> > like nothing uses these modules.  Haxe seems to have a bundled copy of
> > extlib with these modules, some renamed, it's not very clear what's
> > going on.
> 
> extlib was originally written by the same author as Haxe. Historically,
> Haxe bundled extlib, and it evolved a bit while extlib was taken over by 
> someone
> else in the OCaml community.
> Later Haxe adopted using opam for dependency management and it puts its
> diverged bits of extlib into the "extlib-leftover" folder in Haxe's source 
> code.
> Haxe 4.1 can only compile with the "minimal" extlib, because the files in
> "extlib-leftover" conflict with the "full" extlib.
> 
> > So I think there are three plausible options here:
> >
> > (1) Use the minimal=1 flag, since nothing directly in Fedora should be
> > affected.  But perhaps external users will care, or I made a mistake
> > in my analysis.
> 
> For the record, Debian has just converted its extlib package from
> "full" to "minimal".
> The only affected package was "headache", but turnout the latest version of
> "headache" doesn't depend on extlib, so it was resolved by updating
> the "headache"
> package to its latest release.
> 
> openSUSE also builds its extlib package in minimal mode.

This is the strongest argument for using minimal.  We generally
attempt to stay close to what the other distros are doing because it
reduces friction for upstream developers.

> For external users, I have the impression that OCaml devs do not use system
> OCaml packages but only the OCaml compiler and opam.

I think it depends on the developer and use case.  For example if
they're hacking on the compiler itself opam is likely the best option.
You can't really use system packages for that.

Rich.

-- 
Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones
Read my programming and virtualization blog: http://rwmj.wordpress.com
virt-df lists disk usage of guests without needing to install any
software inside the virtual machine.  Supports Linux and Windows.
http://people.redhat.com/~rjones/virt-df/
___
devel mailing list -- devel@lists.fedoraproject.org
To unsubscribe send an email to devel-le...@lists.fedoraproject.org
Fedora Code of Conduct: 
https://docs.fedoraproject.org/en-US/project/code-of-conduct/
List Guidelines: https://fedoraproject.org/wiki/Mailing_list_guidelines
List Archives: 
https://lists.fedoraproject.org/archives/list/devel@lists.fedoraproject.org


ocaml-extlib minimal build

2020-05-26 Thread Richard W.M. Jones
https://bugzilla.redhat.com/show_bug.cgi?id=1837823

Hopefully I've CC'd this to everyone who has a package that
BuildRequires ocaml-extlib in Fedora.

As Andy pointed out in the bug report above, ocaml-extlib has two ways
to build it, and upstream recommends building using the "minimal"
variant.  The difference is that the minimal variant omits certain
modules which conflict with OCaml modules found in the standard
library or in other packages.

Because of the way OCaml modules work, you cannot have a program with
two modules with the exact same name even if they come from different
packages - instead you should namespace modules, but extlib never did this.

The modules that are *removed* by setting minimal=1 are:

 - Unzip
 - UChar
 - UTF8

I looked at the packages in Fedora which BR ocaml-extlib and it looks
like nothing uses these modules.  Haxe seems to have a bundled copy of
extlib with these modules, some renamed, it's not very clear what's
going on.

So I think there are three plausible options here:

(1) Use the minimal=1 flag, since nothing directly in Fedora should be
affected.  But perhaps external users will care, or I made a mistake
in my analysis.

(2) Build both extlib variants from single source.

(3) Do nothing.

Note that the professed aim of extlib upstream is to make itself
obsolete by including all the features in the standard library, so one
day in the perhaps distant future we will remove ocaml-extlib.

Let me know if you have any thoughts.

Rich.

-- 
Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones
Read my programming and virtualization blog: http://rwmj.wordpress.com
virt-p2v converts physical machines to virtual machines.  Boot with a
live CD or over the network (PXE) and turn machines into KVM guests.
http://libguestfs.org/virt-v2v
___
devel mailing list -- devel@lists.fedoraproject.org
To unsubscribe send an email to devel-le...@lists.fedoraproject.org
Fedora Code of Conduct: 
https://docs.fedoraproject.org/en-US/project/code-of-conduct/
List Guidelines: https://fedoraproject.org/wiki/Mailing_list_guidelines
List Archives: 
https://lists.fedoraproject.org/archives/list/devel@lists.fedoraproject.org