Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
emerge output (stderr/stdout?)
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Installing Gentoo
View previous topic :: View next topic  
Author Message
josephg
l33t
l33t


Joined: 10 Jan 2016
Posts: 783
Location: usually offline

PostPosted: Fri Jan 15, 2016 3:43 am    Post subject: emerge output (stderr/stdout?) Reply with quote

i am not patient enough to keep watching the emerge output scroll past. however, i do want to see any errors/warnings. is there some way i could hide all compile output but the errors/warnings?

something like the shell stdout and stderr. i did try emerge --ask --tree {packagename} >/dev/null
but then i don't get to see any of the prompts before the compile starts.
Back to top
View user's profile Send private message
Irre
Guru
Guru


Joined: 09 Nov 2013
Posts: 340
Location: Stockholm

PostPosted: Fri Jan 15, 2016 8:03 am    Post subject: Reply with quote

This way:

emerge xxxxxxxx 2>error.log

No I'm wrong. You must see the output in order to answer questions. :?
Back to top
View user's profile Send private message
Syl20
Guru
Guru


Joined: 04 Aug 2005
Posts: 564
Location: France

PostPosted: Fri Jan 15, 2016 11:04 am    Post subject: Reply with quote

This will display the output of your command, _and_ write it to a file :
Code:
# emerge <your_stuff> 2>&1 | tee file.log


Then, grep is your friend. :wink:

Another way is using the elog capabilities (I persist using the very old enotice tool, but the difference is essentially cosmetic, I think).
I also notice that emerge shows now a recap of some errors encoutered when working, at the end.
Back to top
View user's profile Send private message
khayyam
Watchman
Watchman


Joined: 07 Jun 2012
Posts: 6228
Location: Room 101

PostPosted: Fri Jan 15, 2016 1:54 pm    Post subject: Re: emerge output (stderr/stdout?) Reply with quote

josephg wrote:
i am not patient enough to keep watching the emerge output scroll past. however, i do want to see any errors/warnings. is there some way i could hide all compile output but the errors/warnings? something like the shell stdout and stderr. i did try emerge --ask --tree {packagename} >/dev/null but then i don't get to see any of the prompts before the compile starts.

josephg ... you can't have both, redirection doesn't work that way ...

Code:
% echo "output" > /dev/null
% echo "output" 1> /dev/null
% echo "output" 2> /dev/null
output
% foobar 2> /dev/null
% foobar 1> /dev/null
zsh: command not found: foobar
% foobar 2> $(tty) > /dev/null
zsh: command not found: foobar

... so, if you redirect stdout then you won't get the '--ask' prompt emerge prints to stdout.

As far as getting (only) "errors/warnings" is concerned, you mean "errors/warnings" from portage, or -Werror, -Wall, etc? If the former then you can look at '--quiet=y,-q' or '--quiet-build=y' (see 'man emerge').

best ... khay
Back to top
View user's profile Send private message
josephg
l33t
l33t


Joined: 10 Jan 2016
Posts: 783
Location: usually offline

PostPosted: Sun Jan 17, 2016 2:40 pm    Post subject: Reply with quote

perhaps i was not clear.. i want to see the emerge output, but i don't want to see every compile output line unless it is an error or warning.
Back to top
View user's profile Send private message
NeddySeagoon
Administrator
Administrator


Joined: 05 Jul 2003
Posts: 43186
Location: 56N 3W

PostPosted: Sun Jan 17, 2016 2:56 pm    Post subject: Reply with quote

josephg,

Try --quiet
_________________
Regards,

NeddySeagoon

Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail.
Back to top
View user's profile Send private message
josephg
l33t
l33t


Joined: 10 Jan 2016
Posts: 783
Location: usually offline

PostPosted: Sun Jan 17, 2016 3:29 pm    Post subject: Reply with quote

thank you neddy, this is sweet :) so much better!

can i add --quiet to make.conf or somewhere else?

i keep forgetting to type --quiet. i would rather type --verbose or something like that, when i want to see lots of lines scrolling past :)
Back to top
View user's profile Send private message
NeddySeagoon
Administrator
Administrator


Joined: 05 Jul 2003
Posts: 43186
Location: 56N 3W

PostPosted: Sun Jan 17, 2016 3:36 pm    Post subject: Reply with quote

josephg,

Yes, you can add any portage options you like as defaults in make.conf.
The variable is EMERGE_DEFAULT_OPTS

-- edit --

I tend to use --jobs= which implies --quiet.
_________________
Regards,

NeddySeagoon

Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail.
Back to top
View user's profile Send private message
josephg
l33t
l33t


Joined: 10 Jan 2016
Posts: 783
Location: usually offline

PostPosted: Sun Jan 17, 2016 3:48 pm    Post subject: Reply with quote

