Bug 1683365 - Shell script cannot be used in %pretrans (breaks compose)
Summary: Shell script cannot be used in %pretrans (breaks compose)
Keywords:
Status: CLOSED NEXTRELEASE
Alias: None
Product: Fedora
Classification: Fedora
Component: selinux-policy
Version: rawhide
Hardware: All
OS: Linux
unspecified
urgent
Target Milestone: ---
Assignee: Lukas Vrabec
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2019-02-26 17:16 UTC by Adam Williamson
Modified: 2019-04-05 17:58 UTC (History)
8 users (show)

Fixed In Version:
Clone Of:
Environment:
Last Closed: 2019-04-05 17:58:50 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)

Description Adam Williamson 2019-02-26 17:16:19 UTC
As discussed in https://pagure.io/dusty/failed-composes/issue/1518 , a recent selinux-policy package build broke Rawhide compose.

The problem is this commit: https://src.fedoraproject.org/rpms/selinux-policy/c/46c51e1cb2c7ece4c50ee988034e3a0379dd2bf3?branch=master (from https://src.fedoraproject.org/rpms/selinux-policy/pull-request/15 ). It uses shell script in `%pretrans`. As explained at http://rpm.org/user_doc/lua.html , this is not valid:

"The internal interpreter can run when there’s nothing at all installed yet, because it doesn’t need to be forked. Consider the initial install phase: before even /bin/sh is available to execute the simplest shell built-in commands, the shell’s dependencies will have to be installed. What if some of those need scriptlets? Internal Lua is the only thing that can reliably run in %pretrans. On initial system installation, there’s absolutely nothing in the environment where %pretrans scriptlets execute. This is a condition you cannot even detect with any other means: testing for existence of a file or directory would otherwise require a shell, which is not there."

So, you can't do that. Please either convert the %pretrans uses to use RPM lua not shell script, or find a different way of doing this.

Comment 1 Kevin Fenzi 2019-02-26 17:28:52 UTC
I went ahead and untagged this build so we can get a compose and until it's sorted out.

Comment 2 Lukas Vrabec 2019-02-27 09:51:47 UTC
Adam, Kevin, 

I reverted it, and we'll rewrite it in lua in future. 

https://koji.fedoraproject.org/koji/buildinfo?buildID=1216659


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