caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
From: Sven Luther <luther@dpt-info.u-strasbg.fr>
To: Xavier Leroy <xavier.leroy@inria.fr>
Cc: Jacques Garrigue <garrigue@kurims.kyoto-u.ac.jp>, caml-list@inria.fr
Subject: Re: [Caml-list] Alternative proposal: COAN
Date: Sun, 2 Mar 2003 21:09:51 +0100	[thread overview]
Message-ID: <20030302200951.GA2024@iliana> (raw)
In-Reply-To: <20030302192126.A4892@pauillac.inria.fr>

On Sun, Mar 02, 2003 at 07:21:26PM +0100, Xavier Leroy wrote:
> > [Package management in OCaml]
> 
> I'm catching up on this interesting discussion, and find myself in
> violent agreement with Jacques: something like the BSD "ports" system,
> concentrating on (re-)compilation from sources and dependency
> management, sounds like a strong starting point.  
> 
> I tried to read the BSD "ports" manual once, and my head exploded
> midway :-)  I hope we can simplify things a bit, though.
> 
> > * For me the central repository should not contain the source themselves.
> 
> I agree it should be sufficient to give a URL to the sources in the
> metadata describing the package.  In some cases, library authors
> cannot provide a really stable URL, hence some kind of mirrorring of
> the sources might be necessary.  (And is a real nightmare to do: INRIA
> can easily provide lots of disk space and bandwith, but making sure
> that no-one uses the INRIA mirror to trade warez is the hard part :-)

Well, you only have to trust the people who will be uploading stuff. You
give each of them, either some kind of password, or you use an upload
queue or something such. You ask for the gpg/pgp key of the wouldbe
uploaders, and they send to an anonymous writable (but not readable)
directory the files they are uploading, together with some kind of
control file, containing a list of the uploaded files with their md5sum,
and maybe a small description of changes or whatever (and naturally the
package name). Then, a script is started from the cron table, looks the
upload directory for control files, if it finds one, checks it is
signed by someone you know, verify that the package he uploads is one
you have authorized, and verify the md5sum of the uploaded files. If all
this is ok, then the script just move the stuff to the download directory (in a
subdirectory corresponding to the package) and that is it. If all the
rest is ok, but the package is a new one, then you have a manual look at
it, and add it to the list of known packages. This can be done once a
week or whatever is best.

This is how the debian archives are managed, and it has worked well.
Sure, we have the added security that we don't allow anyone to enter the
keyring without having personnaly met another debian developper already
in the web of trust and that is identity has been acertained, but i
believe this is not really an issue here, and that you may also try to
meet other ocaml writing authors at conferences and other such, and thus
have a chance of adding them to your keyring.

> But, yes, let's desing the system around the idea that sources are to
> be downloaded from arbitrary URLs, like BSD ports do.
> 
> > * Dependency resolution and automatic recompilation/reinstallation is
> >   the core of the problem.
> 
> Agreed.  What do you envision for this?  Is it enough for each package
> to list the names and version number ranges for all the packages it
> needs?  Or shall we try to exploit additionally the dependency
> information (MD5 checksums of imported modules) already present in
> compiled OCaml files?  

I don't really like the idea of the range of version numbers. There is
no way you can know when a package will change in the future, and then
there is the issue of the version of ocaml it was built for (err, you
are speaking sources, so this is not as important, but still, there may
be source changes as well).

Anyway, i would much prefer that we begin to look at a formal versioning
system, for example a 3 level version system, where the first will be
for api changes, the second for backward compatible api changes (adding
stuff and the like), and the last will be for bug fixes and other non
api changing changes. This is something that is used for C so numbers,
and could work out well here. Basically it guarantees that if the api
number of a dependency did not change, then you can use it.

Sure, it needs more cooperation between the different module authors,
but i think that this will be accepted by them.

Also, this is for ocaml only, problems may happen with stublibs and
other non ocaml stuff, but in these cases, mostly libraries, i believe
depending on the right level of so number would be enough.

As for the build system, i will say here what i already told the small
group apointed by benjamin, i think it would be nice if we could just
have some kind of wrapper for the most common
configuration/build/installation options, and then have each package
provide a small ocaml module which would comply with the following
module type :

module type Ocaml_Package = sig
  val configure : ... -> string
  val build : ... -> string
  val install : ... -> string
end

where the ... would be replaced with the common option strings.

I think it can be expanded with some kind of listing of additional
option by the packages, and can then be used to build a simple little
installation program, or even dynamically loaded or something such.

This would solve all the request for simple and standard installation
processes, let yet the authors free to use whatever build system they
choose, provided they provide the appropriate wrapper, which would
server as documentation as well.

> > I personally don't think that standardizing the tools to produce
> > individual package is a useful move.
> 
> It's not necessary, but could help.  For the packaging tools to work,
> each port will have to contain a makefile or shell script that
> implements correctly a basic, shared protocol, e.g. "configure,
> compile, and install yourself", or "uninstall yourself".  Providing
> template makefiles that implement this protocol could help library
> authors do the packaging.  

See my above proposal.

> Also, as Nikolaj pointed out, precious few OCaml libraries build on
> Windows.  That's basically because most library authors don't know
> anything beyond Unix.  Again, template makefiles could help overcome
> this issue.

Well, maybe also because most libraries are bindings, which bind to
things not available on Windows, or because the windows install stuff is
much to complex. I had very little luck in making lablgtk work on
windows, it didn't find the right path and so on, very bothersom.

> Speaking of this, I've been considering generating a Makefile.inc file
> as part of the OCaml installation, containing useful information such
> as "where is the OCaml library?", "what version of OCaml is this?",
> and "is the native code compiler supported?".  By just putting
>         include `ocamlc -where`/Makefile.inc
> in your makefiles, most of the need for an autoconfiguration script
> could be avoided.
> 
> Finally, some standardization on where packages install their files
> would help the end user.  Some packages install one module in the
> OCaml stdlib dir, others install in a subdir of the stdlib, others
> install in the "contrib" subdir, etc.  OCamlfind can handle all this,
> but I believe more stringent guidelines on where libraries should go
> would help.

I thought the decision was to install into a subdir of the libdir, and
that the libdir was reserved for ocaml itself ? Did we not agree on that
a year or two ago ?

> > One last comment on Windows. Since most development is taking place on
> > Unix, I think this is reasonnable to make the presence of basic cygwin
> > tools a requirement for compiling packages. The presence of gnu make
> > and some shell commands should be enough for most. Handling of C
> > libraries is more complex, but this must often be handled also at the
> > source level.
> 
> After years of struggling with nmake, I finally decided to rely on GNU
> make and the Cygwin tools for building the windows versions of OCaml.
> So, I agree that assuming Cygwin is present for building packages is a
> reasonable thing to do.  Still, writing a makefile that works both
> under Unix and Windows isn't trivial, due to stupid things like
> different file extensions for C libraries (.a vs. .lib).  At least, I
> haven't yet succeeded in having common makefiles for Unix and Windows
> in the OCaml source tree.

I believe the wya to do is cross compile on a linux system. So nobody
would claim they are not familiar enough with windows and everyone would
have libraries installeable straight from unix sources. I have not done
this personnally, so maybe it is not all that simple, but maybe a
tutorial example of such a build system with one of the simpler
libraries (maybe camlzip) could be nice to have. If i had time, i would
investigate it. We have this under debian :

Description: Minimalist GNU win32 (cross) compiler
 A Linux hosted, win32 target, cross compiler for C/C++
 .
 Freedom through obsolescence.  Those who still really need to
 can now build windows executables from the comfort of Debian.
 .
 This package contains the C and C++ cross compilers.

I don't know if this would be enough to build at least part of ocaml,
and also don't know if it is feasible to use it to build a cross ocaml
compiler, but this would be a neat thing to do. If i had time for it i
would look into this.

Friendly,

Sven Luther

-------------------
To unsubscribe, mail caml-list-request@inria.fr Archives: http://caml.inria.fr
Bug reports: http://caml.inria.fr/bin/caml-bugs FAQ: http://caml.inria.fr/FAQ/
Beginner's list: http://groups.yahoo.com/group/ocaml_beginners


  reply	other threads:[~2003-03-02 20:09 UTC|newest]

Thread overview: 54+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-02-24 16:54 Benjamin C. Pierce
2003-02-24 18:24 ` Chris Hecker
2003-02-24 20:17 ` Francois Rouaix
2003-02-24 20:28   ` Basile STARYNKEVITCH
2003-02-24 21:03   ` Brian Hurt
2003-02-24 21:10     ` Brian Hurt
2003-02-24 21:22       ` Benjamin C. Pierce
2003-02-25 10:54     ` roberto
2003-02-25 13:20       ` Sven Luther
2003-02-25 13:36         ` roberto
2003-02-25 16:07           ` Sven Luther
2003-02-25 14:17       ` MikhailFedotov
2003-02-25 17:15       ` Eric C. Cooper
2003-02-25 21:48         ` Michal Moskal
2003-02-25 22:14           ` Lauri Alanko
2003-02-26 14:06             ` Sven Luther
2003-02-27  8:05             ` Blair Zajac
2003-02-27  8:29             ` Xavier Leroy
2003-02-23 16:51               ` Chet Murthy
2003-02-27 15:39               ` [Caml-list] hierarchical modules John Carr
2003-03-01 18:09                 ` [Caml-list] " Xavier Leroy
2003-03-01 18:18                   ` Michal Moskal
2003-03-02 15:58                     ` Xavier Leroy
2003-02-25 22:59           ` [Caml-list] Alternative proposal: COAN Sven Luther
2003-02-26  9:47             ` Michal Moskal
2003-02-26 10:11               ` Sven Luther
2003-02-26 10:26                 ` Michal Moskal
2003-02-26 11:53                   ` Sven Luther
2003-02-26 10:35                 ` Olivier Andrieu
2003-02-26 12:03                   ` Sven Luther
2003-02-27  3:19                   ` Nicolas Cannasse
2003-02-23 15:05                     ` Chet Murthy
2003-02-27  4:54                       ` Nicolas Cannasse
2003-02-23 16:13                         ` Chet Murthy
2003-02-27  9:20                           ` Sven Luther
2003-02-27 10:39                         ` Damien Doligez
2003-02-28  9:20       ` Jacques Garrigue
2003-02-28 10:53         ` Sven Luther
2003-02-28 12:28         ` Jean-Christophe Filliatre
2003-02-28 13:08           ` Markus Mottl
2003-02-28 13:27             ` Sven Luther
2003-02-28 14:05               ` Jean-Christophe Filliatre
2003-02-28 14:43                 ` Sven Luther
2003-02-28 15:58                   ` Benjamin C. Pierce
2003-03-01 18:03                 ` Michal Moskal
2003-03-01  8:14         ` Blair Zajac
2003-03-02 18:21         ` Xavier Leroy
2003-03-02 20:09           ` Sven Luther [this message]
2003-03-02 21:38           ` Doug Bagley
2003-03-03  2:39         ` Nicolas Cannasse
2003-03-03  9:07           ` Sven Luther
2003-03-03  9:24             ` Nicolas Cannasse
2003-03-03  9:37               ` Sven Luther
2003-02-26 18:42 Jeff Bowden

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20030302200951.GA2024@iliana \
    --to=luther@dpt-info.u-strasbg.fr \
    --cc=caml-list@inria.fr \
    --cc=garrigue@kurims.kyoto-u.ac.jp \
    --cc=xavier.leroy@inria.fr \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).