FAQ Search Today's Posts Mark Forums Read
» Video Reviews

» Linux Archive

Linux-archive is a website aiming to archive linux email lists and to make them easily accessible for linux users/developers.


» Sponsor

» Partners

» Sponsor

Go Back   Linux Archive > Gentoo > Gentoo Development

 
 
LinkBack Thread Tools
 
Old 06-30-2010, 05:24 PM
Petteri Rńty
 
Default debug USE flag misuse

On 07/01/2010 02:25 AM, Jeremy Olexa wrote:
> On Wed, 30 Jun 2010 17:09:00 +0200, "Diego E. 'Flameeyes'" Petten˛
> <flameeyes@gentoo.org> wrote:
>
>> Please check the linked documentation or my blog post[1] on the matter
>> if you want to understand the reasoning. I'll be dropping the flag and
>> its context from now on if I stumble across it, without further
>> warnings.
>
> Hey Diego, (not sure if you are on -dev list or not, therefore adding
> you to cc)
>
> What is the consensus on if the metadata.xml specifies that it will add
> CFLAGS? Surely it is not as black/white as the global suggests..?
>
> local:debug:app-portage/eix: Build with CXXFLAGS/LDFLAGS for debugging
> support; not recommended for normal use.
>

I think metadata.xml descriptions should only be used to be more
detailed than the global meaning. One criteria for being a global use
flag is that the flag means the same across packages.

Regards,
Petteri
 
Old 06-30-2010, 06:13 PM
"Paweł Hajdan, Jr."
 
Default debug USE flag misuse

On 6/30/10 5:09 PM, Diego E. 'Flameeyes' Petten├▓ wrote:
> Please check the linked documentation or my blog post[1] on the
> matter if you want to understand the reasoning.

Could you rather add these guidelines to the QA project webpage? I
wouldn't consider a blog post a documentation of a policy that people
should follow.

> I'll be dropping the flag and its context from now on if I stumble
> across it, without further warnings.

Please document it in a proper way before enforcing it. Also, a repoman
check or portage check catching at least some of the misuses would be great.

Paweł
 
Old 06-30-2010, 11:03 PM
Mike Frysinger
 
Default debug USE flag misuse

On Wednesday, June 30, 2010 19:25:32 Jeremy Olexa wrote:
> On Wed, 30 Jun 2010 17:09:00 +0200, "Diego E. 'Flameeyes'" Petten˛ wrote:
> > Please check the linked documentation or my blog post[1] on the matter
> > if you want to understand the reasoning. I'll be dropping the flag and
> > its context from now on if I stumble across it, without further
> > warnings.
>
> What is the consensus on if the metadata.xml specifies that it will add
> CFLAGS? Surely it is not as black/white as the global suggests..?
>
> local:debug:app-portage/eix: Build with CXXFLAGS/LDFLAGS for debugging
> support; not recommended for normal use.

eix is broken and needs fixing
-mike
 
Old 06-30-2010, 11:25 PM
Jeremy Olexa
 
Default debug USE flag misuse

On Wed, 30 Jun 2010 17:09:00 +0200, "Diego E. 'Flameeyes'" Petten˛
<flameeyes@gentoo.org> wrote:

> Please check the linked documentation or my blog post[1] on the matter
> if you want to understand the reasoning. I'll be dropping the flag and
> its context from now on if I stumble across it, without further
> warnings.

Hey Diego, (not sure if you are on -dev list or not, therefore adding
you to cc)

What is the consensus on if the metadata.xml specifies that it will add
CFLAGS? Surely it is not as black/white as the global suggests..?

local:debug:app-portage/eix: Build with CXXFLAGS/LDFLAGS for debugging
support; not recommended for normal use.

Thanks,
Jeremy
 
Old 07-01-2010, 05:21 AM
Ryan Hill
 
Default debug USE flag misuse

On Wed, 30 Jun 2010 23:25:32 +0000
Jeremy Olexa <darkside@gentoo.org> wrote:

> What is the consensus on if the metadata.xml specifies that it will add
> CFLAGS? Surely it is not as black/white as the global suggests..?
>
> local:debug:app-portage/eix: Build with CXXFLAGS/LDFLAGS for debugging
> support; not recommended for normal use.

USE flags should not affect CFLAGS unless there is a very good reason. This
isn't a very good reason (same goes for its optimization and
strong-optimization flags).

I have a half-done compiler flag policy thingy i keep meaning to finish
and post for public thrashing.


--
fonts, gcc-porting, and it's all by design
toolchain, wxwidgets to keep us from losing our minds
@ gentoo.org EFFD 380E 047A 4B51 D2BD C64F 8AA8 8346 F9A4 0662
 
Old 07-01-2010, 12:53 PM
Vaeth
 
Default debug USE flag misuse

(Sorry that this mail does not contain the proper "References:";
I am not a regular reader of this list and therefore cannot "reply").

Ryan Hill <dirtyepic@gentoo.org> wrote:

> USE flags should not affect CFLAGS unless there is a very good reason

A valid reason should be that upstream would prefer to add these flags.

Please note that usually upstream should know best which CFLAGS
to add, because upstream is usually the only instance fully familiar
with all details of the code (at least, upstream _should_ be so ).
In fact, a lot of flags are not only safe to add but really *should*
be added if the code was written with such flags in mind.

For instance, if the code contains no type-punning, -fstrict-aliasing
can be safely added, and it would be a waste of upstream's effort to
possibly avoid type-punning if it is not added in such a case.
Another example is -fmerge-all-constants where usually code is written
having in mind that optimizations due to this flag will happen
(e.g. certain constants are sometimes redundantly repeated in the
source [for convenience or possibly local change] instead of making
sure that they occur only once).

In fact, most CFLAGS are there for a reason (adding them is only
"ricing" if you do it without respecting details of the code).

So who should add the CFLAGS appropriate for a particular package?
The user cannot do it seriously for every package separately (this
option is reasonable only for binary distributions).
Some packages try to force CFLAGS on the user without asking, but
this is not very good, because the user might have a valid reason to
disagree with upstream's decisions. For instance, a flag might be
broken in a particular compiler version.

So the natural thing is to give the user the choice whether to follow
upstream's recommendations or not. And the way of choice in gentoo is
usually done by USE flags. I would consider it very strange if
a _purely political_ decision would forbid convenient choices for
user and upstream.

The debug USE flag in eix is also about convenience for the user:
If eix segfaults, it prints instructions how to produce a backtrace
in such a way which is most likely useful for upstream to locate
the problem.
Currently, these instructions are rather simple, because they can
refer to USE=debug. Omitting the debug USE flag would complicate
the instructions, making debugging less convenient for the user
and for upstream. Why should such an inconvenience be necessary?
Only to follow some abstract fundamental policy about what USE flags
are allowed to do? If this is really the case then perhaps there is
something wrong with that policy.

To avoid a misunderstanding: For packages for which upstream has no
particular preference for the CFLAGS, I agree that it would be very
strange to add CFLAGS by means of a USE flag. But if there _is_ such
a recommendation, I would not like to see it ignored in Gentoo
just for political reasons.

Best Regards
Martin Vńth
 
Old 07-01-2010, 06:40 PM
Mike Frysinger
 
Default debug USE flag misuse

On Thursday, July 01, 2010 08:53:19 Vaeth wrote:
> The debug USE flag in eix is also about convenience for the user:
> If eix segfaults, it prints instructions how to produce a backtrace
> in such a way which is most likely useful for upstream to locate
> the problem.
> Currently, these instructions are rather simple, because they can
> refer to USE=debug. Omitting the debug USE flag would complicate
> the instructions, making debugging less convenient for the user
> and for upstream. Why should such an inconvenience be necessary?
> Only to follow some abstract fundamental policy about what USE flags
> are allowed to do? If this is really the case then perhaps there is
> something wrong with that policy.

this is in no way specific to eix. if you want convenience, design a real
solution common to *all* packages and post it to the list.
arbitrary/inconsistent hacks utilizing USE=debug is wrong.
-mike
 
Old 07-01-2010, 08:00 PM
Ryan Hill
 
Default debug USE flag misuse

On Thu, 1 Jul 2010 14:53:19 +0200 (CEST)
Vaeth <vaeth@mathematik.uni-wuerzburg.de> wrote:

> (Sorry that this mail does not contain the proper "References:";
> I am not a regular reader of this list and therefore cannot "reply").
>
> Ryan Hill <dirtyepic@gentoo.org> wrote:
>
> > USE flags should not affect CFLAGS unless there is a very good reason
>
> A valid reason should be that upstream would prefer to add these flags.
>
> Please note that usually upstream should know best which CFLAGS
> to add, because upstream is usually the only instance fully familiar
> with all details of the code (at least, upstream _should_ be so ).
> In fact, a lot of flags are not only safe to add but really *should*
> be added if the code was written with such flags in mind.
>
> [...]

Upstream is free to use whatever CFLAGS they see fit, as long as the user has
the option of disabling them. This is simply done by appending the user's
CFLAGS to those of the build system. But this has nothing to do with USE
flags.

> So the natural thing is to give the user the choice whether to follow
> upstream's recommendations or not. And the way of choice in gentoo is
> usually done by USE flags.

USE flags control package options - whether to include support for foo,
install extra documentation, build against either of lib-a or lib-b, etc.
They should not affect compiler flags. Some exceptions are pch, profiling,
and critical packages that really, really should be built with upstream's
compiler flags but then people whine so much about "Gentoo being about choice"
that someone adds a "custom-cflags" USE.

The way to control compiler flags in Gentoo is CFLAGS.

> The debug USE flag in eix is also about convenience for the user:
> If eix segfaults, it prints instructions how to produce a backtrace
> in such a way which is most likely useful for upstream to locate
> the problem.
> Currently, these instructions are rather simple, because they can
> refer to USE=debug. Omitting the debug USE flag would complicate
> the instructions, making debugging less convenient for the user
> and for upstream. Why should such an inconvenience be necessary?

If all --enable-debug does is add -g to CFLAGS, why can't you just say that?
Or maybe point them to http://www.gentoo.org/proj/en/qa/backtraces.xml?

If --enable-debug does more than that then having a debug USE flag is
perfectly fine. I don't have a problem with --enable-debug adding -g as well
as (eg.) enabling assertions because if you're using USE="debug" you're
probably using -g already.

> To avoid a misunderstanding: For packages for which upstream has no
> particular preference for the CFLAGS, I agree that it would be very
> strange to add CFLAGS by means of a USE flag. But if there _is_ such
> a recommendation, I would not like to see it ignored in Gentoo
> just for political reasons.

Again, we're not ignoring CFLAGS and we're not doing this for abstract or
political reasons. This simply isn't what the debug USE flag is for.


--
fonts, gcc-porting, and it's all by design
toolchain, wxwidgets to keep us from losing our minds
@ gentoo.org EFFD 380E 047A 4B51 D2BD C64F 8AA8 8346 F9A4 0662
 
Old 07-01-2010, 08:04 PM
Nikos Chantziaras
 
Default debug USE flag misuse

On 07/01/2010 11:00 PM, Ryan Hill wrote:

[...]
The way to control compiler flags in Gentoo is CFLAGS.


That is true. However, there's a problem; you can control package
options of individual packages with USE flags, but you can't control
compilation switches of individual packages with CFLAGS. This will
naturally make people feel like using USE flags to modify compilation
options is a good idea.


Surely, one has to sympathize with this mindset even though it's a wrong
thing to do.
 
Old 07-01-2010, 08:21 PM
Alec Warner
 
Default debug USE flag misuse

On Thu, Jul 1, 2010 at 1:04 PM, Nikos Chantziaras <realnc@arcor.de> wrote:
> On 07/01/2010 11:00 PM, Ryan Hill wrote:
>>
>> [...]
>> The way to control compiler flags in Gentoo is CFLAGS.
>
> That is true. *However, there's a problem; you can control package options
> of individual packages with USE flags, but you can't control compilation
> switches of individual packages with CFLAGS. *This will naturally make
> people feel like using USE flags to modify compilation options is a good
> idea.

If you use portage than you can control per-package CFLAGS using
bashrc and /etc/portage/env or similar functionality. I am unsure if
other package managers support this behavior or not.

-A

>
> Surely, one has to sympathize with this mindset even though it's a wrong
> thing to do.
>
>
>
 

Thread Tools




All times are GMT. The time now is 02:38 AM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright ę2007 - 2008, www.linux-archive.org