niXforums Forum Index
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   PreferencesPreferences   Log in to check your private messagesLog in to check your private messages   Log inLog in 
·  nixdoc.net ·  man pages ·  Linux HOWTOs ·  FreeBSD Tips ·  Forums
navigation Forum index » *nix » BSD » FreeBSD » mail-lists » Architecture
Why don't we search /usr/local/lib and /usr/local/include by default?
Post new topic   Reply to topic Page 1 of 2 [30 Posts] View previous topic :: View next topic
Goto page:  1, 2 Next
Author Message
Alexey Dokuchaev
*nix forums beginner


Joined: 02 May 2002
Posts: 42

PostPosted: Wed Jun 19, 2002 10:56 am    Post subject: Re: Why don't we search /usr/local/lib and /usr/local/include by default? Reply with quote

On Wed, Jun 19, 2002 at 01:25:09PM +0200, Ollivier Robert wrote:
Quote:
According to Antoine Beaupre:
Ideally, /usr/local should go away. Packages should install in /usr by
default. But the ports system would need a bigger fence around it to
expose /usr this way, IMHO.

If you're advocating something like the FHS used on Linux (which put things
like gnome and the kitchen-sink in /usr/bin), then forget it. I don't want
FreeBSD become another Debian-like monster.

Very true. The idea of ports separated from the base is a lot of help
when dealing with system upgrade/backup/wipe-out. Heck, I could have
simply "rm -rf /usr/local" and get rid of all non-X11 ports I have Wink
And still get the box running.

3-rd party should go in /usr/local (OK, X11 goes in /usr/X11R6), thus
leaving /usr populated by the base only. Period.

../danfe


To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-arch" in the body of the message
Back to top
Ollivier Robert
*nix forums beginner


Joined: 21 Mar 2002
Posts: 19

PostPosted: Wed Jun 19, 2002 9:25 am    Post subject: Re: Why don't we search /usr/local/lib and /usr/local/include by default? Reply with quote

According to Antoine Beaupre:
Quote:
Ideally, /usr/local should go away. Packages should install in /usr by
default. But the ports system would need a bigger fence around it to
expose /usr this way, IMHO.

If you're advocating something like the FHS used on Linux (which put things
like gnome and the kitchen-sink in /usr/bin), then forget it. I don't want
FreeBSD become another Debian-like monster.

The FHS way complicates life far too much, forces one to have a far too big
/usr and is a PITA to deal with. Been there, Done that. Got the scars even.

--
Ollivier ROBERT -=- FreeBSD: The Power to Serve! -=- roberto@keltia.freenix.fr
FreeBSD keltia.freenix.fr 5.0-CURRENT #80: Sun Jun 4 22:44:19 CEST 2000

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-arch" in the body of the message
Back to top
Wes Peters
*nix forums addict


Joined: 09 Apr 2002
Posts: 90

PostPosted: Thu May 30, 2002 4:13 am    Post subject: Re: Why don't we search /usr/local/lib and /usr/local/include bydefault? Reply with quote

"M. Warner Losh" wrote:
Quote:

In message: <20020529125401.C2156@dragon.nuxi.com
"David O'Brien" <dev-null@NUXI.com> writes:
: On Wed, May 29, 2002 at 02:08:13PM +0930, Greg 'groggy' Lehey wrote:
: > On Tuesday, 28 May 2002 at 22:14:53 -0600, Warner Losh wrote:
: > > In message: <20020529122327.C82424@wantadilla.lemis.com
: > > "Greg 'groggy' Lehey" <grog@FreeBSD.ORG> writes:
: > >> I'm complaining about the implementation. Since the Ports Collection
: > >> installs by default in /usr/local, it seems reasonable to at least put
: > >> these directories at the end of the search paths for header files and
: > >> libraries.
:
: > > It is working as designed. /usr/local/* isn't searched by default,
: > > and never have been in BSD.
:
: > "We do it this way because our grandfathers did it this way"?
:
: I speak English because my grandfather did. A good enough reason for me.

Also, "If everybody were jumping off of cliffs, would you do it too?"

Add /usr/local/* by default is just a really dumb idea.

Well-behaved packages ldconfig {PREFIX}/lib and/or {PREFIX}/libexec on
installation, which is acceptable for users. Poorly behaved packages
should be corrected rather than dorking up the system to accomodate
them.

As far as -L and -I arguments to cc, programmers should be able to figger
out which libraries they want.

This pretty much falls in the category of "works as intended" doesn't it?

--
"Where am I, and what am I doing in this handbasket?"

Wes Peters Softweyr LLC
wes@softweyr.com http://softweyr.com/

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-arch" in the body of the message
Back to top
M. Warner Losh
*nix forums Guru


Joined: 22 Mar 2002
Posts: 365

PostPosted: Wed May 29, 2002 9:18 pm    Post subject: Re: Why don't we search /usr/local/lib and /usr/local/include by default? Reply with quote

In message: <20020529125401.C2156@dragon.nuxi.com>
"David O'Brien" <dev-null@NUXI.com> writes:
: On Wed, May 29, 2002 at 02:08:13PM +0930, Greg 'groggy' Lehey wrote:
: > On Tuesday, 28 May 2002 at 22:14:53 -0600, Warner Losh wrote:
: > > In message: <20020529122327.C82424@wantadilla.lemis.com>
: > > "Greg 'groggy' Lehey" <grog@FreeBSD.ORG> writes:
: > >> I'm complaining about the implementation. Since the Ports Collection
: > >> installs by default in /usr/local, it seems reasonable to at least put
: > >> these directories at the end of the search paths for header files and
: > >> libraries.
: > >
: > > It is working as designed. /usr/local/* isn't searched by default,
: > > and never have been in BSD.
: >
: > "We do it this way because our grandfathers did it this way"?
:
: I speak English because my grandfather did. A good enough reason for me.

Also, "If everybody were jumping off of cliffs, would you do it too?"

Add /usr/local/* by default is just a really dumb idea.

Warner

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-arch" in the body of the message
Back to top
Terry Lambert
*nix forums Guru


Joined: 19 Mar 2002
Posts: 434

PostPosted: Wed May 29, 2002 6:28 pm    Post subject: Re: Why don't we search /usr/local/lib and /usr/local/include by default? Reply with quote

David O'Brien wrote:
Quote:
Just because Linux is lame

I think that's a rather blanked statement.

Doesn't make it any less true.

Almost said nearly the same thing. I "played nice" instead. Cool.

-- Terry

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-arch" in the body of the message
Back to top
Terry Lambert
*nix forums Guru


Joined: 19 Mar 2002
Posts: 434

PostPosted: Wed May 29, 2002 6:27 pm    Post subject: Re: Why don't we search /usr/local/lib and /usr/local/include by default? Reply with quote

David O'Brien wrote:
Quote:
The resulting binaries still do not work, unless LD_LIBRARY_PATH
is set, or there is an intervening run of "ldconfig". They fail
to find shared libraries at runtime, installed after boot but
before link (the libraries are found at link time, just not at
runtime).

Terry, the Ports Collection *does* do `ldconfig' after installing shared
libs. We also do have the assumption that "ldconfig_paths" in
/etc/rc.conf is set to match PREFIX.

This does nothing if I mount /usr/local from some place else,
rather than installing the port locally.

Also, we know about the PREFIX/ports interaction. Not all the
world's a port.

I think the people who were complaining to Greg were Linux wonks
who expected FreeBSD to "work like Linux".

I can't really get behind Linux setting architectural direction;
however... the issue has made the point that there is a differece
between library-and-header-file-finding-behaviour at compile,
link, and (in the shared library case) run.

I don't like that. I'm not claiming to have a golden fix for it,
but I'd at least like to know that other people don't like it.

8-).

I think I'm pretty much the only one in this thread (besides the
Linux wonks) talking about compiling an arbitrary set of sources,
NOT in the context of the ports system. PREFIX has some meaning,
but it's mostly linked to ports.

-- Terry

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-arch" in the body of the message
Back to top
David O'Brien
*nix forums beginner


Joined: 29 May 2002
Posts: 1

PostPosted: Wed May 29, 2002 5:56 pm    Post subject: Re: Why don't we search /usr/local/lib and /usr/local/include by default? Reply with quote

On Wed, May 29, 2002 at 04:27:31PM +1000, Martin Pool wrote:
Quote:
Given the arguments advanced, I'm curious whether you think that
packages which are not specific to BSD ought to detect BSD and add
those paths, or whether they ought to break by default and require the
user to specifically nominate /usr/local/?

*sigh* All the word is NOT GCC on 386 Linux!

No, packages should add those paths. The SUNpro compiler on Solaris does
not check /usr/local by default either. Nor does the native compilers on
Tru64 and HP-UX (IIRC).

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-arch" in the body of the message
Back to top
David O'Brien
*nix forums beginner


Joined: 29 May 2002
Posts: 1

PostPosted: Wed May 29, 2002 5:54 pm    Post subject: Re: Why don't we search /usr/local/lib and /usr/local/include by default? Reply with quote

On Wed, May 29, 2002 at 02:08:13PM +0930, Greg 'groggy' Lehey wrote:
Quote:
On Tuesday, 28 May 2002 at 22:14:53 -0600, Warner Losh wrote:
In message: <20020529122327.C82424@wantadilla.lemis.com
"Greg 'groggy' Lehey" <grog@FreeBSD.ORG> writes:
I'm complaining about the implementation. Since the Ports Collection
installs by default in /usr/local, it seems reasonable to at least put
these directories at the end of the search paths for header files and
libraries.

It is working as designed. /usr/local/* isn't searched by default,
and never have been in BSD.

"We do it this way because our grandfathers did it this way"?

I speak English because my grandfather did. A good enough reason for me.


Quote:
Just because Linux is lame

I think that's a rather blanked statement.

Doesn't make it any less true.

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-arch" in the body of the message
Back to top
David O'Brien
*nix forums beginner


Joined: 29 May 2002
Posts: 1

PostPosted: Wed May 29, 2002 5:51 pm    Post subject: Re: Why don't we search /usr/local/lib and /usr/local/include by default? Reply with quote

On Tue, May 28, 2002 at 12:31:07PM -0700, Terry Lambert wrote:
Quote:
Antoine Beaupre wrote:
We could still make the ports system try to use libraries in
/usr/local/lib too by default since most third party apps have
dependencies on other third-party apps.

The way I usually do it is:

CONFIGURE_ENV+= CPPFLAGS="-I${LOCALBASE}/include" \
LDFLAGS="-L${LOCALBASE}/lib" \
CFLAGS="-I${LOCALBASE}/include ${CFLAGS}" \
CXXFLAGS="-I${LOCALBASE}/include ${CXXFLAGS}"

or something like that. I think a lot of ports have something like that
in there somewhere.


The resulting binaries still do not work, unless LD_LIBRARY_PATH
is set, or there is an intervening run of "ldconfig". They fail
to find shared libraries at runtime, installed after boot but
before link (the libraries are found at link time, just not at
runtime).


Terry, the Ports Collection *does* do `ldconfig' after installing shared
libs. We also do have the assumption that "ldconfig_paths" in
/etc/rc.conf is set to match PREFIX.

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-arch" in the body of the message
Back to top
Christian Weisgerber
*nix forums beginner


Joined: 29 May 2002
Posts: 18

PostPosted: Wed May 29, 2002 11:04 am    Post subject: Re: Why don't we search /usr/local/lib and /usr/local/include by default? Reply with quote

Greg 'groggy' Lehey <grog@FreeBSD.org> wrote:

Quote:
We shouldn't search /usr/local by default because PREFIX can be set
to anything.

It doesn't do any harm even in that case.

Yes, it does. It will just about ensure that building with a
LOCALBASE other than /usr/local will break, because if /usr/local
is searched automatically most port maintainers will forget to
specify -I${LOCALBASE}/include and -L${LOCALBASE}/lib.

--
Christian "naddy" Weisgerber naddy@mips.inka.de


To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-arch" in the body of the message
Back to top
M. Warner Losh
*nix forums Guru


Joined: 22 Mar 2002
Posts: 365

PostPosted: Wed May 29, 2002 5:37 am    Post subject: Re: Why don't we search /usr/local/lib and /usr/local/include by default? Reply with quote

In message: <20020529140813.P82424@wantadilla.lemis.com>
"Greg 'groggy' Lehey" <grog@FreeBSD.org> writes:
: > We shouldn't search it because that may break other things.
:
: What?

It increases the default security domain from /usr/include and
/usr/lib to also include /usr/local/lib and /usr/local/include
silently. Right now users must explicitly declare that they want to
link against this less secure domain by adding -I/usr/local/include
and -L/usr/lcoal/include to the build process.

Maybe this isn't a show stopper, but it is the sort of thing that
needs to be considered before we put a change like this into the tree.
I think that it is a sufficient reason to block the addition.

Warner

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-arch" in the body of the message
Back to top
Martin Pool
*nix forums beginner


Joined: 29 May 2002
Posts: 1

PostPosted: Wed May 29, 2002 4:27 am    Post subject: Re: Why don't we search /usr/local/lib and /usr/local/include by default? Reply with quote

On 28 May 2002, "M. Warner Losh" <imp@village.org> wrote:
Quote:
In message: <20020529140813.P82424@wantadilla.lemis.com
"Greg 'groggy' Lehey" <grog@FreeBSD.org> writes:
: > We shouldn't search it because that may break other things.
:
: What?

It increases the default security domain from /usr/include and
/usr/lib to also include /usr/local/lib and /usr/local/include
silently. Right now users must explicitly declare that they want to
link against this less secure domain by adding -I/usr/local/include
and -L/usr/lcoal/include to the build process.

I thought that was probably the reason.

Given the arguments advanced, I'm curious whether you think that
packages which are not specific to BSD ought to detect BSD and add
those paths, or whether they ought to break by default and require the
user to specifically nominate /usr/local/?

The first is probably more friendly, but in a way it undermines the
BSD maintainers' design.

--
Martin

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-arch" in the body of the message
Back to top
M. Warner Losh
*nix forums Guru


Joined: 22 Mar 2002
Posts: 365

PostPosted: Wed May 29, 2002 4:14 am    Post subject: Re: Why don't we search /usr/local/lib and /usr/local/include by default? Reply with quote

In message: <20020529122327.C82424@wantadilla.lemis.com>
"Greg 'groggy' Lehey" <grog@FreeBSD.ORG> writes:
: I'm complaining about the implementation. Since the Ports Collection
: installs by default in /usr/local, it seems reasonable to at least put
: these directories at the end of the search paths for header files and
: libraries.

It is working as designed. /usr/local/* isn't searched by default,
and never have been in BSD. Just because Linux is lame doesn't mean
that we should be too.

We shouldn't search /usr/local by default because PREFIX can be set to
anything. We shouldn't search it because that may break other
things.

Warner

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-arch" in the body of the message
Back to top
Terry Lambert
*nix forums Guru


Joined: 19 Mar 2002
Posts: 434

PostPosted: Wed May 29, 2002 4:07 am    Post subject: Re: Why don't we search /usr/local/lib and /usr/local/include bydefault? Reply with quote

"M. Warner Losh" wrote:
Quote:
In message: <20020529140813.P82424@wantadilla.lemis.com
"Greg 'groggy' Lehey" <grog@FreeBSD.org> writes:
: > We shouldn't search it because that may break other things.
:
: What?

It increases the default security domain from /usr/include and
/usr/lib to also include /usr/local/lib and /usr/local/include
silently. Right now users must explicitly declare that they want to
link against this less secure domain by adding -I/usr/local/include
and -L/usr/lcoal/include to the build process.

What is the preference order for shared libraries with the same
name?

If you have to look to answer this question, or if it depends
on the contents of the /etc/rc.conf file variable's arguments to
ldconfig, based on list order, then I would argue that the domain
is already expanded.

There's also a nice hidden assuption there, that the environmental
library path overrides are otherwise "safe".


Quote:
Maybe this isn't a show stopper, but it is the sort of thing that
needs to be considered before we put a change like this into the tree.
I think that it is a sufficient reason to block the addition.

I think the fact that it doesn't rationalize compiler, linker, and
runtime linker behaviour is sufficient to say "no".

-- Terry

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-arch" in the body of the message
Back to top
Terry Lambert
*nix forums Guru


Joined: 19 Mar 2002
Posts: 434

PostPosted: Wed May 29, 2002 4:02 am    Post subject: Re: Why don't we search /usr/local/lib and /usr/local/include by default? Reply with quote

Greg 'groggy' Lehey wrote:
Quote:
We shouldn't search /usr/local by default because PREFIX can be set
to anything.

It doesn't do any harm even in that case.

Actually, in this case, it can.


Quote:
We shouldn't search it because that may break other things.

What?

The issue with "PREFIX" is that it's used for the "ports" system,
including "packages".

There _is_ actually a way that this could be bad. The place it
would be bad is for ports maintainers and ports users (but not
packages, since they will get caught during the build process).

The way this could go sour is to hide dependencies.

Consider a port maintainer who has a working system where they do
ports. This system may have things installed on it that the port
maintainer uses in everyday use of the system -- when the box is
not being used to maintain the port.

In this case, what this means is that an updated version of software
could grow a dependency on the installed software -- _because the
compiler finds it without being told_, ad the port maintainer may not
become aware of this situation at the time of the port _because the
compiler finds it_.

IMO, this is *probably* what happened with the recent "getopt_long"
problem that someone posted about to both -ports and -hackers.


FWIW, "PREFIX", in my book, is not a "ports-only thing". That makes
an argument against the extension your Linux friends want, based
soley on "PREFIX", pretty specious.

I'd also argue that ports should be maintained in a jail, so that
this is never an issue; we know already that we can have mistakes
in found dependencies, even if the linker and the autoconfig process
is too stupid gto catch them: that's why the packages build farm is
a farm, and why it requires "clean" system images to build out the
packages prior to a FreeBSD release. Without a "portsjail" port,
though, this is unlikely to magically happen all on its own.

FWIW, I think that the developement environment should cater to the
developer. You can argue this both ways: that it should be a minimal
set, or that it should "just work". I don't think it's correct to
try to make the "PREFIX" argument on the basis of ports maintainers,
though, since they aren't really the majority of developers.

On the other hand, it's pretty self-evident that the rules for doing
compiling (include paths) are different from those for linking (library
paths) are different from those from running (ldconfig cache contents),
and that these three things should at least *try* to be the same.

My own perspective, having used FreeBSD as a developement platorm for
code to be deployed on AIX and Solaris... is that FreeBSD "comes with"
too much crap. The OpenSSL stuff along means that any code I develope
without paying particular attention, is automatically unportable,
since I may forget to import the OpenSSL sources into my source tree,
incorrectly assuming that the OS will provide the support for me (this
is not true!). In general, I have to say that the FreeBSD ports
system itself doesn't take these dependencies into account very well
(I guess it would be the "Open Ports" system, if it did, since that
would mean it would run on any minimal POSIX compliant system, not
just FreeBSD).

It's very hard, IMO, to argue against including well known add-on
include and library paths in the compiler and linker, when they are
there in the ldconfig library path cache, and OpenSSL is in the base
system for FreeBSD, but not other OS's: the PREFIX argument is a
portability argument, and you can't make one portability argument
without making *all* portability arguments.

-- Terry

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-arch" in the body of the message
Back to top
Google

Back to top
Display posts from previous:   
Post new topic   Reply to topic Page 1 of 2 [30 Posts] Goto page:  1, 2 Next
View previous topic :: View next topic
The time now is Thu Jan 08, 2009 5:13 am | All times are GMT
navigation Forum index » *nix » BSD » FreeBSD » mail-lists » Architecture
Jump to:  

Similar Topics
Topic Author Forum Replies Last Post
No new posts spoofed local email addresses watkykjy Postfix 0 Thu Nov 20, 2008 8:49 am
No new posts Best method to search kristy420 Oracle 0 Tue Nov 18, 2008 6:34 pm
No new posts Postfix sending problem for local domain remote email monkey_magix Postfix 0 Mon Sep 10, 2007 10:17 am
No new posts Bug#379104: ITP: complearn-mpi -- parallel quartet tree s... Rudi Cilibrasi devel 0 Fri Jul 21, 2006 11:30 am
No new posts IMAP4 search with special characters Luis Corrales python 0 Fri Jul 21, 2006 7:51 am

Bankruptcy | Bankruptcy | PS2 Cheat Codes | Debt Consolidation | Loans
Copyright © 2004-2005 DeniX Solutions SRL
 
Other DeniX Solutions sites: Unix/Linux blog |  electronics forum |  medicine forum |  science forum | 
Privacy Policy


Powered by phpBB © 2001, 2005 phpBB Group
[ Time: 0.2196s ][ Queries: 16 (0.0679s) ][ GZIP on - Debug on ]