Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions .github/workflows/evaluate.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,13 @@ jobs:
nix-shell -p nix-prefetch-git --run \
'./add_srp.sh --branch "$PLUTUS_BRANCH"'

- name: Update flake inputs to cover the synced index-state
working-directory: run-script-evaluations
# add_srp.sh syncs the cabal.project index-state to the pinned Plutus commit.
# haskell.nix builds the plan from the pinned hackage.nix / CHaP flake inputs,
# so their snapshots must also be recent enough to know those index-states.
run: nix flake update hackage CHaP --accept-flake-config

- name: Evaluate
working-directory: run-script-evaluations
# START_FROM is passed through env and read as a shell variable for the same reason.
Expand Down
22 changes: 22 additions & 0 deletions run-script-evaluations/add_srp.sh
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,28 @@ log "Nix hash: $NIX_SHA"
# Create backup of cabal.project
cp cabal.project cabal.project.backup

# Sync the CHaP/Hackage index-state to the one the pinned Plutus commit was tested
# against, so we resolve the same package set Plutus itself uses (e.g. the aeson >=2.3
# / cardano-base >=0.1.5 bumps). We read it from the already-prefetched checkout
# ($PREFETCHED .path), so this uses the exact pinned commit with no extra network call.
# The flake inputs still need `nix flake update hackage CHaP` (done in CI) so haskell.nix's
# snapshots cover these dates.
PLUTUS_SRC=$(echo "$PREFETCHED" | jq -r .path)
if [[ -n "$PLUTUS_SRC" && "$PLUTUS_SRC" != "null" && -f "$PLUTUS_SRC/cabal.project" ]]; then
DATE_RE='[0-9]{4}-[0-9]{2}-[0-9]{2}T[0-9:]+Z'
PLUTUS_HACKAGE_IDX=$(grep -oE "hackage\.haskell\.org[[:space:]]+$DATE_RE" "$PLUTUS_SRC/cabal.project" | grep -oE "$DATE_RE" | head -1)
PLUTUS_CHAP_IDX=$(grep -oE "cardano-haskell-packages[[:space:]]+$DATE_RE" "$PLUTUS_SRC/cabal.project" | grep -oE "$DATE_RE" | head -1)
if [[ -n "$PLUTUS_HACKAGE_IDX" && -n "$PLUTUS_CHAP_IDX" ]]; then
log "Syncing index-state from Plutus (hackage: $PLUTUS_HACKAGE_IDX, CHaP: $PLUTUS_CHAP_IDX)"
sed -i -E "s|(hackage\.haskell\.org[[:space:]]+)$DATE_RE|\1$PLUTUS_HACKAGE_IDX|" cabal.project
sed -i -E "s|(cardano-haskell-packages[[:space:]]+)$DATE_RE|\1$PLUTUS_CHAP_IDX|" cabal.project
else
log "Warning: could not parse index-state from Plutus cabal.project; leaving ours unchanged"
fi
else
log "Warning: prefetched Plutus checkout has no cabal.project; leaving index-state unchanged"
fi

# Remove existing Plutus SRP entries to make script idempotent
log "Removing existing Plutus source-repository-package entries..."
sed -i '/-- Added by add_srp.sh script/,/plutus-ledger-api/d' cabal.project
Expand Down
23 changes: 21 additions & 2 deletions run-script-evaluations/cabal.project
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ repository cardano-haskell-packages
d4a35cd3121aa00d18544bb0ac01c3e1691d618f462c46129271bccf39f7e8ee

index-state:
, hackage.haskell.org 2026-03-01T00:00:00Z
, cardano-haskell-packages 2026-02-25T10:27:50Z
, hackage.haskell.org 2026-06-22T23:30:49Z
, cardano-haskell-packages 2026-06-18T17:45:00Z

write-ghc-environment-files: never
tests: true
Expand All @@ -22,3 +22,22 @@ packages: .

package postgresql-libpq
flags: +use-pkg-config

-- Latest plutus master requires aeson >=2.3. The plutus source-repository-package
-- (appended below by add_srp.sh) brings in plutus-tx / plutus-core / plutus-ledger-api
-- as local packages, so cabal solves their full component set, including plutus-core's
-- cost-model-budgeting-bench executable, which pulls in criterion -> microstache.
--
-- deriving-aeson:aeson and microstache:aeson mirror plutus master's own cabal.project,
-- which relaxes those same bounds to admit aeson >=2.3:
-- https://github.com/IntersectMBO/plutus/blob/master/cabal.project
--
-- postgresql-simple:aeson is ours: postgresql-simple still caps aeson <2.3 at its latest
-- release (0.7.0.1) but builds against 2.3, so we relax it to keep aeson consistent.
constraints:
, setup.optparse-applicative >=0.19.0.0

allow-newer:
, deriving-aeson:aeson
, microstache:aeson
, postgresql-simple:aeson
12 changes: 6 additions & 6 deletions run-script-evaluations/flake.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
module Database.PostgreSQL.Simple.Orphans where

import Control.Exception (Exception)
import Data.Int (Int64)
import Data.SatInt (unsafeToSatInt)
import Database.PostgreSQL.Simple.FromField (FromField (..), conversionError)
import PlutusLedgerApi.Common (
Expand Down Expand Up @@ -31,4 +32,4 @@ deriving newtype instance FromField ExMemory
deriving newtype instance FromField ExCPU

instance FromField SatInt where
fromField f mdata = unsafeToSatInt <$> fromField @Int f mdata
fromField f mdata = unsafeToSatInt <$> fromField @Int64 f mdata
Loading