원클릭으로
cardano-deps
// Cardano dependencies management, CHaP, source-repository-package, version bumps
// Cardano dependencies management, CHaP, source-repository-package, version bumps
| name | cardano-deps |
| description | Cardano dependencies management, CHaP, source-repository-package, version bumps |
Managing Cardano Haskell dependencies is complex due to the interconnected ecosystem. This skill provides the workflow for updating dependencies reliably.
User decides which cardano-node version to align with (e.g., 10.1.0, 10.2.0).
All Cardano dependencies must be cloned locally and checked out to the correct tag.
Required repos (in /code/):
cardano-nodecardano-apicardano-ledgercardano-baseouroboros-networkouroboros-consensusFor each repo:
cd /code/<repo>
git fetch --tags
git checkout <tag> # matching the target cardano-node version
Check cardano-node's cabal.project for the exact versions/tags of each dependency.
For each Cardano repo, extract the changelog between current and target version:
cd /code/<repo>
git log --oneline <current-tag>..<target-tag>
Create a combined changelog document (e.g., bump-changelog.md) that:
Commit this document. It provides a unified view of all ecosystem changes.
Critical for Windows cross-compilation: Use the same CHaP version as cardano-node to avoid wine/iserv issues.
# Check cardano-node's CHaP version
cd /code/cardano-node
git checkout <target-version>
cat flake.lock | jq '.nodes.CHaP.locked.rev'
# Update cardano-wallet's CHaP to match
cd /code/cardano-wallet
nix flake update CHaP --override-input CHaP github:intersectmbo/cardano-haskell-packages/<chap-rev>
Why this matters: Different CHaP versions can resolve different transitive dependency versions (e.g., th-orphans, network). These differences can cause the iserv-proxy derivation to be built differently, leading to wine socket connection failures during Windows cross-compilation.
cd /code/cardano-node
cabal update
cabal freeze
This generates cabal.project.freeze with exact versions of all dependencies.
Use cabal-plan to get topological order:
cabal-plan topo
Or for a visual graph:
cabal-plan dot | dot -Tpng -o deps.png
For each sublibrary, from least dependent to most dependent:
Open the .cabal file
Update build-depends bounds using freeze as reference:
Example: if freeze says aeson-2.1.2.1, use aeson >= 2.1.2.1 && < 2.2
Build the sublibrary
Format and lint:
fourmolu -i on all source fileshlint on all source filesIf sublibrary has tests:
Commit this sublibrary (one commit per sublibrary)
Never touch this sublibrary again during the bump
This ensures each sublibrary is fully complete before moving to the next.
After all .cabal files are updated:
index-state for hackage and CHaPsource-repository-package entriesUpdate the cardano-node input in flake.nix to the target version.
This is required to run integration tests against the new node version.
Create a final commit that:
33 sublibraries in dependency order (update in this sequence):
Level 0 - No internal dependencies:
delta-typestext-classcardano-numericstd-gen-seedcrypto-primitivesfaucetcardano-wallet-application-tlsLevel 1:
iohk-monitoring-extracardano-wallet-launchercardano-wallet-test-utilsdelta-storewai-middleware-loggingcardano-wallet-secretscardano-wallet-application-extrasLevel 2:
temporary-extradelta-chaindelta-tablecardano-api-extracardano-wallet-primitiveLevel 3:
cardano-coin-selectionaddress-derivation-discoveryLevel 4:
cardano-balance-txLevel 5:
cardano-wallet-network-layerLevel 6:
cardano-walletlocal-clusterLevel 7:
cardano-wallet-apiLevel 8:
cardano-wallet-uiLevel 9:
cardano-wallet-applicationLevel 10:
cardano-wallet-integrationcardano-wallet-unitLevel 11:
cardano-wallet-benchmarksLevel 12:
cardano-wallet-blackbox-benchmarksCHaP is the custom Hackage repository for Cardano packages:
repository cardano-haskell-packages
url: https://chap.intersectmbo.org/
secure: True
root-keys:
3e0cce471cf09815f930210f7827266fd09045445d65923e6d0238a6cd15126f
443abb7fb497a134c343faf52f0b659bd7999bc06b7f63fa76dc99d631f9bea1
a86a1f6ce86c449c46666bda44268677abf29b5b2d2eb5ec7af903ec2f117a82
bcec67e8e99cabfa7764d75ad9b158d72bfacf70ca1d0ec8bc6b4406d1bf8413
c00aae8461a256275598500ea0e187588c35a5d5d7454fb57eac18d9edb86a56
d4a35cd3121aa00d18544bb0ac01c3e1691d618f462c46129271bccf39f7e8ee
index-state controls which package versions are visible:
index-state:
, hackage.haskell.org 2025-01-01T23:24:19Z
, cardano-haskell-packages 2025-03-01T00:00:00Z
For packages not on CHaP or when you need a specific commit:
source-repository-package
type: git
location: https://github.com/IntersectMBO/cardano-addresses
tag: 2bca06deaa60e54a5322ac757387d744bf043367
--sha256: 1y1mzfly7jac40b9g4xc078rcm5zqhc3xxv77kwxi10yph1jwq7z
subdir: command-line
core
Getting SHA256:
nix flake prefetch github:owner/repo/commit-sha
Standard format for dependency bounds:
build-depends:
aeson >= 2.1.2.1 && < 2.2
, base >= 4.18 && < 5
, cardano-api >= 10.0 && < 10.1
cabal updaterm -rf dist-newstylecabal updatecabal build all -O0iserv-proxy: Network.Socket.connect: <socket: 126>: does not exist (Connection refused)
<no location info>: error: ghc-iserv terminated (1)
This happens when Template Haskell packages (like th-orphans) fail during Windows cross-compilation. The root cause is usually a CHaP version mismatch causing different transitive dependencies.
Fix: Align CHaP with the target cardano-node version:
# Get cardano-node's CHaP rev
cd /code/cardano-node && git checkout <target-version>
cat flake.lock | jq '.nodes.CHaP.locked.rev'
# Update cardano-wallet to use same CHaP
cd /code/cardano-wallet
nix flake update CHaP --override-input CHaP github:intersectmbo/cardano-haskell-packages/<rev>
Debug steps:
diff <(nix-store -qR /nix/store/<master-drv> | sort) \
<(nix-store -qR /nix/store/<failing-drv> | sort)
iserv-proxy, network, th-orphans versionsPotential tools to create:
These could be added to the justfile or as standalone tools.