Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

dnf5: Don't output to a PTY #1261

Merged

Conversation

evan-goode
Copy link
Member

If DNF 5 sees an "interactive" TTY on stdout, it will try to draw progress bars and cause the Mock logs to be garbled: fedora-copr/copr#3040. A simple fix is to have DNF 5 output to a pipe instead of a PTY.

I'm not sure why output is collected via a PTY from yum/dnf (seems to start from commit 99ca2fa), but it's probably no longer needed for DNF 5?

@praiskup
Copy link
Member

praiskup commented Dec 3, 2023

Thank you for the patch!

I'm not sure why output is collected via a PTY from yum/dnf (seems to start from commit 99ca2fa), but it's probably no longer needed for DNF 5?

Seems so. Look like pty was historically needed to get some more output from dnf.

OTOH, with the patch applied the output isn't much better:

Transaction Summary:
 Installing:      152 packages

Total size of inbound packages is 52 MiB. Need to download 52 MiB.
After this operation 180 MiB will be used (install 180 MiB, remove 0 B).
[  1/152] bzip2-0:1.0.8-16.fc39.x86_64  100% | 747.0 KiB/s |  52.3 KiB |  00m00s[  2/152] cpio-0:2.14-5.fc40.x86_64
100% |   1.7 MiB/s | 279.5 KiB |  00m00s[  3/152] coreutils-0:9.4-1.fc40.x86_64 100% |   2.9 MiB/s |   1.1 MiB |
00m00s[  4/152] diffutils-0:3.10-3.fc39.x86_6 100% |   2.1 MiB/s | 398.3 KiB |  00m00s[  5/152]
bash-0:5.2.21-2.fc40.x86_64   100% |   4.0 MiB/s |   1.8 MiB |  00m00s[  6/152] fedora-release-common-0:40-0. 100% |
359.4 KiB/s |  19.8 KiB |  00m00s[  7/152] glibc-minimal-langpack-0:2.38 100% |   1.1 MiB/s |  85.0 KiB |  00m00s[
8/152] grep-0:3.11-5.fc40.x86_64     100% |   2.6 MiB/s | 298.0 KiB |  00m00s[  9/152] findutils-1:4.9.0-6.fc40.x86_
100% |   3.2 MiB/s | 491.5 KiB |  00m00s[ 10/152] gzip-0:1.12-6.fc39.x86_64     100% |   3.2 MiB/s | 165.7 KiB |
00m00s[ 11/152] patch-0:2.7.6-22.fc39.x86_64  100% |   2.9 MiB/s | 125.4 KiB |  00m00s[ 12/152]
redhat-rpm-config-0:271-1.fc4 100% |   1.7 MiB/s |  80.9 KiB |  00m00s[ 13/152] rpm-build-0:4.19.0-3.fc40.x86 100% |
4.5 MiB/s |  78.6 KiB |  00m00s[ 14/152] info-0:7.1-1.fc40.x86_64      100% |   2.2 MiB/s | 184.5 KiB |  00m00s[ 15/152]
sed-0:4.8-14.fc39.x86_64      100% |   5.5 MiB/s | 306.4 KiB |  00m00s[ 16/152] unzip-0:6.0-62.fc39.x86_64    100% |
2.1 MiB/s | 184.4 KiB |  00m00s[ 17/152] which-0:2.21-40.fc39.x86_64   100% | 597.6 KiB/s |  41.8 KiB |  00m00s[ 18/152]
tar-2:1.35-2.fc40.x86_64      100% |   3.3 MiB/s | 863.7 KiB |  00m00s[ 19/152] shadow-utils-2:4.14.0-2.fc40. 100% |
4.4 MiB/s |   1.3 MiB |  00m00s[ 20/152] xz-0:5.4.5-1.fc40.x86_64      100% |   3.5 MiB/s | 556.9 KiB |  00m00s[ 21/152]
gawk-0:5.2.2-2.fc39.x86_64    100% |   4.3 MiB/s |   1.1 MiB |  00m00s[ 22/152] filesystem-0:3.18-6.fc39.x86_ 100% |
3.5 MiB/s |   1.1 MiB |  00m00s[ 23/152] util-linux-0:2.39.2-1.fc40.x8 100% |   3.0 MiB/s |   1.2 MiB |  00m00s[ 24/152]
bzip2-libs-0:1.0.8-16.fc39.x8 100% | 529.8 KiB/s |  41.3 KiB |  00m00s[ 25/152] ncurses-libs-0:6.4-8.20231001 100% |
3.0 MiB/s | 337.9 KiB |  00m00s[ 26/152] gmp-1:6.2.1-5.fc39.x86_64     100% |   2.1 MiB/s | 312.6 KiB |  00m00s[ 27/152]
glibc-0:2.38.9000-26.fc40.x86 100% |   5.0 MiB/s |   2.2 MiB |  00m00s[ 28/152] libacl-0:2.3.1-11.fc40.x86_64 100% |
485.6 KiB/s |  23.8 KiB |  00m00s[ 29/152] libcap-0:2.69-1.fc40.x86_64   100% |   1.7 MiB/s |  83.1 KiB |  00m00s[
30/152] libattr-0:2.5.1-9.fc40.x86_64 100% | 218.9 KiB/s |  17.7 KiB |  00m00s[ 31/152] libselinux-0:3.6-0.rc2.1.fc40
100% |   1.6 MiB/s |  87.6 KiB |  00m00s[ 32/152] fedora-repos-0:40-0.2.noarch  100% | 101.6 KiB/s |   9.3 KiB |
00m00s[ 33/152] coreutils-common-0:9.4-1.fc40 100% |   4.7 MiB/s |   2.1 MiB |  00m00s[ 34/152]
glibc-common-0:2.38.9000-26.f 100% |   3.1 MiB/s | 366.5 KiB |  00m00s[ 35/152] pcre2-0:10.42-2.fc40.x86_64   100% |
1.8 MiB/s | 233.2 KiB |  00m00s[ 36/152] ed-0:1.19-4.fc39.x86_64       100% | 671.4 KiB/s |  78.6 KiB |  00m00s[ 37/152]
openssl-libs-1:3.1.4-1.fc40.x 100% |   5.4 MiB/s |   2.2 MiB |  00m00s[ 38/152] ansible-srpm-macros-0:1-11.fc 100% |
195.3 KiB/s |  20.7 KiB |  00m00s[ 39/152] dwz-0:0.15-3.fc39.x86_64      100% |   2.0 MiB/s | 134.1 KiB |  00m00s[
40/152] efi-srpm-macros-0:5-9.fc39.no 100% | 967.3 KiB/s |  22.2 KiB |  00m00s[ 41/152] file-0:5.45-1.fc40.x86_64
100% |   1.4 MiB/s |  49.2 KiB |  00m00s[ 42/152] forge-srpm-mac

@evan-goode
Copy link
Member Author

Yes, I should have linked this also: rpm-software-management/dnf5#1058 (I mentioned it in fedora-copr/copr#3040). It will hopefully be a quick fix. That issue comes up not just with mock, but in general when piping DNF 5's output.

@praiskup
Copy link
Member

praiskup commented Dec 4, 2023

Otherwise LGTM

@praiskup
Copy link
Member

praiskup commented Dec 4, 2023

It would be nice if you dropped a quick bugfix release-note entry into releng/release-notes-next.

If DNF 5 sees an "interactive" TTY on stdout, it will try to draw
progress bars and cause the Mock logs to be garbled:
fedora-copr/copr#3040. A simple fix is to have
DNF 5 output to a pipe instead of a PTY.

I'm not sure why output is collected via a PTY from yum/dnf (seems to
start from commit 99ca2fa), but it's probably no longer needed
for DNF 5?
@praiskup praiskup force-pushed the evan-goode/dnf5-ugly-logs branch from df855a4 to 26e42d1 Compare December 11, 2023 14:28
@evan-goode
Copy link
Member Author

Looks good, thanks.

@praiskup praiskup merged commit 966b2fb into rpm-software-management:main Dec 12, 2023
16 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants