Skip to content

jbuilder depends on opam #202

Closed
Closed

Description

@olafhering

To allow bootstrapping opam the dependency chain should be ocaml -> jbuilder -> "opam dependencies" -> opam. With current f267e3f the dependency chain (at least for make install) is ocaml -> "opam dependencies" -> opam -> jbuilder.

Maybe just another make(1) target should be added to copy the generated files to $RPM_BUILD_ROOT

Activity

  1. olafhering commented on Jul 25, 2017

    @olafhering
    ContributorAuthor

    Looks like the entire concept depends on opam? I had hoped for another oasis like tool (setup/build/install).

  2. olafhering commented on Jul 26, 2017

    @olafhering
    ContributorAuthor

    That would be nice. I had hoped for some sort of "next generation oasis". Some packages switched to jbuilder (like the ones from "mjambon"), which means the default "make;make install" in rpm spec files can not be easily used anymore. No idea if there is a way to trick opam into installing into $RPM_BUILD_ROOT

    For me it is not an issue at this point because the needed _oasis files are generated on the fly, I will continue with oasis as buildtool in rpm specfiles.

  3. samoht commented on Jul 26, 2017

    @samoht
    Member

    opam-installer has various options to select where to install things, e.g.

    $ opam-installer --help
    [...]
           --docdir=PATH
               Documentation dir. Relative to prefix or absolute. By default
               $prefix/doc.
    
           --help[=FMT] (default=pager)
               Show this help in format FMT (pager, plain or groff).
    
           -i, --install
               Install the package (the default)
    
           --libdir=PATH
               OCaml lib dir. Relative to prefix or absolute. By default
               $prefix/lib ; sometimes setting this to $(ocamlc -where) is
               preferable.
    
           --mandir=PATH
               Manpages dir. Relative to prefix or absolute. By default
               $prefix/man.
    
           --name=NAME
               Specify the package name. Used to set install directory under
               `share/', etc. By default, basename of the .install file
    
           --prefix=PREFIX (absent=/usr/local)
               The prefix to install to. You can use eg '$PREFIX' to output a
               relocatable script
    
           --script
               Don't execute the commands, but output a shell-script
               (experimental)
    
           --stubsdir=PATH
               Stubs installation dir. Relative to prefix or absolute. By default
               $libdir/stublibs.
    
           --topdir=PATH
               Toplevel install dir. Relative to prefix or absolute. By default
               $libdir/toplevel.
    
           -u, --uninstall, --remove
               Remove the package
    
           --version
               Show version information.
    
  4. bobot commented on Jul 27, 2017

    @bobot
    Contributor

    @diml, I'm not sure --prefix is enough; rpm also put librairies in ocaml subdirectory (in fact only opam put them directly in lib directory it seems). More importantly it has not the same goal RPM_BUILD_ROOT is like DESTDIR a temporary directory where package creation should copy the files with the same hierarchy than when they will be installed. The --prefix should be /usr in this case. But perhaps @glondu could tell us how jbuilder could make code easy to package in debian (specially regarding where to install ocaml libraries, is OCAMLFIND_DESTDIR specified?).

    With current f267e3f the dependency chain (at least for make install) is ocaml -> "opam dependencies" -> opam -> jbuilder.

    @olafhering A working make; make install stanza is unfortunately not a priority for some designers. lpw25/namespaces#5. But I though that with #179 from which f267e3f is extracted, we were one step nearer a working make install with good default. You are right another step is to take into account debian DESTDIR and RPM_BUILD_ROOT.

    @samoht #179 tried to fill automatically the multiple options of opam-installer. In my point of view, good default would have been simpler.

  5. olafhering commented on Jul 27, 2017

    @olafhering
    ContributorAuthor

    oasis has a --destdir option, which defines just an offset directory during make install. Similar to many Makefiles, which have "install myexe $(DESTDIR)$(BINDIR)".

    Depending on which direction jbuilder wants to go one day, this should be considered. AFAIK opam has no concept of packaging something (like rpm), so DESTDIR support is not strictly required. findlib lacks that too, but thats another story.

    Not sure what to do with this issue. If it should be a placeholder to add a standalone 'install' support one day, leave it open. Otherwise close it.

  6. olafhering commented on Jul 27, 2017

    @olafhering
    ContributorAuthor

    --prefix refers to the path at runtime, in case these are used by the binaries in some way to access files. --destdir/DESTDIR is just an offset at install time for packagers to avoid installing into /.

  7. bobot commented on Jul 27, 2017

    @bobot
    Contributor

    --destdir can't be the same than --prefix regarding --libdir since it should just be contatenated before --libdir.

    In fact usually prefix and libdir are usually given/computed during ./configure time, because tools sometimes need to know from where they would be finally used. And destdir is used only at the end. What is your idea on the usual configure time?

  8. rgrinberg commented on Jul 7, 2018

    @rgrinberg
    Member

    dune no longer uses opam-installer so this issue can be considered as resolved.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions