Repository navigation
pacman: fail the install on scriptlet and hook errors - #429
Open
daandemeyer wants to merge 1 commit into
Open
daandemeyer wants to merge 1 commit into
daandemeyer wants to merge 1 commit into
Conversation
libalpm commits a transaction even when an install scriptlet or a hook fails, and pacman then exits with status 0. The install driver only checks the exit status, so a root with a failed scriptlet passes as a good one. Let's read pacman's stderr in the driver, still forwarding it, and fail the install when pacman prints the error of a failed scriptlet or hook. Signed-off-by: Daan De Meyer <daan@amutable.com>
martinpitt
reviewed
Nov 23, 2026
martinpitt
left a comment
Member
There was a problem hiding this comment.
Hmm, is that safe? I wonder how many broken Arch package scripts there are out there that can exit non-zero, if pacman/alpm doesn't enforce their success.
Member
Author
|
It's the same as reproducibility to me, something to fix in Arch |
martinpitt
reviewed
Nov 23, 2026
martinpitt
left a comment
Member
There was a problem hiding this comment.
Hm. This is a horrible hack (scraping stderr), and my gut tells me it'll break image builds and tine is just the wrong place to try and enforce this. OOI, is that blocking anything you are doing, i.e. do you really want to land this now? or was it more like a "CI test run"?
Member
Author
|
I don't have a strong preference. This came up as a side-thing from some claude review. I'll see if there's a cleaner way, otherwise I'll close |
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
libalpm commits a transaction even when an install scriptlet or a hook
fails, and pacman then exits with status 0. The install driver only checks
the exit status, so a root with a failed scriptlet passes as a good one.
Let's read pacman's stderr in the driver, still forwarding it, and fail the
install when pacman prints the error of a failed scriptlet or hook.