Skip to content

stable-3.6: fix: call transaction_order() to get deterministic install ordering - #600

Merged
oliverkurth merged 1 commit into
vmware:stable-3.6from
sshedi:topic/sshedi/stable-3.6-fix-install-order-determinism
Aug 27, 2026
Merged

stable-3.6: fix: call transaction_order() to get deterministic install ordering#600
oliverkurth merged 1 commit into
vmware:stable-3.6from
sshedi:topic/sshedi/stable-3.6-fix-install-order-determinism

Conversation

@sshedi

@sshedi sshedi commented Aug 27, 2026

Copy link
Copy Markdown
Contributor

solver_create_transaction() returns pTrans->steps in an order influenced by the libsolv job-queue, which mirrors CLI argument order. rpmtsOrder() then picks whichever Requires(pre) provider appears closest to the consumer in the RPM transaction as the ordering anchor, making the install sequence non-deterministic across different CLI argument orderings.

Calling transaction_order(pTrans, 0) immediately after solver_create_transaction() sorts pTrans->steps into proper dependency-graph order before it is used to populate the RPM transaction, ensuring a consistent provider is selected as the anchor regardless of CLI order.

Regression: installing 'filesystem linux-tools bash toybox' vs 'filesystem linux-tools toybox bash' could result in either bash or toybox being used to run linux's %pre scriptlet. Toybox sh exits 1 for an if-branch that is never taken (non-POSIX), causing the install to fail.

Add a regression test using four minimal packages that reproduce the non-deterministic ordering with two competing Requires(pre) providers.

This is a port of commit 015a31c from dev branch.

Original PR: #596

solver_create_transaction() returns pTrans->steps in an order influenced
by the libsolv job-queue, which mirrors CLI argument order. rpmtsOrder()
then picks whichever Requires(pre) provider appears closest to the
consumer in the RPM transaction as the ordering anchor, making the install
sequence non-deterministic across different CLI argument orderings.

Calling transaction_order(pTrans, 0) immediately after
solver_create_transaction() sorts pTrans->steps into proper
dependency-graph order before it is used to populate the RPM transaction,
ensuring a consistent provider is selected as the anchor regardless of
CLI order.

Regression: installing 'filesystem linux-tools bash toybox' vs
'filesystem linux-tools toybox bash' could result in either bash or toybox
being used to run linux's %pre scriptlet. Toybox sh exits 1 for an
if-branch that is never taken (non-POSIX), causing the install to fail.

Add a regression test using four minimal packages that reproduce the
non-deterministic ordering with two competing Requires(pre) providers.

This is a port of commit 015a31c from dev branch.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Signed-off-by: Shreenidhi Shedi <shreenidhi.shedi@broadcom.com>
@sshedi sshedi changed the title fix: call transaction_order() to get deterministic install ordering stable-3.6: fix: call transaction_order() to get deterministic install ordering Aug 27, 2026
@oliverkurth
oliverkurth merged commit 4ddcdb5 into vmware:stable-3.6 Aug 27, 2026
8 checks passed
@sshedi
sshedi deleted the topic/sshedi/stable-3.6-fix-install-order-determinism branch August 28, 2026 02:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants