From: | Gurjeet Singh <gurjeet(at)singh(dot)im> |
---|---|
To: | PGSQL Hackers <pgsql-hackers(at)postgresql(dot)org> |
Subject: | Cleaner build output when not much has changed |
Date: | 2013-11-26 16:57:45 |
Message-ID: | CABwTF4WsuH-+6E45W3Of_ZaMRZE3x_rq6UR=g-JGFKR+f6ETyw@mail.gmail.com |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-hackers |
I was looking for ways to reduce the noise in Postgres make output,
specifically, I wanted to eliminate the "Nothing to be done for `all' "
messages, since they don't add much value, and just ad to the clutter.
Most of the solutions I have seen propose grepping out the noisy parts. But
one of them proposed adding a .PHONY rule and then adding a no-op command
to a target's recipe. Attached is a small patch to a few makefiles which
helps remove the above mentioned message. Following is a sample output:
...
make[3]: Entering directory
`/home/gurjeet/dev/pgdbuilds/quiet_make/src/bin/initdb'
make -C ../../../src/port all
make[4]: Entering directory
`/home/gurjeet/dev/pgdbuilds/quiet_make/src/port'
make -C ../backend submake-errcodes
make[5]: Entering directory
`/home/gurjeet/dev/pgdbuilds/quiet_make/src/backend'
make[5]: Leaving directory
`/home/gurjeet/dev/pgdbuilds/quiet_make/src/backend'
make[4]: Leaving directory `/home/gurjeet/dev/pgdbuilds/quiet_make/src/port'
make -C ../../../src/common all
make[4]: Entering directory
`/home/gurjeet/dev/pgdbuilds/quiet_make/src/common'
make -C ../backend submake-errcodes
make[5]: Entering directory
`/home/gurjeet/dev/pgdbuilds/quiet_make/src/backend'
make[5]: Leaving directory
`/home/gurjeet/dev/pgdbuilds/quiet_make/src/backend'
make[4]: Leaving directory
`/home/gurjeet/dev/pgdbuilds/quiet_make/src/common'
make[3]: Leaving directory
`/home/gurjeet/dev/pgdbuilds/quiet_make/src/bin/initdb'
make[2]: Leaving directory `/home/gurjeet/dev/pgdbuilds/quiet_make/src/bin'
make -C pl all
make[2]: Entering directory `/home/gurjeet/dev/pgdbuilds/quiet_make/src/pl'
...
The noise can be further reduced by adding the --no-print-directory switch,
which yeilds the following output:
...
make -C ../backend submake-errcodes
make -C psql all
make -C ../../../src/interfaces/libpq all
make -C ../../../src/port all
make -C ../backend submake-errcodes
make -C ../../../src/common all
make -C ../backend submake-errcodes
make -C scripts all
make -C ../../../src/interfaces/libpq all
make -C ../../../src/port all
...
The only downside I see to this patch is that it emits this warning in the
beginning:
GNUmakefile:14: warning: overriding commands for target `all'
src/Makefile.global:29: warning: ignoring old commands for target `all'
This is from the recipe that emits the message "All of PostgreSQL
successfully made. Ready to install."
For really quiet builds one can use the -s switch, but for someone who
wishes to see some kind of progress and also want a cleaner terminal
output, the --no-print-directory switch alone is not enough.
Best regards,
--
Gurjeet Singh http://gurjeet.singh.im/
Attachment | Content-Type | Size |
---|---|---|
quiet_make.patch | text/x-diff | 1.2 KB |
From | Date | Subject | |
---|---|---|---|
Next Message | Alvaro Herrera | 2013-11-26 16:58:04 | Re: Suggestion: Issue warning when calling SET TRANSACTION outside transaction block |
Previous Message | David Johnston | 2013-11-26 16:54:13 | Re: Suggestion: Issue warning when calling SET TRANSACTION outside transaction block |