Re: autodetecting dependencies

2012-04-16 Thread A.J. Kehoe IV (Nanoman)

A.J. Kehoe IV (Nanoman) wrote:

[...]


In my opinion, it's best to use the OPTIONS framework and to avoid automatic 
detection entirely.  Consider this problem:

http://docs.freebsd.org/cgi/mid.cgi?20120304190922.GA58789


[...]

It turns out that other people feel the same way about automatic dependencies, and 
there's nothing in FreeBSD that counters their negative impact on indexing and 
port/package management.  This subject is now covered by the FreeBSD Porter's Handbook 
under Problems Caused by Automatic Dependencies:

http://www.freebsd.org/doc/en_US.ISO8859-1/books/porters-handbook/makefile-depend.html#AEN2421

You can use grep to get a list of ports that probably suffer from this 
affliction:

grep -l 'exists(\${LOCALBASE}' /usr/ports/*/*/Makefile

If your shell complains about the number of arguments or something, try this in 
/bin/sh:

find /usr/ports/ -regex '/usr/ports/[^\/]*/[^\/]*/Makefile' -print | awk '{ system(grep -l 
\exists(\\${LOCALBASE}\  $0); }'

My thanks to everybody who gave me feedback regarding this issue, especially 
the FreeBSD Ports Management Team and Warren Block.

--
A.J. Kehoe IV (Nanoman) |  /\  ASCII Ribbon Campaign
Nanoman's Company   |  \ /   - No HTML/RTF in E-mail
E-mail: nano...@nanoman.ca  |   X- No proprietary attachments
WWW: http://www.nanoman.ca/ |  / \   - Respect for open standards


smime.p7s
Description: S/MIME cryptographic signature


Re: autodetecting dependencies

2012-04-11 Thread Peter Jeremy
On 2012-Apr-09 21:02:01 -0500, Stephen Montgomery-Smith step...@missouri.edu 
wrote:
So suppose we are building port A.  It turns out that the configure in 
port A autodetects whether package B is present or not.  It will build 
either way.  But if built with package B, it will not operate without it.
...
What are the accepted ways of handling this?

1.  Don't worry about it.  tinderbox builds will never build port A in 
the presence of package B.

2.  Have the Makefile of port A detect whether package B is installed, 
and if it is then add B as a dependency of A.

3.  Cripple the configure in port A so that it doesn't autodetect for 
package B.

Preference order is 3, 2, 1.  1 is the least desirable because the
resultant packages may include implicit dependencies without
explicit dependencies.  It can also cause subtle problems when port
B is updated without updating port A.

-- 
Peter Jeremy


pgp1NNUjL0Lt3.pgp
Description: PGP signature


Re: autodetecting dependencies

2012-04-10 Thread Stephen Montgomery-Smith

On 04/09/12 21:56, Mel Flynn wrote:

On 4/10/2012 04:02, Stephen Montgomery-Smith wrote:


1.  Don't worry about it.  tinderbox builds will never build port A in
the presence of package B.

2.  Have the Makefile of port A detect whether package B is installed,
and if it is then add B as a dependency of A.

3.  Cripple the configure in port A so that it doesn't autodetect for
package B.  (Sometimes this can be done using a suitable CONFIGURE_ARGS,
but not in my particular situation.)


4. Add OPTION PACKAGE_B. And cripple configure through EXTRA_PATCH if
set to off.






Package B doesn't seem to offer any extra functionality to port A.  I 
ended up going with option 3, because it turned out to be easier than I 
thought it would be.

___
freebsd-ports@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-ports
To unsubscribe, send any mail to freebsd-ports-unsubscr...@freebsd.org


Re: autodetecting dependencies

2012-04-10 Thread A.J. Kehoe IV (Nanoman)

Stephen Montgomery-Smith wrote:

So suppose we are building port A.  It turns out that the configure in
port A autodetects whether package B is present or not.  It will build
either way.  But if built with package B, it will not operate without it.

So suppose I build port A on machine X which has package B installed.
Then I create a package from A, and copy the package to machine Y.
Machine Y does not have package B installed, and so when package A is
installed, it doesn't work on machine Y.

What are the accepted ways of handling this?

1.  Don't worry about it.  tinderbox builds will never build port A in
the presence of package B.

2.  Have the Makefile of port A detect whether package B is installed,
and if it is then add B as a dependency of A.

3.  Cripple the configure in port A so that it doesn't autodetect for
package B.  (Sometimes this can be done using a suitable CONFIGURE_ARGS,
but not in my particular situation.)

I prefer the answer (1).  But I am interested in other people's
opinions.  One problem with (2) or (3) is that the creator of the port
might never find out which packages could be autodetected by port A's
configure without performing an exhaustive search of the source code of A.

Thanks, Stephen


In my opinion, it's best to use the OPTIONS framework and to avoid automatic 
detection entirely.  Consider this problem:

http://docs.freebsd.org/cgi/mid.cgi?20120304190922.GA58789

For your example, I would add this line to port A's Makefile:

OPTIONS=PORT_B  Enable Port B off

I would then replace the automatic detection part of port A's Makefile with 
something like this:

.if defined(WITH_PORT_B)  !defined(WITHOUT_PORT_B)
RUN_DEPENDS+=   portb-1.0:${PORTSDIR}/category/portb
.endif

So, if you don't want port A built with package B as a dependency, you'd use the default on port 
A's OPTIONS dialog screen, otherwise, you'd put a check beside PORT_B.

--
A.J. Kehoe IV (Nanoman) |  /\  ASCII Ribbon Campaign
Nanoman's Company   |  \ /   - No HTML/RTF in E-mail
E-mail: nano...@nanoman.ca  |   X- No proprietary attachments
WWW: http://www.nanoman.ca/ |  / \   - Respect for open standards


smime.p7s
Description: S/MIME cryptographic signature


Re: autodetecting dependencies

2012-04-10 Thread Eitan Adler
On 9 April 2012 22:02, Stephen Montgomery-Smith step...@missouri.edu wrote:
 So suppose we are building port A.  It turns out that the configure in port
 A autodetects whether package B is present or not.  It will build either
 way.  But if built with package B, it will not operate without it.

 So suppose I build port A on machine X which has package B installed. Then I
 create a package from A, and copy the package to machine Y. Machine Y does
 not have package B installed, and so when package A is installed, it doesn't
 work on machine Y.

 What are the accepted ways of handling this?

 1.  Don't worry about it.  tinderbox builds will never build port A in the
 presence of package B.

 2.  Have the Makefile of port A detect whether package B is installed, and
 if it is then add B as a dependency of A.

 3.  Cripple the configure in port A so that it doesn't autodetect for
 package B.  (Sometimes this can be done using a suitable CONFIGURE_ARGS, but
 not in my particular situation.)

The current answer for automagical dependencies is to fix (not
cripple) the configure option to not autodetect for package B. Any
port which currently has automatic detection is buggy and should be
fixed. You can use the OPTIONS framework to enable or disable the
option.

-- 
Eitan Adler
___
freebsd-ports@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-ports
To unsubscribe, send any mail to freebsd-ports-unsubscr...@freebsd.org


autodetecting dependencies

2012-04-09 Thread Stephen Montgomery-Smith
So suppose we are building port A.  It turns out that the configure in 
port A autodetects whether package B is present or not.  It will build 
either way.  But if built with package B, it will not operate without it.


So suppose I build port A on machine X which has package B installed. 
Then I create a package from A, and copy the package to machine Y. 
Machine Y does not have package B installed, and so when package A is 
installed, it doesn't work on machine Y.


What are the accepted ways of handling this?

1.  Don't worry about it.  tinderbox builds will never build port A in 
the presence of package B.


2.  Have the Makefile of port A detect whether package B is installed, 
and if it is then add B as a dependency of A.


3.  Cripple the configure in port A so that it doesn't autodetect for 
package B.  (Sometimes this can be done using a suitable CONFIGURE_ARGS, 
but not in my particular situation.)


I prefer the answer (1).  But I am interested in other people's 
opinions.  One problem with (2) or (3) is that the creator of the port 
might never find out which packages could be autodetected by port A's 
configure without performing an exhaustive search of the source code of A.


Thanks, Stephen
___
freebsd-ports@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-ports
To unsubscribe, send any mail to freebsd-ports-unsubscr...@freebsd.org


Re: autodetecting dependencies

2012-04-09 Thread Mel Flynn
On 4/10/2012 04:02, Stephen Montgomery-Smith wrote:

 1.  Don't worry about it.  tinderbox builds will never build port A in
 the presence of package B.
 
 2.  Have the Makefile of port A detect whether package B is installed,
 and if it is then add B as a dependency of A.
 
 3.  Cripple the configure in port A so that it doesn't autodetect for
 package B.  (Sometimes this can be done using a suitable CONFIGURE_ARGS,
 but not in my particular situation.)

4. Add OPTION PACKAGE_B. And cripple configure through EXTRA_PATCH if
set to off.


-- 
Mel
___
freebsd-ports@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-ports
To unsubscribe, send any mail to freebsd-ports-unsubscr...@freebsd.org