[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#993858: ocaml-dune: dune-install doesn't correctly place "doc" section in Debian systems



Hello Stéphane,

Stéphane Glondu <glondu@debian.org> writes:

> I guess we are talking about people doing "sudo dune install", right? As
> opposed to "dune install" being called during Debian package builds.

I am talking about both, in particular it would be nice if

   DESTDIR=debian/tmp dune install

would install OCaml package docs in `share/doc` as opposed to `doc`,
which is the Opam layout.

> Installing arbitrary software this way (with root privileges) should not
> be done IMHO, but if done, it must happen in /usr/local (or outside
> /usr). I remember having trouble configuring dune correctly to do that
> (I couldn't tell it to "dune install" into /usr/local, but still look
> for libraries in /usr/lib/ocaml in "dune build".

This should have been solved, tho not sure in which version.

> It would be nice if dune had a notion of "profile": a default "local"
> one that would use /usr/local directories, and a "debian" one, used only
> for Debian package builds, that would use $destdir/usr and $destdir/etc.
> While searching for libraries in all profiles ("local" first, then
> "debian").

That's an interesting idea; for now, using dune 2.9, you should be able
to emulate profiles using the right options to `dune install`.

I think the idea upstream is more towards let packagers configure the
right defaults at dune build time, then have all the package builds work ok.

> The "correct" path for the "doc" section in the "local" profile would be
> /usr/local/share/doc.

Indeed, so with this patch, `dune install --prefix=/usr/local` will work correctly.

>> This creates problems for both users and developers.
>
> What kind of problems?

Developers using

  DESTDIR=debian/tmp dune install

have to manually move doc to share/doc

Users have the problem with --prefix=/usr/local not installing the docs
in the right location.

> Patching things this way could (would, I think) break Debian package
> builds. One has to check that all packages using dune (and there are a
> lot of them now) still build with this patch. Maybe this could be done
> during as part of an OCaml transition... To be continued.

Indeed, it could, tho actually I couldn't find a package installing the
docs as installed by dune.

>> Note that a similar problem may exist for files in the "etc" section.
>
> I am not really sure on how to handle the "etc" section. I would use
> /etc directly, even for third-party software but /usr/local/etc exists
> on the Internet, so maybe it would be better to use it in the "local"
> profile.

I guess the etc section is fine for both uses outlined above? Maybe not
for the packaging one, as actually you'd want

 DESTDIR=debian/tmp dune install --prefix=/usr/ --etcdir=/etc

the current Dune default is the Opam layout which would install config
in /usr/etc IIANM.

Kind regards,
Emilio


Reply to: