adding debug variants?
is there any reason not to add a debug variant to ports, in the event the upstream developers need the entrails for their efforts? I have been communicating with some folks on the gnome team on the issues with the gnome python bindings and editing the Portfile seems like something it would be nice to avoid with a "port build py-gnome +debug" option. All I had to do was add "-O0 -Wall -g" to the CFLAGS but for many users that might not be something they're comfortable with. Add to that the additional complication of the instructions reading "-O0 -g- Wall" (the difference a space can make) and the resulting failures and it might prove frustrating. -- Paul Beard contact info: www.paulbeard.org/paulbeard.vcf pictures: http://www.flickr.com/photos/pdb206/ Are you trying to win an argument or solve a problem?
On 2007-03-11 10:14:39 -0700, Paul Beard wrote:
All I had to do was add "-O0 -Wall -g" to the CFLAGS but for many users that might not be something they're comfortable with. Add to that the additional complication of the instructions reading "-O0 -g- Wall" (the difference a space can make) and the resulting failures and it might prove frustrating.
IMHO, instead of a variant, MacPorts should allow users to specify default compiler options (e.g., CFLAGS) since there are too many possibilities. For instance, though -O0 is better for real debugging purpose, it degrades performance, and in general, -O1 is fine for normal use and still allows a significant core dump in case of crash. Indeed the gcc man page says about the -g option: GCC allows you to use -g with -O. The shortcuts taken by optimized code may occasionally produce surprising results: some variables you declared may not exist at all; flow of control may briefly move where you did not expect it; some statements may not be executed because they compute constant results or their values were already at hand; some statements may execute in different places because they were moved out of loops. Nevertheless it proves possible to debug optimized output. This makes it reasonable to use the optimizer for programs that might have bugs. -- Vincent Lefèvre <vincent@vinc17.org> - Web: <http://www.vinc17.org/> 100% accessible validated (X)HTML - Blog: <http://www.vinc17.org/blog/> Work: CR INRIA - computer arithmetic / Arenaire project (LIP, ENS-Lyon)
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 On Mar 11, 2007, at 1:41 PM, Vincent Lefevre wrote:
IMHO, instead of a variant, MacPorts should allow users to specify default compiler options (e.g., CFLAGS) since there are too many possibilities. For instance, though -O0 is better for real debugging purpose, it degrades performance, and in general, -O1 is fine for normal use and still allows a significant core dump in case of crash.
Sure, if people can do that with confidence. what I was thinking was a scenario where the maintainer or upstream folks had a specific incantation they wanted used and that would be used if the +debug variant was passed. I agree that one size does not fit all. - -- Paul Beard contact info: www.paulbeard.org/paulbeard.vcf pictures: http://www.flickr.com/photos/pdb206/ Are you trying to win an argument or solve a problem? -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.6 (Darwin) iD8DBQFF9KQsfHLPwpj1/JQRAkHTAJ9Zrwyldx/nRLlGRFGTbE4GM6Z3FgCeNoFb bU5+lLg3lGFyz766MMhm92s= =u86E -----END PGP SIGNATURE-----
participants (2)
-
Paul Beard
-
Vincent Lefevre