Skip to content

fix(publish): multi-pass pack cap honors dependency chain depth - #40

Merged
monsieurleberre merged 1 commit into
mainfrom
fix/splice-multipass-cap-honors-chain-depth
Jul 25, 2026
Merged

fix(publish): multi-pass pack cap honors dependency chain depth#40
monsieurleberre merged 1 commit into
mainfrom
fix/splice-multipass-cap-honors-chain-depth

Conversation

@monsieurleberre

Copy link
Copy Markdown
Contributor

Problem

The Splice/Finance DAR multi-pass packer (build-pack.sh) capped retries at a hardcoded 5 passes. Families pack in alphabetical order against an incrementally-populated local feed, so a deep dependency can pack after its dependents within the same pass; the loop-while-progress design recovers on the next pass.

Splice 0.6.13 deepened the dependency chain (Amulet → Wallet.Payments → Amulet.Name.Service → {Dso.Governance, Wallet}) enough that the release run packed 30/33 and then hit the cap one pass too early:

  • Pass 5: splice-wallet-payments packed dead last (05:11:43), after its three dependents were already attempted (NU1102: Unable to find package Splice.Wallet.Payments … Found 0 versions in local-feed).
  • The successful pack set progress=1, so the loop wanted a 6th pass that would have resolved all three — but pass > 5 fired first.
  • Result: 30 packed, 0 skipped, 3 failed → exit 1 → Splice 0.4.1-preview.1 never shipped.

Failed run: https://github.com/peacefulstudio/daml-codegen-csharp/actions/runs/30144841949

Fix

Tie the cap to the family count instead of a magic 5:

max_passes=$(( ${#families[@]} + 1 ))

Why it's correct and safe:

  • progress -eq 0 remains the real terminator. progress only stays 1 while a new family reaches ok/skip (status is monotonic), so the loop resolves ≥1 dependency level per pass and cannot infinite-loop regardless of the cap.
  • There are at most #families dependency levels, so #families + 1 can never be too few for any chain depth — and the loop still exits as soon as no progress is possible, so deeper caps cost nothing on shallow chains.

No behavior change for any source whose chain already resolved within 5 passes.

The Splice/Finance DAR multi-pass packer capped retries at a hardcoded 5 passes. Families pack in alphabetical order against a local feed, so a deep dependency (splice-wallet-payments) can pack after its dependents in the same pass; the loop-while-progress recovers on the next pass, but 0.6.13 deepened the chain enough that 30/33 packed and the 6th pass needed to resolve splice-amulet-name-service / splice-dso-governance / splice-wallet was cut off by the cap (NU1102: Found 0 versions in local-feed).

Tie the cap to the family count (families + 1). The progress==0 guard remains the real terminator (monotonic status, no infinite loop), so this can never be too few for any chain depth and never loops longer than necessary.
@github-actions

Copy link
Copy Markdown
Contributor

Scala coverage

Code Coverage

Package Line Rate Branch Rate Health
studio.peaceful.daml.codegen.helper 97% 95%
Summary 97% (642 / 663) 95% (145 / 152)

@github-actions

Copy link
Copy Markdown
Contributor

C# coverage

Code Coverage

Package Line Rate Branch Rate Complexity Health
Daml.Codegen.CSharp 98% 98% 1251
Daml.Codegen.CSharp.Cli 100% 100% 3
Daml.Codegen.Testing.Conformance 63% 62% 104
Daml.Ledger.Abstractions 70% 89% 32
Daml.Ledger.Abstractions.Testing.Conformance 66% 50% 17
Daml.Runtime 94% 84% 522
Summary 94% (4309 / 4566) 92% (1680 / 1823) 1929

@github-actions

Copy link
Copy Markdown
Contributor

C# build matrix

shard result duration
macos-amd64 ✅ success 1m 50s
macos-arm64 ✅ success 45s
ubuntu-amd64 ✅ success 1m 53s
ubuntu-arm64 ✅ success 52s
windows-amd64 ✅ success 1m 54s
windows-arm64 ✅ success 1m 40s

@github-actions

Copy link
Copy Markdown
Contributor

Scala build matrix

shard result duration
macos-amd64 ✅ success 2m 07s
macos-arm64 ✅ success 1m 07s
ubuntu-amd64 ✅ success 1m 00s
ubuntu-arm64 ✅ success 55s
windows-amd64 ✅ success 1m 26s

@monsieurleberre
monsieurleberre merged commit 28c7277 into main Jul 25, 2026
24 checks passed
@monsieurleberre
monsieurleberre deleted the fix/splice-multipass-cap-honors-chain-depth branch July 25, 2026 07:53
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.

1 participant