Bug 1787088 - Regression in brp-mangle-shebangs after changes in 144-1
Summary: Regression in brp-mangle-shebangs after changes in 144-1
Keywords:
Status: CLOSED EOL
Alias: None
Product: Fedora
Classification: Fedora
Component: redhat-rpm-config
Version: 32
Hardware: x86_64
OS: Linux
unspecified
unspecified
Target Milestone: ---
Assignee: Florian Festi
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2019-12-30 22:29 UTC by Michael Cronenworth
Modified: 2021-05-25 15:14 UTC (History)
14 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2021-05-25 15:14:58 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)
rawhide output (1.83 KB, text/plain)
2019-12-31 17:20 UTC, Michael Cronenworth
no flags Details
Fix. (759 bytes, patch)
2019-12-31 19:38 UTC, Jan Kratochvil
no flags Details | Diff

Description Michael Cronenworth 2019-12-30 22:29:49 UTC
Description of problem:

I'm building Kodi in RPMFusion and encountering a failure in the 'brp-mangle-shebangs' script.

Fedora 31 and lower successfully run the script.

Starting with the changes in version 144-1 the script is failing with no output.


Version-Release number of selected component (if applicable):
redhat-rpm-config-146-1.fc32.noarch


How reproducible: Always


Actual results:
[mockbuild@d2e1f9b641fc4411963e18f3a5e11f6a BUILDROOT]$ RPM_BUILD_ROOT=/builddir/build/BUILDROOT/kodi-18.5-1.fc32.x86_64 /usr/lib/rpm/redhat/brp-mangle-shebangs ; echo $?
1

Expected results:
[mockbuild@d2e1f9b641fc4411963e18f3a5e11f6a BUILDROOT]$ RPM_BUILD_ROOT=/builddir/build/BUILDROOT/kodi-18.5-1.fc32.x86_64 /usr/lib/rpm/redhat/brp-mangle-shebangs ; echo $?
0

Additional info:

Rawhide Build Output:
+ /usr/lib/rpm/check-buildroot
+ /usr/lib/rpm/redhat/brp-ldconfig
+ /usr/lib/rpm/brp-compress
+ /usr/lib/rpm/brp-strip-static-archive /usr/bin/strip
+ /usr/lib/rpm/redhat/brp-python-bytecompile /usr/bin/python 1 0
Bytecompiling .py files below /builddir/build/BUILDROOT/kodi-18.5-1.fc32.x86_64/usr/lib/python3.8 using /usr/bin/python3.8
+ /usr/lib/rpm/brp-python-hardlink
+ /usr/lib/rpm/redhat/brp-mangle-shebangs
error: Bad exit status from /var/tmp/rpm-tmp.TM5v5v (%install)


RPM build errors:
    Bad exit status from /var/tmp/rpm-tmp.TM5v5v (%install)

[mockbuild@d2e1f9b641fc4411963e18f3a5e11f6a BUILDROOT]$ RPM_BUILD_ROOT=/builddir/build/BUILDROOT/kodi-18.5-1.fc32.x86_64 /usr/lib/rpm/redhat/brp-mangle-shebangs ; echo $?
1


If I run the version from Fedora 31 and below (142-1) the script runs successfully with some WARNING output.

[mockbuild@d2e1f9b641fc4411963e18f3a5e11f6a BUILDROOT]$ RPM_BUILD_ROOT=/builddir/build/BUILDROOT/kodi-18.5-1.fc32.x86_64 /builddir/build/brp-mangle-shebangs ; echo $?
...
*** WARNING: ./usr/lib/python3.8/site-packages/kodi/bt/hid.py is executable but has empty or no shebang, removing executable bit
...
0

Running the Rawhide version 144-1 on the now modified BUILDROOT now runs successfully...

[mockbuild@d2e1f9b641fc4411963e18f3a5e11f6a BUILDROOT]$ RPM_BUILD_ROOT=/builddir/build/BUILDROOT/kodi-18.5-1.fc32.x86_64 /usr/lib/rpm/redhat/brp-mangle-shebangs ; echo $?
0

Comment 1 Jan Kratochvil 2019-12-31 08:35:20 UTC
It would be good to provide a reproducer - such as the buildroot or its .src.rpm.
You can also try to add -x option to see the last failing command:
  RPM_BUILD_ROOT=/builddir/build/BUILDROOT/kodi-18.5-1.fc32.x86_64 bash -eux /usr/lib/rpm/redhat/brp-mangle-shebangs ; echo $?
Or just add -x to the first line of: /usr/lib/rpm/redhat/brp-mangle-shebangs

Comment 2 Michael Cronenworth 2019-12-31 17:20:55 UTC
Created attachment 1648905 [details]
rawhide output

I'm attaching the output of a script run on an unmodified BUILDROOT.

The file the script stops on has only one line of text content with no newline.

$ cat /builddir/build/BUILDROOT/kodi-18.5-1.fc32.x86_64/usr/lib/python3.8/site-packages/kodi/defs.py
ICON_PATH="usr/share/pixmaps/kodi/"

Comment 3 Michael Cronenworth 2019-12-31 17:25:00 UTC
If you're interested in the .src.rpm you can grab one from here: http://koji.rpmfusion.org/kojifiles/work/tasks/6535/376535/kodi-18.5-1.fc32.src.rpm

FYI: It takes about one hour to compile on a 4C/8T 4GHz x86_64 system.

Comment 4 Jan Kratochvil 2019-12-31 19:38:35 UTC
Created attachment 1648967 [details]
Fix.

That is 22m28s here on 16C/32T (with clear ccache). :^)

Comment 5 Jan Kratochvil 2019-12-31 19:47:25 UTC
That brp-mangle-shebangs should be really fixed to report the broken file without just silently aborting.

Comment 6 Michael Cronenworth 2019-12-31 20:36:26 UTC
Yes, that is what the previous version of the brp-mangle-shebangs script did.

...
*** WARNING: ./usr/lib/python2.7/site-packages/kodi/defs.py is executable but has empty or no shebang, removing executable bit
...

Comment 7 Jan Kratochvil 2019-12-31 21:34:23 UTC
I mean the bug is that the file has no trailing newline.  Whether there is really a shebang or not is not a topic for this Bug.

This change:
redhat-rpm-config-142-1.fc31.noarch
  read shebang_line < "$f" || :
redhat-rpm-config-146-1.fc32.noarch
  read shebang_line < "$f"

It is due to Denys Vlasenko's:
  brp-mangle-shebangs: fix unsafe/incorrect command expansion
  https://src.fedoraproject.org/rpms/redhat-rpm-config/c/618362d6fbb29127e443d45187ddc1be102350bb

Comment 8 Iñaki Ucar 2020-02-02 12:50:44 UTC
Any news on this regression? This is affecting many packages in a Copr I maintain, because they contain some data files without a new line.

Comment 9 Ben Cotton 2020-02-11 17:20:40 UTC
This bug appears to have been reported against 'rawhide' during the Fedora 32 development cycle.
Changing version to 32.

Comment 10 Bastien Nocera 2020-03-24 14:05:38 UTC
(In reply to Michael Cronenworth from comment #6)
> Yes, that is what the previous version of the brp-mangle-shebangs script did.
> 
> ...
> *** WARNING: ./usr/lib/python2.7/site-packages/kodi/defs.py is executable
> but has empty or no shebang, removing executable bit
> ...

The lack of error reporting made me think that it was a problem on my system, wasted about an hour on this...

I've added "-x" to the flags at the top of the /usr/lib/rpm/redhat/brp-mangle-shebangs script to find what the problems were in my package.

Comment 11 Fedora Program Management 2021-04-29 16:01:28 UTC
This message is a reminder that Fedora 32 is nearing its end of life.
Fedora will stop maintaining and issuing updates for Fedora 32 on 2021-05-25.
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
Fedora 'version' of '32'.

Package Maintainer: If you wish for this bug to remain open because you
plan to fix it in a currently maintained version, simply change the 'version' 
to a later Fedora version.

Thank you for reporting this issue and we are sorry that we were not 
able to fix it before Fedora 32 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, you are encouraged  change the 'version' to a later Fedora 
version prior this bug is closed as described in the policy above.

Although we aim to fix as many bugs as possible during every release's 
lifetime, sometimes those efforts are overtaken by events. Often a 
more recent Fedora release includes newer upstream software that fixes 
bugs or makes them obsolete.

Comment 12 Ben Cotton 2021-05-25 15:14:58 UTC
Fedora 32 changed to end-of-life (EOL) status on 2021-05-25. Fedora 32 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 please feel free to reopen this bug against that version. If you
are unable to reopen this bug, please file a new report against the
current release. If you experience problems, please add a comment to this
bug.

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


Note You need to log in before you can comment on or make changes to this bug.