falkTX / Cadence

Collection of tools useful for audio production
GNU General Public License v2.0
370 stars 81 forks source link

Fix some warnings found during rpm packaging #240

Closed ycollet closed 3 years ago

ycollet commented 5 years ago

Hello, I made a rpm package of Cadence for Fedora 29. During packaging, some interesting warnings were displayed:

*** WARNING: ./usr/share/cadence/templates/LMMS.mmp is executable but has empty or no shebang, removing executable bit
*** WARNING: ./usr/share/cadence/templates/Carla.carxp is executable but has empty or no shebang, removing executable bit
*** WARNING: ./usr/share/cadence/src/ui_settings_jack.py is executable but has empty or no shebang, removing executable bit
*** WARNING: ./usr/share/cadence/src/ui_settings_app.py is executable but has empty or no shebang, removing executable bit
*** WARNING: ./usr/share/cadence/src/ui_render.py is executable but has empty or no shebang, removing executable bit
*** WARNING: ./usr/share/cadence/src/ui_logs.py is executable but has empty or no shebang, removing executable bit
*** WARNING: ./usr/share/cadence/src/ui_claudia_studioname.py is executable but has empty or no shebang, removing executable bit
*** WARNING: ./usr/share/cadence/src/ui_claudia_studiolist.py is executable but has empty or no shebang, removing executable bit
*** WARNING: ./usr/share/cadence/src/ui_claudia_runcustom.py is executable but has empty or no shebang, removing executable bit
*** WARNING: ./usr/share/cadence/src/ui_claudia_projectproperties.py is executable but has empty or no shebang, removing executable bit
*** WARNING: ./usr/share/cadence/src/ui_claudia_projectname.py is executable but has empty or no shebang, removing executable bit
*** WARNING: ./usr/share/cadence/src/ui_claudia_launcher_app.py is executable but has empty or no shebang, removing executable bit
*** WARNING: ./usr/share/cadence/src/ui_claudia_launcher.py is executable but has empty or no shebang, removing executable bit
*** WARNING: ./usr/share/cadence/src/ui_claudia_createroom.py is executable but has empty or no shebang, removing executable bit
*** WARNING: ./usr/share/cadence/src/ui_claudia.py is executable but has empty or no shebang, removing executable bit
*** WARNING: ./usr/share/cadence/src/ui_catia.py is executable but has empty or no shebang, removing executable bit
*** WARNING: ./usr/share/cadence/src/ui_catarina_renameport.py is executable but has empty or no shebang, removing executable bit
*** WARNING: ./usr/share/cadence/src/ui_catarina_renamegroup.py is executable but has empty or no shebang, removing executable bit
*** WARNING: ./usr/share/cadence/src/ui_catarina_removeport.py is executable but has empty or no shebang, removing executable bit
*** WARNING: ./usr/share/cadence/src/ui_catarina_removegroup.py is executable but has empty or no shebang, removing executable bit
*** WARNING: ./usr/share/cadence/src/ui_catarina_disconnectports.py is executable but has empty or no shebang, removing executable bit
*** WARNING: ./usr/share/cadence/src/ui_catarina_connectports.py is executable but has empty or no shebang, removing executable bit
*** WARNING: ./usr/share/cadence/src/ui_catarina_addport.py is executable but has empty or no shebang, removing executable bit
*** WARNING: ./usr/share/cadence/src/ui_catarina_addgroup.py is executable but has empty or no shebang, removing executable bit
*** WARNING: ./usr/share/cadence/src/ui_catarina.py is executable but has empty or no shebang, removing executable bit
*** WARNING: ./usr/share/cadence/src/ui_cadence_tb_pa.py is executable but has empty or no shebang, removing executable bit
*** WARNING: ./usr/share/cadence/src/ui_cadence_tb_jack.py is executable but has empty or no shebang, removing executable bit
*** WARNING: ./usr/share/cadence/src/ui_cadence_tb_alsa.py is executable but has empty or no shebang, removing executable bit
*** WARNING: ./usr/share/cadence/src/ui_cadence_tb_a2j.py is executable but has empty or no shebang, removing executable bit
*** WARNING: ./usr/share/cadence/src/ui_cadence_rwait.py is executable but has empty or no shebang, removing executable bit
*** WARNING: ./usr/share/cadence/src/ui_cadence.py is executable but has empty or no shebang, removing executable bit
mangling shebang in /usr/share/cadence/src/systray.py from /usr/bin/env python3 to #!/usr/bin/python3
mangling shebang in /usr/share/cadence/src/shared_settings.py from /usr/bin/env python3 to #!/usr/bin/python3
mangling shebang in /usr/share/cadence/src/shared_canvasjack.py from /usr/bin/env python3 to #!/usr/bin/python3
mangling shebang in /usr/share/cadence/src/shared_cadence.py from /usr/bin/env python3 to #!/usr/bin/python3
mangling shebang in /usr/share/cadence/src/shared.py from /usr/bin/env python3 to #!/usr/bin/python3
*** WARNING: ./usr/share/cadence/src/resources_rc.py is executable but has empty or no shebang, removing executable bit
mangling shebang in /usr/share/cadence/src/render.py from /usr/bin/env python3 to #!/usr/bin/python3
mangling shebang in /usr/share/cadence/src/patchcanvas_theme.py from /usr/bin/env python3 to #!/usr/bin/python3
mangling shebang in /usr/share/cadence/src/patchcanvas.py from /usr/bin/env python3 to #!/usr/bin/python3
mangling shebang in /usr/share/cadence/src/logs.py from /usr/bin/env python3 to #!/usr/bin/python3
mangling shebang in /usr/share/cadence/src/jacksettings.py from /usr/bin/env python3 to #!/usr/bin/python3
mangling shebang in /usr/share/cadence/src/jacklib_helpers.py from /usr/bin/env python3 to #!/usr/bin/python3
mangling shebang in /usr/share/cadence/src/jacklib.py from /usr/bin/env python3 to #!/usr/bin/python3
mangling shebang in /usr/share/cadence/src/clickablelabel.py from /usr/bin/env python3 to #!/usr/bin/python3
mangling shebang in /usr/share/cadence/src/claudia_launcher.py from /usr/bin/env python3 to #!/usr/bin/python3
mangling shebang in /usr/share/cadence/src/claudia_database.py from /usr/bin/env python3 to #!/usr/bin/python3
mangling shebang in /usr/share/cadence/src/claudia.py from /usr/bin/env python3 to #!/usr/bin/python3
mangling shebang in /usr/share/cadence/src/catia.py from /usr/bin/env python3 to #!/usr/bin/python3
mangling shebang in /usr/share/cadence/src/catarina.py from /usr/bin/env python3 to #!/usr/bin/python3
mangling shebang in /usr/share/cadence/src/canvaspreviewframe.py from /usr/bin/env python3 to #!/usr/bin/python3
mangling shebang in /usr/share/cadence/src/cadence_session_start.py from /usr/bin/env python3 to #!/usr/bin/python3
mangling shebang in /usr/share/cadence/src/cadence_aloop_daemon.py from /usr/bin/env python3 to #!/usr/bin/python3
mangling shebang in /usr/share/cadence/src/cadence.py from /usr/bin/env python3 to #!/usr/bin/python3
*** WARNING: ./etc/X11/xinit/xinitrc.d/61cadence-session-inject is executable but has empty or no shebang, removing executable bit

Maybe these warnings should be fixed in the current master.

ratijas commented 3 years ago

Indeed they should be fixed. Executable scripts without shebang is nonsense.

ratijas commented 3 years ago

I attempted to fix it, but found out that I can't. Actually, most of those files were auto generated by "PyQt5 UI code generator", so it's PyQt5 which needs to be fixed (if it is not yet).

For example catarina_connectports.ui:

# Form implementation generated from reading ui file 'resources/ui/catarina_connectports.ui'
#
# Created by: PyQt5 UI code generator 5.15.1
#
# WARNING: Any manual changes made to this file will be lost when pyuic5 is
# run again.  Do not edit this file unless you know what you are doing.

Well, at least I fixed the rest of warnings: #306.

ratijas commented 3 years ago

Since they won't accept patches, I've sent an email to support@riverbankcomputing.com:

Hi,

Files created by PyQt5 UI code generator are generally not designed to be executable. But if they really should have executable bit set, then it worth nothing that they should have proper #! shebang on the top.

The lack of shebang may cause weird installation warnings, e.g. on Fedora1.

To the best of my knowledge, it affects all versions of PyQt5 up to the latest 5.15.2 from PyPI.

I'm not submitting a patch because I don't want to interfere with Riverbank Computing Ltd. copyright policies, but I can at least make your job easier by pointing in the right direction. The header template which needs to be modified is located is located at pyuic/uic/__init__.py, and it is the only place in
project which contains literal string "PyQt5 UI code generator %s". Please, add a proper python shebang to it.

-- Ivan https://ratijas.tk/

ratijas commented 3 years ago

I got a reply, and it sounds like the issue is somewhere within Cadence build system.

Date: Mon, 30 Nov 2020 09:56:43 +0000 From: Phil Thompson phil@riverbankcomputing.com To: ivan tkachenko me@ratijas.tk Subject: Re: [BUG] Add shebang to generated UI files In-Reply-To: 2554059.z0zBN5RDjQ@getaway References: 2554059.z0zBN5RDjQ@getaway Message-ID: 90a78dffea9564b7d1e6ea251d95315e@riverbankcomputing.com

On 30/11/2020 02:45, ivan tkachenko wrote:

Hi,

Files created by PyQt5 UI code generator are generally not designed to be executable. But if they really should have executable bit set, then it worth nothing that they should have proper #! shebang on the top.

The lack of shebang may cause weird installation warnings, e.g. on Fedora1.

To the best of my knowledge, it affects all versions of PyQt5 up to the latest 5.15.2 from PyPI.

I'm not submitting a patch because I don't want to interfere with Riverbank Computing Ltd. copyright policies, but I can at least make your job easier by pointing in the right direction. The header template which needs to be modified is located is located at pyuic/uic/__init__.py, and it is the only place in project which contains literal string "PyQt5 UI code generator %s". Please, add a proper python shebang to it.

pyuic5 does not create .py files with the execute bit set.

Phil