Mantis Bug Tracker

View Issue Details Jump to Notes ] Issue History ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0000755OCamlOCaml generalpublic2001-12-26 19:262002-11-07 11:43
Reporteradministrator 
Assigned To 
PrioritynormalSeverityfeatureReproducibilityalways
StatusclosedResolutionwon't fix 
PlatformOSOS Version
Product Version 
Target VersionFixed in Version 
Summary0000755: [wishlist] ld.conf location and configuration script.
DescriptionHello, ...

The debian policy mandates the location for files such as ld.conf in the /etc
directory structure. As such, it would be very nice (for me and others too i
guess) to be able to choose the location of this file at configuration time.

Also, since the current version of ocaml don't searches $OCAMLDIR and it's
subdirectories by default (contrary to what Xavier wrote to me in a mail, but
i may simply have misunderstood something), it is needed to fill this ld.conf
file accordyingly for each installed library.

It would be nice to have some script or little program that helps adding or
removing entries in this ld.conf file and i will be providing such a one in my
debian packages next week, but to enable such a program or script to handle
multiple libraries using the same directory, it would be really nice to be
able to add a field at the end of the files in the ld.conf file, using it as a
occurence counter or something such. Maybe this is already possible but i have
not looked at it yet, will do the first week of january though.

What do you think about this occurence counter stuff ? Is it a good idea, or
a totally wrong approach ?

Friendly,

Sven Luther

TagsNo tags attached.
Attached Files

- Relationships

-  Notes
(0003295)
administrator (administrator)
2002-01-04 10:12

> The debian policy mandates the location for files such as ld.conf in the /etc
> directory structure. As such, it would be very nice (for me and others too i
> guess) to be able to choose the location of this file at configuration time.

Would it really be a good idea? Knowing that ocaml libraries are not binary
compatible between version, keeping everything in the same place seems safer...


> It would be nice to have some script or little program that helps adding or
> removing entries in this ld.conf file and i will be providing such a one in
my
> debian packages next week, but to enable such a program or script to handle
> multiple libraries using the same directory, it would be really nice to be
> able to add a field at the end of the files in the ld.conf file, using it as
a
> occurence counter or something such. Maybe this is already possible but i
have
> not looked at it yet, will do the first week of january though.

No, currently you are only allowed a carriage return.
By the way, the following two lines (from labltk) do the job. This works on all
the unixes I know.

  if test `grep -s -c '^$(LABLTKDIR)$$' $(LIBDIR)/ld.conf` = 0; \
  then echo $(LABLTKDIR) >> $(LIBDIR)/ld.conf; fi
(0003296)
administrator (administrator)
2002-01-07 13:19

On Fri, Jan 04, 2002 at 10:12:26AM +0100, Jacques Garrigue wrote:
> > The debian policy mandates the location for files such as ld.conf in the /etc
> > directory structure. As such, it would be very nice (for me and others too i
> > guess) to be able to choose the location of this file at configuration time.
>
> Would it really be a good idea? Knowing that ocaml libraries are not binary
> compatible between version, keeping everything in the same place seems safer...

huh ?

I suppose you mean so you can install different versions of ocaml into
different directories and have all things work ok, with libraries in different
place.

I understand that moving ld.conf under /etc will not work well with that,
unless we have some /etc/ocaml/3.04/ld.conf scheme or something.

That said, it is not really a problem for debian, since only one version of
the debian package will ever be installed, and a personal installation would,
i guess, still install its stuff under $OCAMLLIB.

The other solution to comply with debian's policy (and maybe even the FHS or
FSSTD, or whatever it is called right now) would be to keep the ld.conf in
$OCAMLLIB and put a symlink into /etc or vice versa. I am not sure this is a
nicer solution.

> > It would be nice to have some script or little program that helps adding or
> > removing entries in this ld.conf file and i will be providing such a one in
> my
> > debian packages next week, but to enable such a program or script to handle
> > multiple libraries using the same directory, it would be really nice to be
> > able to add a field at the end of the files in the ld.conf file, using it as
> a
> > occurence counter or something such. Maybe this is already possible but i
> have
> > not looked at it yet, will do the first week of january though.
>
> No, currently you are only allowed a carriage return.

Yes, i have seen, but from my reading of the code, it would be almost trivial
to add it, unless some arch where ocaml runs supports path with embedded
spaces (on windows for example, i think this is the case), so a propper
comment separator would be needed.

> By the way, the following two lines (from labltk) do the job. This works on all
> the unixes I know.
>
> if test `grep -s -c '^$(LABLTKDIR)$$' $(LIBDIR)/ld.conf` = 0; \
> then echo $(LABLTKDIR) >> $(LIBDIR)/ld.conf; fi

Will try it out,

Thanks for looking at this.

Friendly,

Sven Luther

(0003297)
administrator (administrator)
2002-01-11 14:15

> The debian policy mandates the location for files such as ld.conf in the /etc
> directory structure. As such, it would be very nice (for me and others too i
> guess) to be able to choose the location of this file at configuration time.

