classification
Title: make install doesn't seem to support --quiet
Type: enhancement Stage:
Components: Installation Versions: Python 3.10, Python 3.9
process
Status: open Resolution:
Dependencies: Superseder:
Assigned To: Nosy List: chris.jerdonek, iritkatriel, kenahoo
Priority: normal Keywords:

Created on 2017-04-04 22:00 by chris.jerdonek, last changed 2022-01-14 23:05 by iritkatriel.

Messages (5)
msg291143 - (view) Author: Chris Jerdonek (chris.jerdonek) * (Python committer) Date: 2017-04-04 22:00
When installing from source, the --quiet option works with "configure" and a bare "make":

    $ ./configure --quiet
    $ make --quiet

However, it doesn't seem to work when passed to "make install" (and "make altinstall", etc). I tried a number of variations like:

    $ make --quiet install
    $ make install --quiet
    etc.

The install output is quite verbose, so it would be useful to support --quiet. This should still allow warnings, etc, through like it does for configure and bare make.
msg409941 - (view) Author: Ken Williams (kenahoo) * Date: 2022-01-06 23:50
This situation still seems to be the case in 2022.  The output of `make altinstall` has thousands of lines like

/usr/bin/install -c -m 644 ./Lib/test/__main__.py /usr/local/lib/python3.8/test
/usr/bin/install -c -m 644 ./Lib/test/_test_multiprocessing.py /usr/local/lib/python3.8/test
/usr/bin/install -c -m 644 ./Lib/test/allsans.pem /usr/local/lib/python3.8/test
/usr/bin/install -c -m 644 ./Lib/test/ann_module.py /usr/local/lib/python3.8/test
/usr/bin/install -c -m 644 ./Lib/test/ann_module2.py /usr/local/lib/python3.8/test
/usr/bin/install -c -m 644 ./Lib/test/ann_module3.py /usr/local/lib/python3.8/test

and

changing mode of /usr/local/lib/python3.8/lib-dynload/_sysconfigdata__linux_x86_64-linux-gnu.py to 644
changing mode of /usr/local/lib/python3.8/lib-dynload/_sqlite3.cpython-38-x86_64-linux-gnu.so to 755
changing mode of /usr/local/lib/python3.8/lib-dynload/array.cpython-38-x86_64-linux-gnu.so to 755
changing mode of /usr/local/lib/python3.8/lib-dynload/_posixshmem.cpython-38-x86_64-linux-gnu.so to 755
changing mode of /usr/local/lib/python3.8/lib-dynload/_testmultiphase.cpython-38-x86_64-linux-gnu.so to 755
changing mode of /usr/local/lib/python3.8/lib-dynload/_codecs_cn.cpython-38-x86_64-linux-gnu.so to 755

and

Compiling '/usr/local/lib/python3.7/test/test_file.py'...
Compiling '/usr/local/lib/python3.7/test/test_file_eintr.py'...
Compiling '/usr/local/lib/python3.7/test/test_filecmp.py'...
Compiling '/usr/local/lib/python3.7/test/test_fileinput.py'...
Compiling '/usr/local/lib/python3.7/test/test_fileio.py'...
Compiling '/usr/local/lib/python3.7/test/test_finalization.py'...
Compiling '/usr/local/lib/python3.7/test/test_float.py'...
Compiling '/usr/local/lib/python3.7/test/test_flufl.py'...

For me, the problem this causes is that CI build logs get extremely long, so long that my CI build tools won't show the log in the browser anymore and it makes it quite hard to figure out where problems are happening.

It looks like the problem is simply that there are lots of `echo` statements in the Makefile.pre.in that could be conditioned on `--quiet`.  One small example (in the 'libinstall' target):


    if test -x $$i; then \
        echo $(INSTALL_SCRIPT) $$i $$b; \
        $(INSTALL_SCRIPT) $$i $(DESTDIR)$$b; \
    else \
        echo $(INSTALL_DATA) $$i $$b; \
        $(INSTALL_DATA) $$i $(DESTDIR)$$b; \

I don't quite understand how `--quiet` actually gets parsed and recognized by the Makefile, though.
msg409944 - (view) Author: Ken Williams (kenahoo) * Date: 2022-01-07 00:06
I poked around a bit more, and it looks like a fair number of the installation messages are coming from `Lib/distutils/command/build_scripts.py`, which is using `distutils.log` to show what it's doing:

      log.debug("not copying %s (up-to-date)", script)
...
      log.info("copying and adjusting %s -> %s", script,
               self.build_dir)
...
      log.info("changing mode of %s", file)
...
      log.info("changing mode of %s from %o to %o",
               file, oldmode, newmode)

What I don't see is a way to change the log level, but if that were possible then I assume that's how `--quiet` could be achieved here.
msg410584 - (view) Author: Irit Katriel (iritkatriel) * (Python committer) Date: 2022-01-14 18:33
Ken, the output you posted is for 3.7 and 3.8. Is this reproducible on 3.9+? (3.8 and lower are no longer maintained).
msg410606 - (view) Author: Ken Williams (kenahoo) * Date: 2022-01-14 22:50
Thanks Irit - yes, the behavior with 3.9 and 3.10 is the same, and their Makefiles seem to have the same unguarded `echo` statements emitting the output.
History
Date User Action Args
2022-01-14 23:05:36iritkatrielsetversions: - Python 3.6, Python 3.7, Python 3.8, Python 3.11
2022-01-14 22:50:05kenahoosetmessages: + msg410606
2022-01-14 18:33:52iritkatrielsetnosy: + iritkatriel
messages: + msg410584
2022-01-07 00:06:25kenahoosetmessages: + msg409944
2022-01-06 23:50:51kenahoosetnosy: + kenahoo

messages: + msg409941
versions: + Python 3.7, Python 3.8, Python 3.9, Python 3.10, Python 3.11
2017-04-04 22:00:54chris.jerdonekcreate