[opensuse-packaging] is bash 'set -xv' possible for scriptlets during build?
Hello, I would like to suggest to run RPM scriptlets during build (and only during build) with bash 'set -xv' if possible. Reasoning: At the end of a package build, the binary RPMs get installed and thereby RPM scriptlets are executed. When a RPM scriptlet fails, the build fails but there is nothing in the build log that shows the scriptlet code. Because often in the spec file scriptlets are specified by RPM macros, the actual scriptlet code is also not in the spec file. In the end when a RPM scriptlet fails during build one has to do cumbersome reverse engineering to find out the actual scriptlet code for the particular repository and architecture where it had failed. Even with the actual scriptlet code it is not obvious what exactly had failed without knowing the exact command that had actually failed. If scriptlets would be run with bash 'set -xv' during build the build log would show the actual scriptlet code plus the commands and their arguments as they are executed. This should help a lot to find out the root cause why a scriptlet failed for a particular repository/architecture. Kind Regards Johannes Meixner -- SUSE LINUX GmbH - GF: Felix Imendoerffer, Jane Smithard, Dilip Upmanyu, Graham Norton - HRB 21284 (AG Nuernberg) -- To unsubscribe, e-mail: opensuse-packaging+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse-packaging+owner@opensuse.org
Johannes Meixner <jsmeix@suse.de> writes:
I would like to suggest to run RPM scriptlets during build (and only during build) with bash 'set -xv' if possible.
That won't work for scriptlets that use a different interpreter. In any case it requires a change in rpm to allow passing arbitrary options to scriptlet execution. Andreas. -- Andreas Schwab, SUSE Labs, schwab@suse.de GPG Key fingerprint = 0196 BAD8 1CE9 1970 F4BE 1748 E4D4 88E3 0EEA B9D7 "And now for something completely different." -- To unsubscribe, e-mail: opensuse-packaging+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse-packaging+owner@opensuse.org
Hello, On Jun 25 12:41 Andreas Schwab wrote (excerpt):
Johannes Meixner <jsmeix@suse.de> writes:
I would like to suggest to run RPM scriptlets during build (and only during build) with bash 'set -xv' if possible.
That won't work for scriptlets that use a different interpreter.
I am talking only about bash.
In any case it requires a change in rpm to allow passing arbitrary options to scriptlet execution.
I was more thinking about something like # alias bash='bash -xv' in the build system before it runs RPM scriptlets but I cannot make serious impementation proposals because my knowledge about build system internals is basically zero. Kind Regards Johannes Meixner -- SUSE LINUX GmbH - GF: Felix Imendoerffer, Jane Smithard, Dilip Upmanyu, Graham Norton - HRB 21284 (AG Nuernberg) -- To unsubscribe, e-mail: opensuse-packaging+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse-packaging+owner@opensuse.org
Hello, On Jun 25 12:35 Johannes Meixner wrote (excerpt):
I would like to suggest to run RPM scriptlets during build (and only during build) with bash 'set -xv' if possible.
As this is only needed when a RPM scriptlet fails during build, it is sufficient to manually enforce '/bin/bash -xv' for debugging and undo it after fixing the scriptlet: I described it at https://en.opensuse.org/openSUSE:Packaging_scriptlet_snippets#Debugging_scri... Kind Regards Johannes Meixner -- SUSE LINUX GmbH - GF: Felix Imendoerffer, Jane Smithard, Dilip Upmanyu, Graham Norton - HRB 21284 (AG Nuernberg) -- To unsubscribe, e-mail: opensuse-packaging+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse-packaging+owner@opensuse.org
participants (2)
-
Andreas Schwab
-
Johannes Meixner