Right. In the meantime, it's always possible to move ld.conf after
installation to /etc, and put a symbolic link to it.

> Also, since the current version of ocaml don't searches $OCAMLDIR and it's
> subdirectories by default (contrary to what Xavier wrote to me in a mail, but
> i may simply have misunderstood something)

Maybe I haven't been clear enough: the ld.conf file itself is looked up in
$OCAMLDIR, but there is no recursive traversal of $OCAMLDIR searching
for .so files.

> , it is needed to fill this ld.conf
> file accordyingly for each installed library.

Depends on your installation policy for libraries: e.g. you could decide
to have a single directory /usr/local/lib/ocaml/site-dlls where all
libs install their DLLs.

Generally speaking, the ld.conf mechanism is modeled exactly after the
/etc/ld.so.conf mechanism used by the Unix dynamic loader. Linux
distributions seem to have no problems with the latter; just follow
the same model for the former.

> It would be nice to have some script or little program that helps
> adding or removing entries in this ld.conf file and i will be
> providing such a one in my debian packages next week, but to enable
> such a program or script to handle multiple libraries using the same
> directory, it would be really nice to be able to add a field at the
> end of the files in the ld.conf file, using it as a occurence
> counter or something such. Maybe this is already possible but i have
> not looked at it yet, will do the first week of january though.
> What do you think about this occurence counter stuff ? Is it a good
> idea, or a totally wrong approach ?

One has to find a suitable syntax for ld.conf: lines of the form
<directory name> <refcount>
aren't quite enough since <directory name> can contain blanks...

- Xavier Leroy

(0003298)
administrator (administrator)
2002-01-11 15:03

On Fri, Jan 11, 2002 at 02:15:33PM +0100, Xavier Leroy wrote:
> > The debian policy mandates the location for files such as ld.conf in the /etc
> > directory structure. As such, it would be very nice (for me and others too i
> > guess) to be able to choose the location of this file at configuration time.
>
> Right. In the meantime, it's always possible to move ld.conf after
> installation to /etc, and put a symbolic link to it.

Yes, but i have looked around a bit, it would be nice to have a -ldconf
configure option to specify were someone want to put it or even better yet,
the full name of the ld.conf file. I could even provide a small patch which
hopefully does something such.

> > Also, since the current version of ocaml don't searches $OCAMLDIR and it's
> > subdirectories by default (contrary to what Xavier wrote to me in a mail, but
> > i may simply have misunderstood something)
>
> Maybe I haven't been clear enough: the ld.conf file itself is looked up in
> $OCAMLDIR, but there is no recursive traversal of $OCAMLDIR searching
> for .so files.

Well, from my experimentation, it seem that not even a non recursive traversal
of ]OCAMLDIR is done, (for files in $OCAMLDIR, not a subdir of it). But then,
i may be remembvering wrong, will test again.

> > , it is needed to fill this ld.conf
> > file accordyingly for each installed library.
>
> Depends on your installation policy for libraries: e.g. you could decide
> to have a single directory /usr/local/lib/ocaml/site-dlls where all
> libs install their DLLs.

No, we put them as the current packages put them in $OCAMLDIR/package_name
mostly.

> Generally speaking, the ld.conf mechanism is modeled exactly after the
> /etc/ld.so.conf mechanism used by the Unix dynamic loader. Linux
> distributions seem to have no problems with the latter; just follow
> the same model for the former.

Yes, i guessed so.

> > It would be nice to have some script or little program that helps
> > adding or removing entries in this ld.conf file and i will be
> > providing such a one in my debian packages next week, but to enable
> > such a program or script to handle multiple libraries using the same
> > directory, it would be really nice to be able to add a field at the
> > end of the files in the ld.conf file, using it as a occurence
> > counter or something such. Maybe this is already possible but i have
> > not looked at it yet, will do the first week of january though.
> > What do you think about this occurence counter stuff ? Is it a good
> > idea, or a totally wrong approach ?
>
> One has to find a suitable syntax for ld.conf: lines of the form
> <directory name> <refcount>
> aren't quite enough since <directory name> can contain blanks...

Yes, under windows they contain names, i don't think unix supports unescaped
blanks in paths.

That said, the best would be to choose a charactert to be used as comment
starting char, and to use it to add other kind of stuff. It needs to be a char
not supported in path names. Maybe # would be fine (as in shell scripts), but
then i don't know all the odd arches were ocaml runs and how they behave with
regard to chars valid for path names.

Another solution would be to maintain a ld.conf.count file, which would mirror
the ld.conf file, and add a count field, probably at the begining of each
line.

Friendly,

Sven Luther
>
> - Xavier Leroy

(0003299)
administrator (administrator)
2002-11-07 11:43

We finally agreed on putting Caml shared libs in one or two conventional
directories, and not in one directory per library. Thus, there should be no
need to change ld.conf on a regular basis.

- Issue History
Date Modified Username Field Change
2005-11-18 10:14 administrator New Issue


Copyright © 2000 - 2011 MantisBT Group
Powered by Mantis Bugtracker