Bug 2098266

Summary: 'akmods' clobbers leading whitespace (etc.) in log
Product: [Fedora] Fedora Reporter: Bruce Jerrick <bmj001>
Component: akmodsAssignee: Nicolas Chauvet (kwizart) <kwizart>
Status: CLOSED CURRENTRELEASE QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: low Docs Contact:
Priority: unspecified    
Version: 36CC: hdegoede, hobbes1069, kwizart, leigh123linux, negativo17, nicolas.vieville, travier
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2023-05-25 19:33:14 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Attachments:
Description Flags
Patch to preserve whitespace (etc.) in akmods log. none

Description Bruce Jerrick 2022-06-17 19:46:20 UTC
Created attachment 1890973 [details]
Patch to preserve whitespace (etc.) in akmods log.

Description of problem:
When copying the rpmbuild log (from akmodsbuild) to the kmod specific log file,
 leading white space is not preserved (due to the read/echo method used).
As a result, the original indentation is lost, and perhaps most importantly,
 the underlining of error locations by gcc is misaligned.
Additionally, '\' escapes are not preserved by the 'echo' (e.g., "printf '%s\n'"
 comes out "printf '%sn'").

Version-Release number of selected component:
akmods-0.5.7-8.fc36.noarch

How reproducible:
100%

Steps to Reproduce:
1. If necessary, run 'akmods' for a module that has compilation error(s).
   (Most likely to happen when a recent kernel is not supported.)
   For example, with akmod-nvidia-390xx-390.147-3.fc36.x86_64 :
     akmods --akmod nvidia-390xx --kernel 5.18.5-200.fc36.x86_64
2. View the log file in /var/cache/akmods/*/ (the akmodsbuild trace section
   near the end).

Actual results (from the 'akmods' example above):
2022/06/17 04:24:47 akmodsbuild: 202 |                 PCI_DMA_BIDIRECTIONAL);
2022/06/17 04:24:47 akmodsbuild: |                 ^~~~~~~~~~~~~~~~~~~~~

Expected results:
2022/06/17 04:24:47 akmodsbuild:   202 |                 PCI_DMA_BIDIRECTIONAL);
2022/06/17 04:24:47 akmodsbuild:       |                 ^~~~~~~~~~~~~~~~~~~~~

Additional info:
A patch is included as an attachment.  Instead of read/echo to append (it adds a
 timestamp and the program name), the patch uses 'sed'.
(Granted, this invokes another process, but I suspect that is faster on any
 machine with more than one CPU.)
Note: 'akmods' already has a Requires dependency on 'sed'.

Comment 1 Timothée Ravier 2022-06-20 15:44:55 UTC
Can you directly submit this patch in a Pull Request on the akomds repo?
https://src.fedoraproject.org/rpms/akmods
Thanks!

Comment 2 Bruce Jerrick 2022-06-23 05:30:04 UTC
(In reply to Timothée Ravier from comment #1)
> Can you directly submit this patch in a Pull Request on the akomds repo?
> https://src.fedoraproject.org/rpms/akmods
> Thanks!

Sorry, I tried "New Pull request" from that interface, but the closest I got was "Bad Request, Branch master does not exist".

Comment 3 leigh scott 2022-06-23 07:10:40 UTC
(In reply to Bruce Jerrick from comment #2)
> (In reply to Timothée Ravier from comment #1)
> > Can you directly submit this patch in a Pull Request on the akomds repo?
> > https://src.fedoraproject.org/rpms/akmods
> > Thanks!
> 
> Sorry, I tried "New Pull request" from that interface, but the closest I got
> was "Bad Request, Branch master does not exist".

The term master was to racist for the fedora goons, try using 'rawhide' instead :-)

Comment 4 Timothée Ravier 2022-07-13 16:53:21 UTC
I've submitted as https://src.fedoraproject.org/rpms/akmods/pull-request/14. Please test/review. Thanks!

Comment 5 Nicolas Chauvet (kwizart) 2022-10-14 17:37:21 UTC
I've merged the patch in rawhide.

Leaving a little in testing before to backport in branches.

Thanks

Comment 6 Ben Cotton 2023-04-25 18:26:41 UTC
This message is a reminder that Fedora Linux 36 is nearing its end of life.
Fedora will stop maintaining and issuing updates for Fedora Linux 36 on 2023-05-16.
It is Fedora's policy to close all bug reports from releases that are no longer
maintained. At that time this bug will be closed as EOL if it remains open with a
'version' of '36'.

Package Maintainer: If you wish for this bug to remain open because you
plan to fix it in a currently maintained version, change the 'version' 
to a later Fedora Linux version. Note that the version field may be hidden.
Click the "Show advanced fields" button if you do not see it.

Thank you for reporting this issue and we are sorry that we were not 
able to fix it before Fedora Linux 36 is end of life. If you would still like 
to see this bug fixed and are able to reproduce it against a later version 
of Fedora Linux, you are encouraged to change the 'version' to a later version
prior to this bug being closed.

Comment 7 Ludek Smid 2023-05-25 19:33:14 UTC
Fedora Linux 36 entered end-of-life (EOL) status on 2023-05-16.

Fedora Linux 36 is no longer maintained, which means that it
will not receive any further security or bug fix updates. As a result we
are closing this bug.

If you can reproduce this bug against a currently maintained version of Fedora Linux
please feel free to reopen this bug against that version. Note that the version
field may be hidden. Click the "Show advanced fields" button if you do not see
the version field.

If you are unable to reopen this bug, please file a new report against an
active release.

Thank you for reporting this bug and we are sorry it could not be fixed.

Comment 8 Timothée Ravier 2023-07-04 13:15:53 UTC
Fixed by https://src.fedoraproject.org/rpms/akmods/pull-request/14