From 29cef4020c6e5368410ca3799a2bf7ab91ad70b5 Mon Sep 17 00:00:00 2001 From: Pablo Lamela Date: Thu, 10 Sep 2026 11:34:48 +0000 Subject: [PATCH 1/2] Pin the cardano-keys extraction PRs and adapt to them --- .changes/pin-cardano-keys-extraction.yml | 6 +++++ .github/master-check-exceptions.list | 2 ++ cabal.project | 22 +++++++++++++++++++ .../src/Cardano/CLI/EraBased/Query/Run.hs | 3 ++- .../TextEnvelope/Certificates/Operational.hs | 2 +- .../TextEnvelope/Keys/ExtendedPaymentKeys.hs | 2 +- .../TextEnvelope/Keys/GenesisDelegateKeys.hs | 2 +- .../Shelley/TextEnvelope/Keys/GenesisKeys.hs | 2 +- .../TextEnvelope/Keys/GenesisUTxOKeys.hs | 2 +- .../Shelley/TextEnvelope/Keys/KESKeys.hs | 2 +- .../Shelley/TextEnvelope/Keys/PaymentKeys.hs | 2 +- .../Shelley/TextEnvelope/Keys/StakeKeys.hs | 2 +- .../Shelley/TextEnvelope/Keys/VRFKeys.hs | 2 +- 13 files changed, 41 insertions(+), 10 deletions(-) create mode 100644 .changes/pin-cardano-keys-extraction.yml diff --git a/.changes/pin-cardano-keys-extraction.yml b/.changes/pin-cardano-keys-extraction.yml new file mode 100644 index 0000000000..67627531f5 --- /dev/null +++ b/.changes/pin-cardano-keys-extraction.yml @@ -0,0 +1,6 @@ +project: cardano-cli +pr: 1444 +kind: + - maintenance +description: | + Pinned the cardano-keys extraction (IntersectMBO/cardano-keys#4) and its cardano-api adoption (IntersectMBO/cardano-api#1332) as temporary source-repository-packages, and adapted to the two API changes: `getKesPeriod` returns `KESPeriod` instead of `Word`, and `textEnvelopeType` is a free function rather than a class method. diff --git a/.github/master-check-exceptions.list b/.github/master-check-exceptions.list index e69de29bb2..cf7562635e 100644 --- a/.github/master-check-exceptions.list +++ b/.github/master-check-exceptions.list @@ -0,0 +1,2 @@ +https://github.com/IntersectMBO/cardano-keys +https://github.com/IntersectMBO/cardano-api diff --git a/cabal.project b/cabal.project index be539ec7a5..e885b0fe1b 100644 --- a/cabal.project +++ b/cabal.project @@ -66,6 +66,28 @@ semaphore: True -- Always write GHC env files, because they are needed for ghci. write-ghc-environment-files: always +-- Temporary, until the cardano-keys extraction lands in CHaP: the key layer +-- extracted from cardano-api (IntersectMBO/cardano-keys#4) and the cardano-api +-- change that adopts it (IntersectMBO/cardano-api#1332). +source-repository-package + type: git + location: https://github.com/IntersectMBO/cardano-keys + tag: df20ae67e89920fdc65cd3c30a720dbcbf9e5344 + subdir: cardano-keys + --sha256: sha256-TILlrhcfUOgVkrG5vi6QL8sjTaFvBKJIrnPvURG94A4= + +source-repository-package + type: git + location: https://github.com/IntersectMBO/cardano-api + tag: a6fec2be2c931a8ebaeeb4ee934cc67c144eb29c + subdir: cardano-api + --sha256: sha256-Ox31/CCDgmHjLQDhJR9wG3DpRncZ331yp5v2pb7p/9k= + +constraints: + -- cardano-crypto-class caps crypton below 1.1; without this the GHC 9.14 + -- solver greedily picks crypton 1.1.4 and cannot resolve the plan. + , crypton < 1.1 + -- IMPORTANT -- Do NOT add more source-repository-package stanzas here unless they are strictly -- temporary! Please read the section in CONTRIBUTING about updating dependencies. diff --git a/cardano-cli/src/Cardano/CLI/EraBased/Query/Run.hs b/cardano-cli/src/Cardano/CLI/EraBased/Query/Run.hs index ee87e7af34..0ee9169f9e 100644 --- a/cardano-cli/src/Cardano/CLI/EraBased/Query/Run.hs +++ b/cardano-cli/src/Cardano/CLI/EraBased/Query/Run.hs @@ -79,6 +79,7 @@ import Cardano.Ledger.Address qualified as L import Cardano.Ledger.Api.State.Query qualified as L import Cardano.Ledger.Api.Tx qualified as L import Cardano.Ledger.Conway.State (ChainAccountState (..)) +import Cardano.Protocol.TPraos.OCert (unKESPeriod) import Cardano.Slotting.EpochInfo (EpochInfo (..), epochInfoSlotToUTCTime, hoistEpochInfo) import Cardano.Slotting.Time (RelativeTime (..), toRelativeTime) @@ -427,7 +428,7 @@ runQueryKesPeriodInfoCmd in CurrentKesPeriod $ unSlotNo currSlot `div` slotsPerKesPeriod opCertStartingKesPeriod :: OperationalCertificate -> OpCertStartingKesPeriod - opCertStartingKesPeriod = OpCertStartingKesPeriod . fromIntegral . getKesPeriod + opCertStartingKesPeriod = OpCertStartingKesPeriod . fromIntegral . unKESPeriod . getKesPeriod opCertEndKesPeriod :: GenesisParameters era -> OperationalCertificate -> OpCertEndingKesPeriod opCertEndKesPeriod gParams oCert = diff --git a/cardano-cli/test/cardano-cli-golden/Test/Golden/Shelley/TextEnvelope/Certificates/Operational.hs b/cardano-cli/test/cardano-cli-golden/Test/Golden/Shelley/TextEnvelope/Certificates/Operational.hs index a78860b4cb..4d6bd8c4e3 100644 --- a/cardano-cli/test/cardano-cli-golden/Test/Golden/Shelley/TextEnvelope/Certificates/Operational.hs +++ b/cardano-cli/test/cardano-cli-golden/Test/Golden/Shelley/TextEnvelope/Certificates/Operational.hs @@ -2,7 +2,7 @@ module Test.Golden.Shelley.TextEnvelope.Certificates.Operational where -import Cardano.Api (HasTextEnvelope (..)) +import Cardano.Api (textEnvelopeType) import Cardano.Api.Experimental.Certificate (AsType (AsOperationalCertificate)) import Control.Monad (void) diff --git a/cardano-cli/test/cardano-cli-golden/Test/Golden/Shelley/TextEnvelope/Keys/ExtendedPaymentKeys.hs b/cardano-cli/test/cardano-cli-golden/Test/Golden/Shelley/TextEnvelope/Keys/ExtendedPaymentKeys.hs index bb001c0115..17d09bfab4 100644 --- a/cardano-cli/test/cardano-cli-golden/Test/Golden/Shelley/TextEnvelope/Keys/ExtendedPaymentKeys.hs +++ b/cardano-cli/test/cardano-cli-golden/Test/Golden/Shelley/TextEnvelope/Keys/ExtendedPaymentKeys.hs @@ -3,7 +3,7 @@ module Test.Golden.Shelley.TextEnvelope.Keys.ExtendedPaymentKeys where -import Cardano.Api (AsType (..), HasTextEnvelope (..)) +import Cardano.Api (AsType (..), textEnvelopeType) import Control.Monad (void) import Text.Regex.TDFA ((=~)) diff --git a/cardano-cli/test/cardano-cli-golden/Test/Golden/Shelley/TextEnvelope/Keys/GenesisDelegateKeys.hs b/cardano-cli/test/cardano-cli-golden/Test/Golden/Shelley/TextEnvelope/Keys/GenesisDelegateKeys.hs index 5e3b975ae1..81d7e6870c 100644 --- a/cardano-cli/test/cardano-cli-golden/Test/Golden/Shelley/TextEnvelope/Keys/GenesisDelegateKeys.hs +++ b/cardano-cli/test/cardano-cli-golden/Test/Golden/Shelley/TextEnvelope/Keys/GenesisDelegateKeys.hs @@ -2,7 +2,7 @@ module Test.Golden.Shelley.TextEnvelope.Keys.GenesisDelegateKeys where -import Cardano.Api (AsType (..), HasTextEnvelope (..)) +import Cardano.Api (AsType (..), textEnvelopeType) import Cardano.Api.Experimental.Certificate (AsType (AsOperationalCertificateIssueCounter)) import Control.Monad (void) diff --git a/cardano-cli/test/cardano-cli-golden/Test/Golden/Shelley/TextEnvelope/Keys/GenesisKeys.hs b/cardano-cli/test/cardano-cli-golden/Test/Golden/Shelley/TextEnvelope/Keys/GenesisKeys.hs index 0b60eeb0e1..cb622d2d80 100644 --- a/cardano-cli/test/cardano-cli-golden/Test/Golden/Shelley/TextEnvelope/Keys/GenesisKeys.hs +++ b/cardano-cli/test/cardano-cli-golden/Test/Golden/Shelley/TextEnvelope/Keys/GenesisKeys.hs @@ -2,7 +2,7 @@ module Test.Golden.Shelley.TextEnvelope.Keys.GenesisKeys where -import Cardano.Api (AsType (..), HasTextEnvelope (..)) +import Cardano.Api (AsType (..), textEnvelopeType) import Control.Monad (void) diff --git a/cardano-cli/test/cardano-cli-golden/Test/Golden/Shelley/TextEnvelope/Keys/GenesisUTxOKeys.hs b/cardano-cli/test/cardano-cli-golden/Test/Golden/Shelley/TextEnvelope/Keys/GenesisUTxOKeys.hs index cdaf8f5cb1..f73633553b 100644 --- a/cardano-cli/test/cardano-cli-golden/Test/Golden/Shelley/TextEnvelope/Keys/GenesisUTxOKeys.hs +++ b/cardano-cli/test/cardano-cli-golden/Test/Golden/Shelley/TextEnvelope/Keys/GenesisUTxOKeys.hs @@ -2,7 +2,7 @@ module Test.Golden.Shelley.TextEnvelope.Keys.GenesisUTxOKeys where -import Cardano.Api (AsType (..), HasTextEnvelope (..)) +import Cardano.Api (AsType (..), textEnvelopeType) import Control.Monad (void) diff --git a/cardano-cli/test/cardano-cli-golden/Test/Golden/Shelley/TextEnvelope/Keys/KESKeys.hs b/cardano-cli/test/cardano-cli-golden/Test/Golden/Shelley/TextEnvelope/Keys/KESKeys.hs index edfb936371..82145b0c32 100644 --- a/cardano-cli/test/cardano-cli-golden/Test/Golden/Shelley/TextEnvelope/Keys/KESKeys.hs +++ b/cardano-cli/test/cardano-cli-golden/Test/Golden/Shelley/TextEnvelope/Keys/KESKeys.hs @@ -3,7 +3,7 @@ module Test.Golden.Shelley.TextEnvelope.Keys.KESKeys where -import Cardano.Api (AsType (..), HasTextEnvelope (..)) +import Cardano.Api (AsType (..), textEnvelopeType) import Control.Monad (void) import Text.Regex.TDFA ((=~)) diff --git a/cardano-cli/test/cardano-cli-golden/Test/Golden/Shelley/TextEnvelope/Keys/PaymentKeys.hs b/cardano-cli/test/cardano-cli-golden/Test/Golden/Shelley/TextEnvelope/Keys/PaymentKeys.hs index 0958b9df10..bcdfca3244 100644 --- a/cardano-cli/test/cardano-cli-golden/Test/Golden/Shelley/TextEnvelope/Keys/PaymentKeys.hs +++ b/cardano-cli/test/cardano-cli-golden/Test/Golden/Shelley/TextEnvelope/Keys/PaymentKeys.hs @@ -3,7 +3,7 @@ module Test.Golden.Shelley.TextEnvelope.Keys.PaymentKeys where -import Cardano.Api (AsType (..), HasTextEnvelope (..)) +import Cardano.Api (AsType (..), textEnvelopeType) import Control.Monad (void) import Text.Regex.TDFA ((=~)) diff --git a/cardano-cli/test/cardano-cli-golden/Test/Golden/Shelley/TextEnvelope/Keys/StakeKeys.hs b/cardano-cli/test/cardano-cli-golden/Test/Golden/Shelley/TextEnvelope/Keys/StakeKeys.hs index 397b6395d0..146359c0a2 100644 --- a/cardano-cli/test/cardano-cli-golden/Test/Golden/Shelley/TextEnvelope/Keys/StakeKeys.hs +++ b/cardano-cli/test/cardano-cli-golden/Test/Golden/Shelley/TextEnvelope/Keys/StakeKeys.hs @@ -3,7 +3,7 @@ module Test.Golden.Shelley.TextEnvelope.Keys.StakeKeys where -import Cardano.Api (AsType (..), HasTextEnvelope (..)) +import Cardano.Api (AsType (..), textEnvelopeType) import Control.Monad (void) import Text.Regex.TDFA ((=~)) diff --git a/cardano-cli/test/cardano-cli-golden/Test/Golden/Shelley/TextEnvelope/Keys/VRFKeys.hs b/cardano-cli/test/cardano-cli-golden/Test/Golden/Shelley/TextEnvelope/Keys/VRFKeys.hs index fa2cbeaa97..ef48f26d17 100644 --- a/cardano-cli/test/cardano-cli-golden/Test/Golden/Shelley/TextEnvelope/Keys/VRFKeys.hs +++ b/cardano-cli/test/cardano-cli-golden/Test/Golden/Shelley/TextEnvelope/Keys/VRFKeys.hs @@ -3,7 +3,7 @@ module Test.Golden.Shelley.TextEnvelope.Keys.VRFKeys where -import Cardano.Api (AsType (..), HasTextEnvelope (..)) +import Cardano.Api (AsType (..), textEnvelopeType) import Control.Monad (void) import Text.Regex.TDFA ((=~)) From abe51790d9c9dee244e1c8342616b9b35dec08c2 Mon Sep 17 00:00:00 2001 From: Pablo Lamela Date: Thu, 10 Sep 2026 14:37:07 +0000 Subject: [PATCH 2/2] Enable long git paths on the Windows runner --- .github/workflows/haskell.yml | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/.github/workflows/haskell.yml b/.github/workflows/haskell.yml index c7cd466280..41552b2dca 100644 --- a/.github/workflows/haskell.yml +++ b/.github/workflows/haskell.yml @@ -89,6 +89,15 @@ jobs: - uses: actions/checkout@v6 + # Git for Windows refuses paths longer than 260 characters unless + # core.longpaths is set; cabal clones source-repository-packages into + # dist-newstyle/src/-/, deep enough for the pinned + # cardano-api's golden files to exceed the limit. Drop once + # input-output-hk/actions#44 ships this in the base action. + - name: Enable long file paths for Git on Windows + if: ${{ matrix.sys.os == 'windows-latest' }} + run: git config --system core.longpaths true + - name: Cache and install Cabal dependencies uses: input-output-hk/cardano-dev/actions/cabal-cache@cabal-cache-0.0.1.0 with: