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
[POLL] need a good name for share/mk API versioning
Post new topic   Reply to topic Page 1 of 1 [11 Posts] View previous topic :: View next topic
Author Message
Ruslan Ermilov
*nix forums addict


Joined: 01 Jul 2002
Posts: 65

PostPosted: Thu Jul 18, 2002 4:05 pm    Post subject: [POLL] need a good name for share/mk API versioning Reply with quote

Hi!

Recently, some backwards incompatible changes were purposedly
introduced to the share/mk API, particularly to bsd.lib.mk and
bsd.incs.mk (include files). Everything is OK with src/, but
some ports/ that rely on FreeBSD's share/mk API should be able
to use both old (currently in -STABLE, soon to be upgraded to
the new API) and new versions of the API, so we need to somehow
differentiate these APIs. The solution is to add the FreeBSD
specific make(1) variable that could be used to differentiate
different API versions.

So I would like to run a short pool as to what the name of this
variable should be (the draft is _FREEBSD_MK_API_VERSION), and
what should be its numbering scheme. I would like this numbering
scheme to be a monotonically increasing natural number. This
would be good because the same numbering scheme would be used in
both -STABLE and -CURRENT, and would be bad because specific
backwards incompatible API changes should be merged in the same
order as they were applied to -CURRENT.

The variable must be put into sys.mk (so that it's always
defined), and one option it to use an already existing
.FreeBSD variable.

Your bet please. I will wait until Monday for poll to settle.


Thanks,
--
Ruslan Ermilov Sysadmin and DBA,
ru@sunbay.com Sunbay Software AG,
ru@FreeBSD.org FreeBSD committer,
+380.652.512.251 Simferopol, Ukraine

http://www.FreeBSD.org The Power To Serve
http://www.oracle.com Enabling The Information Age
Back to top
Mark Valentine
*nix forums addict


Joined: 13 Jun 2002
Posts: 62

PostPosted: Thu Jul 18, 2002 7:43 pm    Post subject: Re: [POLL] need a good name for share/mk API versioning Reply with quote

Quote:
From: ru@freebsd.org (Ruslan Ermilov)
Date: Thu 18 Jul, 2002
Subject: [POLL] need a good name for share/mk API versioning

Recently, some backwards incompatible changes were purposedly
introduced to the share/mk API, particularly to bsd.lib.mk and
bsd.incs.mk (include files). Everything is OK with src/, but
some ports/ that rely on FreeBSD's share/mk API should be able
to use both old (currently in -STABLE, soon to be upgraded to
the new API) and new versions of the API, so we need to somehow
differentiate these APIs. The solution is to add the FreeBSD
specific make(1) variable that could be used to differentiate
different API versions.

If this were only for ports, the existing OSVERSION in bsd.port.mk
would suffice, no?

Quote:
So I would like to run a short pool as to what the name of this
variable should be (the draft is _FREEBSD_MK_API_VERSION), and
what should be its numbering scheme. I would like this numbering
scheme to be a monotonically increasing natural number. This
would be good because the same numbering scheme would be used in
both -STABLE and -CURRENT, and would be bad because specific
backwards incompatible API changes should be merged in the same
order as they were applied to -CURRENT.

It sounds like you do want to have a version number visible beyond ports,
which is quite reasonable (third party software may choose to use the
"standard" bsd.*.mk rules, without using the ports infrastructure).

Quote:
The variable must be put into sys.mk (so that it's always
defined), and one option it to use an already existing
FreeBSD variable.

sys.mk is the wrong place for things specific to bsd.*.mk (all of the
includes at the end of sys.mk are bugs). sys.mk is for make(1) defaults;
bsd.*.mk comprises the FreeBSD build system built _on top of_ make(1), which
(should) know nothing about bsd.*.mk - currently make(1) pollutes all other
build systems with stuff from make.conf and other FreeBSD build system
makefiles.

bsd.sys.mk is a better place; _FREEBSD_MK_VERSION is a better name; I don't
see any need for anything more complex than values of "1", "2", "3"...

Cheers,

Mark.

--
Mark Valentine, Thuvia Labs <mark@thuvia.co.uk> <http://www.thuvia.co.uk>
"Tigers will do ANYTHING for a tuna fish sandwich." Mark Valentine uses
"We're kind of stupid that way." *munch* *munch* and endorses FreeBSD
-- <http://www.calvinandhobbes.com> <http://www.freebsd.org>

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


Joined: 01 Jul 2002
Posts: 65

PostPosted: Fri Jul 19, 2002 5:45 am    Post subject: Re: [POLL] need a good name for share/mk API versioning Reply with quote

On Thu, Jul 18, 2002 at 08:43:56PM +0100, Mark Valentine wrote:
Quote:
From: ru@freebsd.org (Ruslan Ermilov)
Date: Thu 18 Jul, 2002
Subject: [POLL] need a good name for share/mk API versioning

Recently, some backwards incompatible changes were purposedly
introduced to the share/mk API, particularly to bsd.lib.mk and
bsd.incs.mk (include files). Everything is OK with src/, but
some ports/ that rely on FreeBSD's share/mk API should be able
to use both old (currently in -STABLE, soon to be upgraded to
the new API) and new versions of the API, so we need to somehow
differentiate these APIs. The solution is to add the FreeBSD
specific make(1) variable that could be used to differentiate
different API versions.

If this were only for ports, the existing OSVERSION in bsd.port.mk
would suffice, no?

No, this is for third party software (well, some ports) that use

bsd.lib.mk.

Quote:
So I would like to run a short pool as to what the name of this
variable should be (the draft is _FREEBSD_MK_API_VERSION), and
what should be its numbering scheme. I would like this numbering
scheme to be a monotonically increasing natural number. This
would be good because the same numbering scheme would be used in
both -STABLE and -CURRENT, and would be bad because specific
backwards incompatible API changes should be merged in the same
order as they were applied to -CURRENT.

It sounds like you do want to have a version number visible beyond ports,
which is quite reasonable (third party software may choose to use the
"standard" bsd.*.mk rules, without using the ports infrastructure).

Yes.


Quote:
The variable must be put into sys.mk (so that it's always
defined), and one option it to use an already existing
FreeBSD variable.

sys.mk is the wrong place for things specific to bsd.*.mk (all of the
includes at the end of sys.mk are bugs). sys.mk is for make(1) defaults;
bsd.*.mk comprises the FreeBSD build system built _on top of_ make(1), which
(should) know nothing about bsd.*.mk - currently make(1) pollutes all other
build systems with stuff from make.conf and other FreeBSD build system
makefiles.

bsd.sys.mk is a better place; _FREEBSD_MK_VERSION is a better name; I don't
see any need for anything more complex than values of "1", "2", "3"...

Yes, sys.mk is not the best place, but technically it's the only place

sufficient for what I need, and I need some variable defined before we
include bsd.lib.mk; this is only possible with sys.mk. I think a
working example would be handy:

%%%
Index: src.wnb.Makefile
==================================================================RCS file: /home/ncvs/ports/textproc/wordnet/files/src.wnb.Makefile,v
retrieving revision 1.3
diff -u -r1.3 src.wnb.Makefile
--- src.wnb.Makefile 31 Oct 2001 05:04:29 -0000 1.3
+++ src.wnb.Makefile 18 Jul 2002 17:47:12 -0000
@@ -10,12 +10,15 @@

LDADD= -L../lib -lwn1 -L${PREFIX}/lib -ltcl${TCL_VER} -ltk${TCL_VER}

+.if defined(_CURRENT_)
+SHLIB_NAME= libtclwn1.so.7
+.else
LIB= tclwn1
SHLIB_MAJOR= 7
SHLIB_MINOR= 0
-SRCS= stubs.c
-
INTERNALLIB= True # To avoid building the useless static library
+.endif
+SRCS= stubs.c

all: ${SHLIB_NAME} pkgIndex.tcl

%%%


Cheers,
--
Ruslan Ermilov Sysadmin and DBA,
ru@sunbay.com Sunbay Software AG,
ru@FreeBSD.org FreeBSD committer,
+380.652.512.251 Simferopol, Ukraine

http://www.FreeBSD.org The Power To Serve
http://www.oracle.com Enabling The Information Age
Back to top
M. Warner Losh
*nix forums Guru


Joined: 22 Mar 2002
Posts: 365

PostPosted: Fri Jul 19, 2002 4:01 pm    Post subject: Re: [POLL] need a good name for share/mk API versioning Reply with quote

In message: <200207181943.g6IJhu5A016231@dotar.thuvia.org>
Mark Valentine <mark@thuvia.demon.co.uk> writes:
: > From: ru@freebsd.org (Ruslan Ermilov)
: > Date: Thu 18 Jul, 2002
: > Subject: [POLL] need a good name for share/mk API versioning
:
: > Recently, some backwards incompatible changes were purposedly
: > introduced to the share/mk API, particularly to bsd.lib.mk and
: > bsd.incs.mk (include files). Everything is OK with src/, but
: > some ports/ that rely on FreeBSD's share/mk API should be able
: > to use both old (currently in -STABLE, soon to be upgraded to
: > the new API) and new versions of the API, so we need to somehow
: > differentiate these APIs. The solution is to add the FreeBSD
: > specific make(1) variable that could be used to differentiate
: > different API versions.
:
: If this were only for ports, the existing OSVERSION in bsd.port.mk
: would suffice, no?

No. The OS version and the .mk files may (and often are) unrelated.
This is especially true in the case of cross build environments, which
are often used to insulate products from whatever version of FreeBSD
they happen to be running on. At Timing solutions, we often build 4.5
based products on a 4.3 machine, and vice versa.

Warner

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


Joined: 13 Jun 2002
Posts: 62

PostPosted: Sat Jul 20, 2002 4:45 pm    Post subject: Re: [POLL] need a good name for share/mk API versioning Reply with quote

Quote:
From: Ruslan Ermilov <ru@freebsd.org
Date: Fri 19 Jul, 2002
Subject: Re: [POLL] need a good name for share/mk API versioning

Yes, sys.mk is not the best place, but technically it's the only place
sufficient for what I need, and I need some variable defined before we
include bsd.lib.mk; this is only possible with sys.mk.

The real problem is a design issue with the FreeBSD build system, in that
the Makefile doesn't know which version of the bsd.*.mk files it's going
to get before it includes one of them.

PARAMETER = some value

.include <bsd.foo.mk>

A better design might have been to include build system default parameters
seperately:

.include <bsd.sys.mk>

.if defined(_WHATEVER_)
PARAMETER = some value
.else
OTHERPARAMETER = other value
.endif

.include <bsd.foo.mk>

The present design assumes that make(1)'s ``?='' feature allowing defaults to
be set as "fallback" values is sufficient, but we now see that this isn't good
enough to cope with architectural changes (but supporting multiple build
system versions probably wasn't a design goal).

However, it's obviously too late to change every Makefile in the world to
correct that design issue now.

Putting information about bsd.*.mk in sys.mk, however, is also insufficient,
since sys.mk doesn't know which versions of bsd.*.mk the makefile will pick
up, if any (consider using ``-m'' or ``-I'' options to pick up bsd.*.mk from
a directory other than the one containing sys.mk, which should be legitimate).

One possible workaround might be to have sys.mk include a file defined by a
variable (if defined, perhaps in the environment), which for the FreeBSD build
system could be set to "bsd.sys.mk" or similar. This allows any build system
to have a component included before the Makefile is read.

.if defined(__BUILD_SYS_MK)
.include "${__BUILD_SYS_MK}"
.endif

If really needed for compatibility/POLA reasons, sys.mk could default the
variable:

__BUILD_SYS_MK?=bsd.sys.mk

The user could set the variable to /dev/null to avoid the existing pollution
to his own build system.

This mechanism would allow the make.conf stuff, etc. to be moved out of sys.mk.

Cheers,

Mark.

--
Mark Valentine, Thuvia Labs <mark@thuvia.co.uk> <http://www.thuvia.co.uk>
"Tigers will do ANYTHING for a tuna fish sandwich." Mark Valentine uses
"We're kind of stupid that way." *munch* *munch* and endorses FreeBSD
-- <http://www.calvinandhobbes.com> <http://www.freebsd.org>

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


Joined: 13 Jun 2002
Posts: 62

PostPosted: Sat Jul 20, 2002 4:48 pm    Post subject: Re: [POLL] need a good name for share/mk API versioning Reply with quote

Quote:
From: "M. Warner Losh" <imp@bsdimp.com
Date: Fri 19 Jul, 2002
Subject: Re: [POLL] need a good name for share/mk API versioning

In message: <200207181943.g6IJhu5A016231@dotar.thuvia.org
Mark Valentine <mark@thuvia.demon.co.uk> writes:
: If this were only for ports, the existing OSVERSION in bsd.port.mk
: would suffice, no?

No. The OS version and the .mk files may (and often are) unrelated.
This is especially true in the case of cross build environments, which
are often used to insulate products from whatever version of FreeBSD
they happen to be running on. At Timing solutions, we often build 4.5
based products on a 4.3 machine, and vice versa.

Does this work for the ports system? I recognise the need for cross builds,
but didn't consider it for ports. After all, they already use OSVERSION...

Cheers,

Mark.

--
Mark Valentine, Thuvia Labs <mark@thuvia.co.uk> <http://www.thuvia.co.uk>
"Tigers will do ANYTHING for a tuna fish sandwich." Mark Valentine uses
"We're kind of stupid that way." *munch* *munch* and endorses FreeBSD
-- <http://www.calvinandhobbes.com> <http://www.freebsd.org>

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


Joined: 13 Jun 2002
Posts: 62

PostPosted: Sat Jul 20, 2002 4:52 pm    Post subject: Re: [POLL] need a good name for share/mk API versioning Reply with quote

Quote:
From: mark@dotar.thuvia.org (Mark Valentine)
Date: Sat 20 Jul, 2002
Subject: Re: [POLL] need a good name for share/mk API versioning

One possible workaround might be to have sys.mk include a file defined by a
variable (if defined, perhaps in the environment), which for the FreeBSD build
system could be set to "bsd.sys.mk" or similar. This allows any build system
to have a component included before the Makefile is read.

.if defined(__BUILD_SYS_MK)
.include "${__BUILD_SYS_MK}"
.endif

Of course, no newly design build system should use this feature; use an
early Makefile .include instead...

Cheers,

Mark.

--
Mark Valentine, Thuvia Labs <mark@thuvia.co.uk> <http://www.thuvia.co.uk>
"Tigers will do ANYTHING for a tuna fish sandwich." Mark Valentine uses
"We're kind of stupid that way." *munch* *munch* and endorses FreeBSD
-- <http://www.calvinandhobbes.com> <http://www.freebsd.org>

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: Sat Jul 20, 2002 6:14 pm    Post subject: Re: [POLL] need a good name for share/mk API versioning Reply with quote

In message: <200207201648.g6KGmZJE085462@dotar.thuvia.org>
Mark Valentine <mark@thuvia.demon.co.uk> writes:
: > From: "M. Warner Losh" <imp@bsdimp.com>
: > Date: Fri 19 Jul, 2002
: > Subject: Re: [POLL] need a good name for share/mk API versioning
:
: > In message: <200207181943.g6IJhu5A016231@dotar.thuvia.org>
: > Mark Valentine <mark@thuvia.demon.co.uk> writes:
: > : If this were only for ports, the existing OSVERSION in bsd.port.mk
: > : would suffice, no?
: >
: > No. The OS version and the .mk files may (and often are) unrelated.
: > This is especially true in the case of cross build environments, which
: > are often used to insulate products from whatever version of FreeBSD
: > they happen to be running on. At Timing solutions, we often build 4.5
: > based products on a 4.3 machine, and vice versa.
:
: Does this work for the ports system? I recognise the need for cross builds,
: but didn't consider it for ports. After all, they already use OSVERSION...

Using OSVERSION may be sufficient for the ports. Using a
__FREEBSD_MK_API_VERSION variable would also be sufficient, as well as
allowing for people that use the bsd.*.mk files externally to the
project to continue to do so and cope with the different APIs.

I've not looked at porting out .mk files over to the new scheme, so I
don't know how necessary this would be.

Warner

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


Joined: 13 Jun 2002
Posts: 62

PostPosted: Sat Jul 20, 2002 6:33 pm    Post subject: Re: [POLL] need a good name for share/mk API versioning Reply with quote

Quote:
From: "M. Warner Losh" <imp@bsdimp.com
Date: Sat 20 Jul, 2002
Subject: Re: [POLL] need a good name for share/mk API versioning

Using OSVERSION may be sufficient for the ports. Using a
__FREEBSD_MK_API_VERSION variable would also be sufficient, as well as
allowing for people that use the bsd.*.mk files externally to the
project to continue to do so and cope with the different APIs.

Indeed, if we have __FREEBSD_MK_API_VERSION or equivalent, then ports
should also use that where appropriate rather than OSVERSION.

Cheers,

Mark.

--
Mark Valentine, Thuvia Labs <mark@thuvia.co.uk> <http://www.thuvia.co.uk>
"Tigers will do ANYTHING for a tuna fish sandwich." Mark Valentine uses
"We're kind of stupid that way." *munch* *munch* and endorses FreeBSD
-- <http://www.calvinandhobbes.com> <http://www.freebsd.org>

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: Sat Jul 20, 2002 6:34 pm    Post subject: Re: [POLL] need a good name for share/mk API versioning Reply with quote

In message: <200207201833.g6KIX1FC087737@dotar.thuvia.org>
Mark Valentine <mark@thuvia.demon.co.uk> writes:
: > From: "M. Warner Losh" <imp@bsdimp.com>
: > Date: Sat 20 Jul, 2002
: > Subject: Re: [POLL] need a good name for share/mk API versioning
:
: > Using OSVERSION may be sufficient for the ports. Using a
: > __FREEBSD_MK_API_VERSION variable would also be sufficient, as well as
: > allowing for people that use the bsd.*.mk files externally to the
: > project to continue to do so and cope with the different APIs.
:
: Indeed, if we have __FREEBSD_MK_API_VERSION or equivalent, then ports
: should also use that where appropriate rather than OSVERSION.

Yes. Exactly my point :-)

Warner

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


Joined: 01 Jul 2002
Posts: 65

PostPosted: Sun Jul 21, 2002 6:49 am    Post subject: Re: [POLL] need a good name for share/mk API versioning Reply with quote

On Sat, Jul 20, 2002 at 12:34:56PM -0600, M. Warner Losh wrote:
Quote:
In message: <200207201833.g6KIX1FC087737@dotar.thuvia.org
Mark Valentine <mark@thuvia.demon.co.uk> writes:
: > From: "M. Warner Losh" <imp@bsdimp.com
: > Date: Sat 20 Jul, 2002
: > Subject: Re: [POLL] need a good name for share/mk API versioning
:
: > Using OSVERSION may be sufficient for the ports. Using a
: > __FREEBSD_MK_API_VERSION variable would also be sufficient, as well as
: > allowing for people that use the bsd.*.mk files externally to the
: > project to continue to do so and cope with the different APIs.
:
: Indeed, if we have __FREEBSD_MK_API_VERSION or equivalent, then ports
: should also use that where appropriate rather than OSVERSION.

Yes. Exactly my point :-)

Using OSVERSION (kern.osreldate) is the big pessimization in assuming

that the userland (share/mk in particular) is of the same date as the
running kernel. Using OSVERSION from /usr/include/osreldate.h is the
lesser pessimization and that is what I plan to use as a fine-grained
replacement for BOOTSTRAPPING hacks in /usr/src.


Cheers,
--
Ruslan Ermilov Sysadmin and DBA,
ru@sunbay.com Sunbay Software AG,
ru@FreeBSD.org FreeBSD committer,
+380.652.512.251 Simferopol, Ukraine

http://www.FreeBSD.org The Power To Serve
http://www.oracle.com Enabling The Information Age
Back to top
Google

Back to top
Display posts from previous:   
Post new topic   Reply to topic Page 1 of 1 [11 Posts] View previous topic :: View next topic
The time now is Thu Jan 08, 2009 6:02 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 Can any body guide me a for a good tutorial for BIND (DNS) SHERDIL networking 4 Sat Aug 12, 2006 9:40 am
No new posts database Share Memory Limit (2 GB ) in a Instance is tota... sadanjan@gmail.com IBM DB2 0 Fri Jul 21, 2006 12:57 pm
No new posts Good Representation for an Abstract Syntax Tree johan.tibell@gmail.com C 9 Tue Jul 18, 2006 1:28 pm
No new posts good C compiler polychrom@softhome.net C 21 Fri Jul 14, 2006 11:01 am
No new posts mount command need help mounting samba share Mike AIX 3 Mon Jul 10, 2006 10:32 pm

Bankruptcy | Online Advertising | Loans | Advertising | Beijing Olympic
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.2563s ][ Queries: 16 (0.1156s) ][ GZIP on - Debug on ]