NeddySeagoon wrote:
Yes, you can add any portage options you like as defaults in make.conf.
The variable is EMERGE_DEFAULT_OPTS


i didn't see that variable listed in my make.conf. i will add it, as there are some options which i want to use everytime, like --ask, --tree, and now --quiet.

may i ask what are the options you and others have in make.conf, and/or use regularly?

NeddySeagoon wrote:
I tend to use --jobs= which implies --quiet.

i have --jobs= in MAKEOPTS. i presume that is not what you are talking about?
Back to top
View user's profile Send private message
josephg
l33t
l33t


Joined: 10 Jan 2016
Posts: 783
Location: usually offline

PostPosted: Sun Jan 17, 2016 3:53 pm    Post subject: Reply with quote

Code:
$ man emerge
-j [JOBS], --jobs[=JOBS]
              Specifies the number of packages to build simultaneously. If this option is given without an argument, emerge will not limit the number of jobs that can run simul‐
              taneously. Also see the related --load-average option.  Similarly to the --quiet-build option, the --jobs option causes all build output to be redirected to  logs.
              Note that interactive packages currently force a setting of --jobs=1. This issue can be temporarily avoided by specifying --accept-properties=-interactive.


"emerge will not limit the number of jobs that can run simultaneously"
why would you restrict it with "--jobs="?

"interactive packages currently force a setting of --jobs=1"
then, i don't see the purpose of even specifying this variable.
Back to top
View user's profile Send private message
NeddySeagoon
Administrator
Administrator


Joined: 05 Jul 2003
Posts: 43186
Location: 56N 3W

PostPosted: Sun Jan 17, 2016 4:10 pm    Post subject: Reply with quote

josephg,

There are jobs at two different levels.

MAKEOPTS is a list of options to pass to make, which builds individual packages.
Its -j option tells how many things its allowed to do concurrently. -j with no limit, means no limit.
Don't do that. You will need to pull the plug out to regain control.

EMERGE_DEFAULT_OPTS --jobs is passed to portage. It tells portage how many packages it can build concurrently if dependancies allow.
Each of these packages building at the same time are allowed MAKEOPTS concurrent tasks.

e.g.
Code:
MAKEOPTS="-j8"
EMERGE_DEFAULT_OPTS="--jobs=2"

Allows portage to build two packages concurrently, each of which can run eight instances of gcc or whatever.

There are lots of variables not present in the default make.conf. Some are left unset. Some have defaults from your profile.
Code:
emerge --info
will list your current settings.
_________________
Regards,

NeddySeagoon

Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail.
Back to top
View user's profile Send private message
josephg
l33t
l33t


Joined: 10 Jan 2016
Posts: 783
Location: usually offline

PostPosted: Sun Jan 17, 2016 4:36 pm    Post subject: Reply with quote

NeddySeagoon wrote:
e.g.
Code:
MAKEOPTS="-j8"
EMERGE_DEFAULT_OPTS="--jobs=2"

Allows portage to build two packages concurrently, each of which can run eight instances of gcc or whatever.


sorry i'm just trying to understand.. wouldn't that overload my cpus?
if we run 2 simultaneous jobs per cpu (MAKEOPTS="-j8" assuming yours is quad-core) to max them out! and then you run two simultaneous emerges, wouldn't that just double the load there without increasing any efficiency??

NeddySeagoon wrote:
There are lots of variables not present in the default make.conf. Some are left unset. Some have defaults from your profile.
Code:
emerge --info
will list your current settings.


Code:
$ $ emerge --info | grep EMERGE
Unset:  CC, CPPFLAGS, CTARGET, CXX, EMERGE_DEFAULT_OPTS, INSTALL_MASK, LC_ALL, PORTAGE_BUNZIP2_COMMAND, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS, USE_PYTHON


EMERGE_DEFAULT_OPTS is unset on mine, and has no defaults. have i missed doing something somewhere?
Back to top
View user's profile Send private message
NeddySeagoon
Administrator
Administrator


Joined: 05 Jul 2003
Posts: 43186
Location: 56N 3W

PostPosted: Sun Jan 17, 2016 4:51 pm    Post subject: Reply with quote

josephg,

Correct on all counts. You have not missed anything.

As regards overloading CPUs, make deals with a lot of small files, so it may be waiting for disk accesses.
If you want to keep your CPU load within bounds, there is another portage parameter --load-average

You are not missing anything, EMERGE_DEFAULT_OPTS is empty by default.
emerge just does what it is told on the command line.
_________________
Regards,

NeddySeagoon

Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail.
Back to top
View user's profile Send private message
khayyam
Watchman
Watchman


Joined: 07 Jun 2012
Posts: 6228
Location: Room 101

PostPosted: Sun Jan 17, 2016 5:20 pm    Post subject: Reply with quote

khayyam wrote:
As far as getting (only) "errors/warnings" is concerned, you mean "errors/warnings" from portage, or -Werror, -Wall, etc? If the former then you can look at '--quiet=y,-q' or '--quiet-build=y' (see 'man emerge').

josephg wrote:
perhaps i was not clear.. i want to see the emerge output, but i don't want to see every compile output line unless it is an error or warning.

NeddySeagoon wrote:
Try --quiet

josephg wrote:
thank you neddy, this is sweet :) so much better!

josephg ... with '--quiet=y' you won't see compile 'errors/warnings' ... unless the build dies, that is why I asked what sort of errors/warning's you're trying to suppress ... and suggested '--quiet'.

best ... khay
Back to top
View user's profile Send private message
josephg
l33t
l33t


Joined: 10 Jan 2016
Posts: 783
Location: usually offline

PostPosted: Sun Jan 17, 2016 5:37 pm    Post subject: Reply with quote

khayyam wrote:
khayyam wrote:
As far as getting (only) "errors/warnings" is concerned, you mean "errors/warnings" from portage, or -Werror, -Wall, etc? If the former then you can look at '--quiet=y,-q' or '--quiet-build=y' (see 'man emerge').

josephg wrote:
perhaps i was not clear.. i want to see the emerge output, but i don't want to see every compile output line unless it is an error or warning.

NeddySeagoon wrote:
Try --quiet

josephg wrote:
thank you neddy, this is sweet :) so much better!

josephg ... with '--quiet=y' you won't see compile 'errors/warnings' ... unless the build dies, that is why I asked what sort of errors/warning's you're trying to suppress ... and suggested '--quiet'.


uh oh i *do* want to see errors/warnings! i was so happy i didn't see anything, i assumed everything compiled clean. thank you khay.. i didn't understand "portage or -Werror or -Wall etc".

i assume emerge calls make to compile. i don't know what else it calls. so to clarify again, i want to see emerge output, but i only want to see make errors/warnings.
Back to top
View user's profile Send private message
josephg
l33t
l33t


Joined: 10 Jan 2016
Posts: 783
Location: usually offline

PostPosted: Sun Jan 17, 2016 5:41 pm    Post subject: Reply with quote

Code:
$ man emerge

--quiet [ y | n ] (-q short option)
              Results may vary, but the general outcome is a reduced or condensed output from portage's displays.

--quiet-build [ y | n ]
              Redirect all build output to logs alone, and do not display it on stdout. If a build failure occurs for a single package, the build log will be automatically  dis‐
              played  on  stdout (unless the --quiet-fail option is enabled). If there are multiple build failures (due to options like --keep-going or --jobs), then the content
              of the log files will not be displayed, and instead the paths of the log files will be displayed together with the corresponding die messages.  Note that  interac‐
              tive  packages  currently  force  all build output to be displayed on stdout. This issue can be temporarily avoided by specifying --accept-properties=-interactive.
              Further, note that disabling --quiet-build has no effect if --jobs is set to anything higher than 1.


i wonder if i'm looking for --quiet-build=y
Back to top
View user's profile Send private message
khayyam
Watchman
Watchman


Joined: 07 Jun 2012
Posts: 6228
Location: Room 101

PostPosted: Sun Jan 17, 2016 6:09 pm    Post subject: Reply with quote

josephg wrote:
uh oh i *do* want to see errors/warnings! i was so happy i didn't see anything, i assumed everything compiled clean. thank you khay.. i didn't understand "portage or -Werror or -Wall etc". i assume emerge calls make to compile. i don't know what else it calls. so to clarify again, i want to see emerge output, but i only want to see make errors/warnings.

josephg ... as far as I know, that isn't possible.

best ... khay
Back to top
View user's profile Send private message
NeddySeagoon
Administrator
Administrator


Joined: 05 Jul 2003
Posts: 43186
Location: 56N 3W

PostPosted: Sun Jan 17, 2016 9:30 pm    Post subject: Reply with quote

josephg,

With --quiet, you will see all the informational and errors at the end of the emerge.
If there is an error, emerge will stop anyway ... unless you used --keep-going.
--keep-going drops the failed package and recalculates what it can do from the remaining packages of the emerge.

You still get pointers to logs of screen messages, errors and so on when the emerge ends.

Its unlikely you want compiler warnings unless you intend to fix the upstream code. Then you only build the package of interest.
Are you really going to stop an emerge for a compiler warning?

emerge is designed to run unattended and save everything you need to know.
_________________
Regards,

NeddySeagoon

Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail.
Back to top
View user's profile Send private message
josephg
l33t
l33t


Joined: 10 Jan 2016
Posts: 783
Location: usually offline

PostPosted: Wed Jan 20, 2016 1:30 pm    Post subject: Reply with quote

thank you folks.. that is helpful.

i still feel a bit confused using --quiet and --verbose together.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Installing Gentoo All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum