You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The OCAML_NAMESPACES use case could remove the need for ocamlfind. But I don't see how the ocamlfind install feature is replaced. In particularly the possibility for distribution (debian, redhat) to tell where the library are and where to install them. For example the findlib package of debian use this configuration file /etc/ocamlfind.conf:
I don't think an equivalent to ocamlfind install is necessary. Package systems are in charge of where things should be installed and are also in charge of running the build and install commands of packages. They should pass appropriate configure options to the packages so that they install in the desired locations. ocamlfind install just provides a side-channel for passing this information, but it isn't really needed and indeed it is ignored by a lot of the packages in the opam-repository.
People also used to install from source without opam, dpkg, or rpm. I think it should not be a possibility of the past. If after you installed ocaml from a debian package you want to install a library not packaged in debian, so from source, I think you should be able to install it without manual configuration.
The configure && make && make install stanza works for many languages and tools, and worked in the ocaml world. I don't see why we should loose that when the solution is just to have place to specify destdir.
Perhaps we don't need a replacement for ocamlfind install but we surely need one for ocamlfind printconf destdir.
The configure && make && make install stanza works for many languages and tools
Does it though? It normally tries to install in the wrong place without using -prefix. Similarly, if I install something somewhere strange I expect to have to update PATH to make it available.
We could add a default namespace of some sort (called something like ocaml, sys or default) which doesn't need to be in OCAML_NAMESPACES and is set to a site-packages directory underneath the OCAMLLIB directory. That might even avoid most people having to set the OCAML_NAMESPACES variable in the first place -- only needing it for more unusual situations.
Does it though? It normally tries to install in the wrong place without using -prefix.
OCaml install itself in the right place /usr/local by default.
That might even avoid most people having to set the OCAML_NAMESPACES variable in the first place -- only needing it for more unusual situations.
Indeed having good default configuration help that.
We could add a default namespace of some sort (called something like ocaml, sys or default)
The destination directory needs to be specific because distribution packages are installed in /usr/lib/ocaml but administrators should manually install only in /usr/local/lib/ocaml/
This could simply then simply be the parent of first element of OCAML_NAMESPACES no ?
To me it seems quite fragile, people will play with it for other purposes.
The minimum I'm proposing, is to add to ocaml -config, the default_install_libdir and to be complete default_install_prefix, so that we factorize the question of where to install things to OCaml. So by setting this two options in the ./configure of OCaml, Opam, redhat, debian would set a good default option for all the ./configure of any ocaml and libraries and tools.
The minimum I'm proposing, is to add to ocaml -config, the default_install_libdir and to be complete default_install_prefix, so that we factorize the question of where to install things to OCaml. So by setting this two options in the ./configure of OCaml, Opam, redhat, debian would set a good default option for all the ./configure of any ocaml and libraries and tools.
I don't know how they manage these things (/cc @hendriktews@glondu) but if you do this please do not forget to add environment variables that allows to control this (e.g. see OCAMLLIB and for example the output of OCAMLLIB=/bla ocamlc -config).
For opam and local switches we should rather set the trend towards a relocatable ocaml and somehow this goes against it.
Thinking a bit more about this, I'm really not sure that's doing this at the ocaml level is a good idea. A libdir and/or prefix is quite imprecise.
Most OCaml packages are moving towards using opam .install files (e.g. those using topkg or jbuilder). It seems to me that these are much more flexible for system package managers: they allow upstream to describe what the package wishes to install in which "standard" unix directory (see the list here). This description can then be freely interpreted (e.g. using opam-installer) by the system package managers to know where they want to install this.
Most OCaml packages are moving towards using opam .install files
.install files are indeed great but something needs to know where to install the files.
This description can then be freely interpreted (e.g. using opam-installer) by the system package managers to know where they want to install this.
From source the library needs to run something to install itself, it shouldn't be something different for each context. We could depend on opam but it is a very big code (a lot bigger than ocamlfind that people wants to replace), and opam-installer currently doesn't have good default. In my first comment I proposed ocaml-installer that would be like opam-installer just installed with the distribution.
For opam and local switches we should rather set the trend towards a relocatable ocaml and somehow this goes against it.
Is it not the contrary? Instead of people having to hardcode/guess paths, ocaml-installer could tell from the new location it is in or standardized environment variable where to put the files.
Is it not the contrary? Instead of people having to hardcode/guess paths, ocaml-installer could tell from the new location it is in or standardized environment variable where to put the files.
Well if you don't have the environment variable you don't. If you do then you run in circles: the same as:
.install files are indeed great but something needs to know where to install the files.
applies. Who/what defines the variable.
From source the library needs to run something to install itself, it shouldn't be something different for each context.
Why should the library do this itself ? System package managers know better where to install things, and they can do so themselves using a tool that processes the .install files. There's no need for the package to do this itself.
We could depend on opam but it is a very big code (a lot bigger than ocamlfind that people wants to replace), and opam-installer currently doesn't have good default.
In v2 opam-installer only depends on opam-format which will soon only depend externally on ocamlgraph, re and cmdliner and I guess will a little bit of effort it should be possible to write something that depends only on the dependency-less opam-file-format library (/cc @AltGr).
I think we are making the life of system packagers simpler if packages do not implement their own view of what an install should be based on a single, redefinable, value provided by the ocaml package.
I think we are making the life of system packagers simpler if [...]
By default, Debian packaging tools essentially do ./configure -prefix /usr && make && make install DESTDIR=debian/some-directory. Our life of system packagers is simpler with packages that work this way. Anything else is adding burden to the packaging task.
In particular, I don't know where the idea of using .install files (and not providing make install) helping us comes from. This is not true. Actually, it poses us problems at the moment, because of the dependency on opam for parsing them, and opam itself depending on packages that want to use this feature. Besides, the syntax of these .install files look new to me: why not a simpler or more standard format (such as JSON or XML)?
From source the library needs to run something to install itself, it shouldn't be something different for each context.
Why should the library do this itself ? System package managers know better where to install things, and they can do so themselves using a tool that processes the .install files. There's no need for the package to do this itself.
Are you always going through a package manager when installing library? I think people don't create a debian package each time they install something, that's why /usr/local is for. People doesn't always use opam pin for installing local source.
I think we are making the life of system packagers simpler if packages do not implement their own view of what an install should be based on a single, redefinable, value provided by the ocaml package.
You don't only need the destination when installing the library, tools also needs to know where they will be installed before their compilation in order to define the default location to look for their files. And moreover I'm not proposing for each package to implement their own view, I'm proposing that they all use the same tool that do the work.
By default, Debian packaging tools essentially do ./configure -prefix /usr && make && make install DESTDIR=debian/some-directory. Our life of system packagers is simpler with packages that work this way. Anything else is adding burden to the packaging task.
[...]
In particular, I don't know where the idea of using .install files (and not providing make install) helping us comes from. This is not true.
I think you should take into account the following:
We also need to make the life of people providing packages simpler. Having them to implement an install procedure in each of their package via a Makefile is not. So is for them to use Makefiles or autoconf.
I don't see how providing you with a standard way of performing the installation of OCaml packages which is what .install file give is not helping you. It gives you a precise declarative manifest of what the package wants to install. It allows you not to have to understand what kind of things a package may be doing on a make install DESTDIR and provides you full control over the way you want to perform the install.
Regarding the syntax of .install files I will not comment on this. I tried to suggest the opam devs to change this (Move OPAM's data formats to sexps ocaml/opam#2682) they choose not to. I respect their decision.
Actually, it poses us problems at the moment, because of the dependency on opam for parsing them, and opam itself depending on packages that want to use this feature.
You don't only need the destination when installing the library, tools also needs to know where they will be installed before their compilation in order to define the default location to look for their files.
Note that a large of amount of packages will not this (basically all of those who do not use etc files). When this is needed the build system should allow this to be specified before hand, and the system package manager will plug the right value, it will then be its duty to ensure it's using the same destination when it processes the .install file; that doesn't sound terribly difficult.
And moreover I'm not proposing for each package to implement their own view, I'm proposing that they all use the same tool that do the work.
I think having a tool for this is definitely over-kill. I think that packages should by default install themselves in somewhere like <prefix>/lib/ocaml/site-packages. The main question then is how these directories are expected to end up in the list of namespaces. I see roughly 3 approaches:
Packaging systems/users are expected to include them in OCAML_NAMESPACES.
Packaging systems/users are expected to pass them to OCaml's configuration
OCaml includes these directories by default
The cost of the first one is the need for the packaging system to set the value of OCAML_NAMESPACES. The benefit of it is that OCaml is not tied to its original install directory.
The second one is easier for packing systems to deal with, but ties an OCaml installation to a particular fixed directory.
The third one is even easier for packaging systems, but only if the defaults OCaml uses agree with where they think things should go. It ties all OCaml installations to a particular fixed directory (with maybe some configure-time selection to use different directories on say Windows).
I think that having OCaml include <OCAMLLIB>/site-packages by default is easy and useful. That takes care of having /usr/lib/ocaml/site-packages as a namespace, and you need to adjust the OCAMLLIB environment variable anyway if you want to relocate OCaml.
The more difficult case is including /usr/local/lib/ocaml/site-packages. Having such a directory is pretty Unix specific. Some options:
We could support a -default-namespace option on OCaml's configure to just add more namespaces to the default -- but then there isn't an easy way to override them if you want to relocate OCaml.
We could support a specific -local-prefix option on OCaml's configure along with an OCAML_LOCAL_LIB environment variable to override it. That's less general but makes relocation doable. I'm not sure what we would set this to in systems like windows which don't expect to have such a directory.
We could just expect the user to set OCAML_NAMESPACES in that case. Most people don't install packages by hand, and people should be pretty used to needing to extend environment variables to include the local version of a directory since quite a few systems adopt this approach.
As a side-note can we keep the discussion to the things directly relevant to this proposal. I think the question of whether packaging systems should directly support .install files or expect packages to provide a make install command that uses opam-installer to do the work is basically orthogonal.
By the way python takes option 3 but then Debian has to patch python to add some additional directories to the path. So I'm not sure whether that is a point for or against 3.
I think having a tool for this is definitely over-kill. I think that packages should by default install themselves in somewhere like /lib/ocaml/site-packages.
The problem is that a lot of packages do not really only install OCaml compilation objects, they also install manpages, documentation, support files, binaries, etc. which somehow your discussion completely overlooks. Once you take that into account and want to treat the installation of all the artefacts of a package in a unified manner having a tool is no longer necessarily over-kill.
For this reason I think that the idea, suggested by this issue, that the proposal has to provide something to solve this problem is misguided. In other words what I'm saying here is that this point 1. of your three approaches seem the most sensitive to me.
I think the question of whether packaging systems should directly support .install files or expect packages to provide a make install command that uses opam-installer to do the work is basically orthogonal.
Note that this was not the question. The question was about using .install files at all.
they also install manpages, documentation, support files, binaries
And by default I would expect them to be installed in the usual places for those things based on a given <prefix>. I would also expect all such things to be overrideable with ./configure options or a similar mechanism. My point is that I don't think that a site-packages directory is any different from these other cases.
having a tool is no longer necessarily over-kill
I was referring to the suggestion for a tool that told you where a particular install of OCaml wanted libraries installed. A tool that takes care of putting things in the right default places based on a prefix, as opam-installer does is clearly still useful.
Anyway at this point I'm inclined to do the following:
By default include <OCAMLLIB>/site-packages as a namespace called lib. Since this will default to <prefix>/lib/ocaml/site-packages that is the default directory which packages should install themselves, and the location that packaging systems should make packages install themselves.
Don't do anything to explicitly support /usr/local/lib/ocaml/site-packages. People building packages themselves from source without opam can always update their OCAML_NAMESPACES variable by hand. This is a less important use case than it once was and expecting users to update environment variables when using /usr/local versions of things is fairly common. Besides it will be easier to add some support for this later than to remove it if it turns out to be ill-thought out or useless.
@bobot Do you think that is sufficient to address your original issue?
@bobot Do you think that is sufficient to address your original issue?
The lib namespace address the point to where to find the libraries. My original issue specifically talk about Debian and where to install libraries directly at the right place. So I think that part is addressed by refusing the debian case. It is your proposal so I'm happy if the choice is explicitly stated. I would prefer if all the known use case could be taken into account.
People building packages themselves from source without opam can always update their OCAML_NAMESPACES variable by hand.
So the user would have to replace the first namespace with name lib: by a new one, and rename the old? If two are named identically will that not be confusing.
Besides it will be easier to add some support for this later than to remove it if it turns out to be ill-thought out or useless.
It is also hard to split concepts that are initially merged, e.g. where to find libraries and where to install them.
A tool that takes care of putting things in the right default places based on a prefix, as opam-installer does is clearly still useful.
Since actually opam-installer use /usr/local/ as default prefix, I could hope it will work also for debian once the structure of ocaml directories are unified.
So I think that part is addressed by refusing the debian case
I'm slightly confused by your calling this the debian case. Just to make sure we're on the same page: you're referring to a user installing a library by hand from source rather than a library being installed by debian itself?
So the user would have to replace the first namespace with name lib: by a new one, and rename the old?
I was more thinking that they would do add it as something like local because you still want the lib one in there for libraries installed by debian itself. (i.e. you want both /usr/lib/ocaml/site-packages and /usr/local/lib/ocaml/site-packages).
@lpw25 In fact I like the idea of your proposal, my previous message was too pessimistic, the problem is perhaps just that the ocaml packages have been put in too many places in the past $prefix/lib or $prefix/lib/ocaml. Could we just add an option -add-default-namespace to ocaml configure for the /usr/local/ case (with an environnement variable for changing default) and instead of looking at the lib namespace, always install ocaml package in $prefix/lib/ocaml/sites-packages?
Just to reduce the possibilities in order to simplify?
So I think that part is addressed by refusing the debian case
I'm slightly confused by your calling this the debian case. Just to make sure we're on the same page: you're referring to a user installing a library by hand from source rather than a library being installed by debian itself?
We also need to make the life of people providing packages simpler. Having them to implement an install procedure in each of their package via a Makefile is not. So is for them to use Makefiles or autoconf.
Come on, writing a Makefile wrapper around whatever is your preferred way of building and installing is not that difficult. And most of the time, you don't need autoconf.
I don't see how providing you with a standard way of performing the installation of OCaml packages which is what .install file give is not helping you. It gives you a precise declarative manifest of what the package wants to install. It allows you not to have to understand what kind of things a package may be doing on a make install DESTDIR and provides you full control over the way you want to perform the install.
The standard has been to do make install for ages. If you have a better way to do things, wrapping it into a make install shouldn't be too difficult.
Regarding the syntax of .install files I will not comment on this. I tried to suggest the opam devs to change this (ocaml/opam#2682) they choose not to. I respect their decision.
So the user would have to replace the first namespace with name lib: by a new one, and rename the old?
I was more thinking that they would do add it as something like local because you still want the lib one in there for libraries installed by debian itself. (i.e. you want both /usr/lib/ocaml/site-packages and /usr/local/lib/ocaml/site-packages).
I see, thank you. I prefer if we could have a --add-default-namespace ocaml configure option, but we could live with a debian patch for that (like python).
and instead of looking at the lib namespace, always install ocaml package in $prefix/lib/ocaml/sites-packages
I think this is what people should do whether or not we provide an -add-default-namespace option.
Could we just add an option -add-default-namespace to ocaml configure for the /usr/local/ case ?
Something like this was what I had in mind when I said that something could be added to improve that use case in the future. Basically I think this is possibly a good idea but I'm not 100% certain it is exactly right, so I would prefer to leave it out of the initial proposal and come back to it later.
Come on, writing a Makefile wrapper around whatever is your preferred way of building and installing is not that difficult.
Difficulty is not the question but @lpw25 requested not to talk about this further so I'll simply link to this in which you may find some of the reasons, especially the last sentence of the third paragraph. We can discuss this further on another venue if you wish so.
Activity
lpw25 commentedon Jul 23, 2017
I don't think an equivalent to
ocamlfind installis necessary. Package systems are in charge of where things should be installed and are also in charge of running the build and install commands of packages. They should pass appropriate configure options to the packages so that they install in the desired locations.ocamlfind installjust provides a side-channel for passing this information, but it isn't really needed and indeed it is ignored by a lot of the packages in the opam-repository.bobot commentedon Jul 24, 2017
People also used to install from source without opam, dpkg, or rpm. I think it should not be a possibility of the past. If after you installed ocaml from a debian package you want to install a library not packaged in debian, so from source, I think you should be able to install it without manual configuration.
The
configure && make && make installstanza works for many languages and tools, and worked in the ocaml world. I don't see why we should loose that when the solution is just to have place to specifydestdir.Perhaps we don't need a replacement for
ocamlfind installbut we surely need one forocamlfind printconf destdir.lpw25 commentedon Jul 24, 2017
Does it though? It normally tries to install in the wrong place without using
-prefix. Similarly, if I install something somewhere strange I expect to have to updatePATHto make it available.We could add a default namespace of some sort (called something like
ocaml,sysordefault) which doesn't need to be inOCAML_NAMESPACESand is set to asite-packagesdirectory underneath theOCAMLLIBdirectory. That might even avoid most people having to set theOCAML_NAMESPACESvariable in the first place -- only needing it for more unusual situations.dbuenzli commentedon Jul 24, 2017
FWIW I'm also not really convinced there's any loss here.
This could simply then simply be the parent of first element of
OCAML_NAMESPACESno ?bobot commentedon Jul 24, 2017
OCaml install itself in the right place
/usr/localby default.Indeed having good default configuration help that.
The destination directory needs to be specific because distribution packages are installed in
/usr/lib/ocamlbut administrators should manually install only in/usr/local/lib/ocaml/To me it seems quite fragile, people will play with it for other purposes.
The minimum I'm proposing, is to add to
ocaml -config, thedefault_install_libdirand to be completedefault_install_prefix, so that we factorize the question of where to install things to OCaml. So by setting this two options in the./configureof OCaml, Opam, redhat, debian would set a good default option for all the./configureof any ocaml and libraries and tools.dbuenzli commentedon Jul 24, 2017
I don't know how they manage these things (/cc @hendriktews @glondu) but if you do this please do not forget to add environment variables that allows to control this (e.g. see
OCAMLLIBand for example the output ofOCAMLLIB=/bla ocamlc -config).For opam and local switches we should rather set the trend towards a relocatable ocaml and somehow this goes against it.
dbuenzli commentedon Jul 24, 2017
Thinking a bit more about this, I'm really not sure that's doing this at the ocaml level is a good idea. A
libdirand/orprefixis quite imprecise.Most OCaml packages are moving towards using opam
.installfiles (e.g. those usingtopkgorjbuilder). It seems to me that these are much more flexible for system package managers: they allow upstream to describe what the package wishes to install in which "standard" unix directory (see the list here). This description can then be freely interpreted (e.g. usingopam-installer) by the system package managers to know where they want to install this.bobot commentedon Jul 25, 2017
.installfiles are indeed great but something needs to know where to install the files.From source the library needs to run something to install itself, it shouldn't be something different for each context. We could depend on
opambut it is a very big code (a lot bigger than ocamlfind that people wants to replace), andopam-installercurrently doesn't have good default. In my first comment I proposedocaml-installerthat would be likeopam-installerjust installed with the distribution.Is it not the contrary? Instead of people having to hardcode/guess paths,
ocaml-installercould tell from the new location it is in or standardized environment variable where to put the files.dbuenzli commentedon Jul 25, 2017
Well if you don't have the environment variable you don't. If you do then you run in circles: the same as:
applies. Who/what defines the variable.
Why should the library do this itself ? System package managers know better where to install things, and they can do so themselves using a tool that processes the .install files. There's no need for the package to do this itself.
In v2
opam-installeronly depends onopam-formatwhich will soon only depend externally onocamlgraph,reandcmdlinerand I guess will a little bit of effort it should be possible to write something that depends only on the dependency-lessopam-file-formatlibrary (/cc @AltGr).I think we are making the life of system packagers simpler if packages do not implement their own view of what an install should be based on a single, redefinable, value provided by the ocaml package.
glondu commentedon Jul 25, 2017
By default, Debian packaging tools essentially do
./configure -prefix /usr && make && make install DESTDIR=debian/some-directory. Our life of system packagers is simpler with packages that work this way. Anything else is adding burden to the packaging task.In particular, I don't know where the idea of using
.installfiles (and not providingmake install) helping us comes from. This is not true. Actually, it poses us problems at the moment, because of the dependency on opam for parsing them, and opam itself depending on packages that want to use this feature. Besides, the syntax of these.installfiles look new to me: why not a simpler or more standard format (such as JSON or XML)?All this reminds me of https://xkcd.com/927/
bobot commentedon Jul 25, 2017
Are you always going through a package manager when installing library? I think people don't create a debian package each time they install something, that's why
/usr/localis for. People doesn't always useopam pinfor installing local source.You don't only need the destination when installing the library, tools also needs to know where they will be installed before their compilation in order to define the default location to look for their files. And moreover I'm not proposing for each package to implement their own view, I'm proposing that they all use the same tool that do the work.
dbuenzli commentedon Jul 25, 2017
I think you should take into account the following:
Makefiles orautoconf..installfile give is not helping you. It gives you a precise declarative manifest of what the package wants to install. It allows you not to have to understand what kind of things a package may be doing on amake install DESTDIRand provides you full control over the way you want to perform the install..installfiles I will not comment on this. I tried to suggest theopamdevs to change this (Move OPAM's data formats to sexps ocaml/opam#2682) they choose not to. I respect their decision.This is being worked on see ocaml/opam#3009 and dbuenzli/cmdliner#86.
It does not to me. Unless you see arbitrary computation (what happens on
make install) as being a standard.dbuenzli commentedon Jul 25, 2017
Yes.
dbuenzli commentedon Jul 25, 2017
Note that a large of amount of packages will not this (basically all of those who do not use
etcfiles). When this is needed the build system should allow this to be specified before hand, and the system package manager will plug the right value, it will then be its duty to ensure it's using the same destination when it processes the.installfile; that doesn't sound terribly difficult.Well I'm proposing they all use the same file.
lpw25 commentedon Jul 25, 2017
I think having a tool for this is definitely over-kill. I think that packages should by default install themselves in somewhere like
<prefix>/lib/ocaml/site-packages. The main question then is how these directories are expected to end up in the list of namespaces. I see roughly 3 approaches:OCAML_NAMESPACES.The cost of the first one is the need for the packaging system to set the value of
OCAML_NAMESPACES. The benefit of it is that OCaml is not tied to its original install directory.The second one is easier for packing systems to deal with, but ties an OCaml installation to a particular fixed directory.
The third one is even easier for packaging systems, but only if the defaults OCaml uses agree with where they think things should go. It ties all OCaml installations to a particular fixed directory (with maybe some configure-time selection to use different directories on say Windows).
I think that having OCaml include
<OCAMLLIB>/site-packagesby default is easy and useful. That takes care of having/usr/lib/ocaml/site-packagesas a namespace, and you need to adjust theOCAMLLIBenvironment variable anyway if you want to relocate OCaml.The more difficult case is including
/usr/local/lib/ocaml/site-packages. Having such a directory is pretty Unix specific. Some options:We could support a
-default-namespaceoption on OCaml's configure to just add more namespaces to the default -- but then there isn't an easy way to override them if you want to relocate OCaml.We could support a specific
-local-prefixoption on OCaml's configure along with anOCAML_LOCAL_LIBenvironment variable to override it. That's less general but makes relocation doable. I'm not sure what we would set this to in systems like windows which don't expect to have such a directory.We could just expect the user to set
OCAML_NAMESPACESin that case. Most people don't install packages by hand, and people should be pretty used to needing to extend environment variables to include thelocalversion of a directory since quite a few systems adopt this approach.As a side-note can we keep the discussion to the things directly relevant to this proposal. I think the question of whether packaging systems should directly support .install files or expect packages to provide a
make installcommand that uses opam-installer to do the work is basically orthogonal.lpw25 commentedon Jul 25, 2017
By the way python takes option 3 but then Debian has to patch python to add some additional directories to the path. So I'm not sure whether that is a point for or against 3.
dbuenzli commentedon Jul 25, 2017
The problem is that a lot of packages do not really only install OCaml compilation objects, they also install manpages, documentation, support files, binaries, etc. which somehow your discussion completely overlooks. Once you take that into account and want to treat the installation of all the artefacts of a package in a unified manner having a tool is no longer necessarily over-kill.
For this reason I think that the idea, suggested by this issue, that the proposal has to provide something to solve this problem is misguided. In other words what I'm saying here is that this point 1. of your three approaches seem the most sensitive to me.
Note that this was not the question. The question was about using .install files at all.
lpw25 commentedon Jul 25, 2017
And by default I would expect them to be installed in the usual places for those things based on a given
<prefix>. I would also expect all such things to be overrideable with./configureoptions or a similar mechanism. My point is that I don't think that asite-packagesdirectory is any different from these other cases.I was referring to the suggestion for a tool that told you where a particular install of OCaml wanted libraries installed. A tool that takes care of putting things in the right default places based on a prefix, as
opam-installerdoes is clearly still useful.Anyway at this point I'm inclined to do the following:
<OCAMLLIB>/site-packagesas a namespace calledlib. Since this will default to<prefix>/lib/ocaml/site-packagesthat is the default directory which packages should install themselves, and the location that packaging systems should make packages install themselves./usr/local/lib/ocaml/site-packages. People building packages themselves from source without opam can always update theirOCAML_NAMESPACESvariable by hand. This is a less important use case than it once was and expecting users to update environment variables when using/usr/localversions of things is fairly common. Besides it will be easier to add some support for this later than to remove it if it turns out to be ill-thought out or useless.@bobot Do you think that is sufficient to address your original issue?
bobot commentedon Jul 25, 2017
The lib namespace address the point to where to find the libraries. My original issue specifically talk about Debian and where to install libraries directly at the right place. So I think that part is addressed by refusing the debian case. It is your proposal so I'm happy if the choice is explicitly stated. I would prefer if all the known use case could be taken into account.
So the user would have to replace the first namespace with name
lib:by a new one, and rename the old? If two are named identically will that not be confusing.It is also hard to split concepts that are initially merged, e.g. where to find libraries and where to install them.
Since actually
opam-installeruse/usr/local/as default prefix, I could hope it will work also for debian once the structure of ocaml directories are unified.lpw25 commentedon Jul 25, 2017
I'm slightly confused by your calling this the debian case. Just to make sure we're on the same page: you're referring to a user installing a library by hand from source rather than a library being installed by debian itself?
I was more thinking that they would do add it as something like
localbecause you still want thelibone in there for libraries installed by debian itself. (i.e. you want both/usr/lib/ocaml/site-packagesand/usr/local/lib/ocaml/site-packages).bobot commentedon Jul 25, 2017
@lpw25 In fact I like the idea of your proposal, my previous message was too pessimistic, the problem is perhaps just that the ocaml packages have been put in too many places in the past
$prefix/libor$prefix/lib/ocaml. Could we just add an option-add-default-namespaceto ocaml configure for the/usr/local/case (with an environnement variable for changing default) andinstead of looking at the lib namespace, always install ocaml package in$prefix/lib/ocaml/sites-packages?Just to reduce the possibilities in order to simplify?EDIT: I misread what @lpw25 was proposing.
bobot commentedon Jul 25, 2017
yes
glondu commentedon Jul 25, 2017
Come on, writing a Makefile wrapper around whatever is your preferred way of building and installing is not that difficult. And most of the time, you don't need autoconf.
The standard has been to do
make installfor ages. If you have a better way to do things, wrapping it into amake installshouldn't be too difficult.That's unfortunate and I'm on your side on this.
I do. Building a project is already an arbitrary computation. And being allowed to do arbitrary computation doesn't mean you have to.
bobot commentedon Jul 25, 2017
I see, thank you. I prefer if we could have a
--add-default-namespaceocaml configure option, but we could live with a debian patch for that (like python).lpw25 commentedon Jul 25, 2017
I think this is what people should do whether or not we provide an
-add-default-namespaceoption.Something like this was what I had in mind when I said that something could be added to improve that use case in the future. Basically I think this is possibly a good idea but I'm not 100% certain it is exactly right, so I would prefer to leave it out of the initial proposal and come back to it later.
dbuenzli commentedon Jul 25, 2017
Difficulty is not the question but @lpw25 requested not to talk about this further so I'll simply link to this in which you may find some of the reasons, especially the last sentence of the third paragraph. We can discuss this further on another venue if you wish so.
lpw25 commentedon Aug 28, 2017
I've added the default
libnamespace to the second draft of the proposal.