Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 512920 - sys-apps/portage: PORT_LOGDIR setting is incoherent
Summary: sys-apps/portage: PORT_LOGDIR setting is incoherent
Status: CONFIRMED
Alias: None
Product: Portage Development
Classification: Unclassified
Component: Core - Configuration (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Portage team
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-06-11 00:33 UTC by Patrick Lauer
Modified: 2014-06-12 11:24 UTC (History)
1 user (show)

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Patrick Lauer gentoo-dev 2014-06-11 00:33:37 UTC
If one enables PORTAGE_ELOG_SYSTEM="save" the default settings will never produce a full build log. Instead only all elog messages will be saved, and the user will be very confused.

If one sets PORT_LOGDIR (which has a default value where the elog files end up) to any valid path the logfiles created at this path will be proper full build logs. 

But, because it has a valid default value no one will ever figure this out, leading to lots of extreme confusion - especially as other logger modules like email will work as expected.

I suggest making the default action for writing logs actually write logs, instead of this quantum superposition :)
Comment 1 Martin Väth 2014-06-12 00:12:53 UTC
PORTAGE_ELOG* is for saving elogs: why should this surprise the user?
It is exactly documented this way:
"PORTAGE_ELOG_SYSTEM: selects the module(s) to process the log messages"
(Note: "log messages" not "build logs").
This becomes even clearer if you read the explanation for PORTAGE_ELOG_CLASSES where you can select the type of message you want to log with PORTAGE_ELOG.

PORT_LOGDIR, in contrast, is the mechanism for saving full logs - which is well documented.

PORT_LOGDIR is empty by default - it is not true what you say that it has a default. What is true is that PORTAGE_ELOG* uses a default path in case the user wants no build logs.
One might discuss whether one could use e.g. "PORTAGE_ELOG_PATH" instead of $LOGDIR/elog to avoid an apparent relation with the two independent logging mechanisms.

> especially as other logger modules like email will work as expected

Do you mean that PORTAGE_ELOG_SYSTEM=mail mails the build log instead of the elog? If this is the case, this is a bug which should be fixed - it completely contradicts what PORTAGE_ELOG* is supposed to do and also contradicts its description ("send all messages", not: "send the full build log").
Comment 2 Patrick Lauer gentoo-dev 2014-06-12 02:46:28 UTC
(In reply to Martin Väth from comment #1)
> PORTAGE_ELOG* is for saving elogs: why should this surprise the user?
> It is exactly documented this way:
> "PORTAGE_ELOG_SYSTEM: selects the module(s) to process the log messages"
> (Note: "log messages" not "build logs").
> This becomes even clearer if you read the explanation for
> PORTAGE_ELOG_CLASSES where you can select the type of message you want to
> log with PORTAGE_ELOG.
> 
> PORT_LOGDIR, in contrast, is the mechanism for saving full logs - which is
> well documented.

I don't understand it - ELOG_CLASSES should select *what* to save, and LOGDIR should select *where* to save.
> 
> PORT_LOGDIR is empty by default - it is not true what you say that it has a
> default. What is true is that PORTAGE_ELOG* uses a default path in case the
> user wants no build logs.
> One might discuss whether one could use e.g. "PORTAGE_ELOG_PATH" instead of
> $LOGDIR/elog to avoid an apparent relation with the two independent logging
> mechanisms.

Well, this implicit default is incoherent - if you want *only* elog saved to /logs you have to set PORT_LOGDIR (why is that var name truncated anyway?)

That also saves build logs, which you might not want - so there's a config setting tied to a path setting, and it's not obvious how it works

> 
> > especially as other logger modules like email will work as expected
> 
> Do you mean that PORTAGE_ELOG_SYSTEM=mail mails the build log instead of the
> elog? If this is the case, this is a bug which should be fixed - it
> completely contradicts what PORTAGE_ELOG* is supposed to do and also
> contradicts its description ("send all messages", not: "send the full build
> log").

Yes, ELOG_SYSTEM="mail" sends the full logs, as expected - it's only "save" that deviates from the principle of least surprises. (And please don't break the mail sending just to get things to behave "the same" now ...)
Comment 3 Martin Väth 2014-06-12 11:24:52 UTC
(In reply to Patrick Lauer from comment #2)
> And please don't break [...]

To avoid any misunderstanding: I am not a portage developer, just a user; to me the documentation in make.conf.example was always completely clear.

The difference is that I never used "mail" which is the one which currently behaves inconsistent and contrary to the documention. Obviously, if one started only with using this "mail" and expects the documentation to explain it, one must misunderstand the documentation:

> I don't understand it - ELOG_CLASSES should select *what* to save,
> and LOGDIR should select *where* to save.

Let me first clarify how I understand how things should behave according to the documentation:

There are two completely independent mechanisms:

1. for elogs/ewarnings/..., i.e. to display/save/mail the messages which the ebuild maintainers want the user to read. This is controlled by the PORTAGE_ELOG* variables.

2. for saving the buildlogs (which you need essentially only in case of build errors). This is controlled by the PORT_LOGDIR variable.

(In particular, it is *not* a typo that here is no "E"LOG in PORT_LOGDIR, since this is the variable for mechanism 2).
In 1. there is no way to configure where "save" will store its messages: It will always be the subdirectory "elog" of $PORT_LOGDIR (with a fallback if you do not use the mechanism 2, i.e. if you have empty PORT_LOGDIR).

The fact that "mail" currently sends the whole build log contradicts the idea of PORTAGE_ELOG* (which was to inform the user about *important* messages which the ebuild maintainers want to send to the user).

Maybe it would be a good idea to fix the "mail" behavior of PORTAGE_ELOG* (and perhaps additionally introduce another variable for sending full elogs, if this is really desired by some users).

Maybe it would also be a good idea to introduce PORTAGE_ELOG_SAVEDIR to set the output of mechanism 1 independent of 2; this would also avoid the confusion.

In any case, it makes sense to keep the two mechanisms separated:
It makes sense to store the elog messages and, display them at the end of portage, and possibly mail them (according to your information, the latter is currently not possible), and *simultaneously* to store the full logs in some (different) directory (or possibly also to mail them which - according to documentation - should not be possible, currently).