Skip to content
This repository was archived by the owner on Dec 2, 2024. It is now read-only.
Draft
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
33 changes: 33 additions & 0 deletions CONTRIBUTING.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -211,6 +211,39 @@ Specifically, you will probably want to say `nix flake lock --update-input <inpu

Do *not* use `nix flake update`, as that will update all the inputs, which we typically don't want to do.

[[update-ghc]]
=== How to upgrade GHC

Using Nix, we build all packages in `marconi` using the GHC version specified in link:nix/cells/marconi/ghc-compiler-nix-name.nix[].
Eventually, you might want to upgrade GHC to a later version.

The first thing to do is to change the GHC version in link:nix/cells/marconi/ghc-compiler-nix-name.nix[] (ex. change `ghc8107` to `ghc927`).
Then, you should update the constraints specified in link:nix/cells/marconi/library/haskell-language-server-project.nix[].
For example, when updating from `ghc8107` to `ghc927`, we needed to change:

```
cabalProjectLocal = ''
constraints: stylish-haskell==0.13.0.0, hlint==3.2.8
'';
```

to

```
cabalProjectLocal = ''
constraints: stylish-haskell==0.14.2.0, hlint==3.4.1
'';
```

Afterwards, you need to restart your Nix shell.
Doing so *will* rebuild GHC and all of the Haskell packages.
That is inevitable, and it takes around 24h.

Then, you need to compile all of the Cabal projects in the repository, and fix any compilation warnings and errors.

Finally, you can submit a PR and CI system will also rebuild GHC.
Once it's done, it will cache the compiled packages, so that they can be reused when users open a Nix shell.

=== How to build the code with profiling

TODO: Currently not available, coming soon
Expand Down
7 changes: 3 additions & 4 deletions __std__/cells/plutus-apps/devshells/plutus-apps-shell.nix
Original file line number Diff line number Diff line change
Expand Up @@ -112,11 +112,10 @@ inputs.std.lib.dev.mkShell {
cell.packages.haskell-language-server-wrapper
cell.packages.cabal-install
cell.packages.cabal-fmt
cell.packages.plutus-use-cases
cell.packages.cardano-wallet
# cell.packages.cardano-wallet

cell.library.cardano-node.cardano-node
cell.library.cardano-node.cardano-cli
# cell.library.cardano-node.cardano-node
# cell.library.cardano-node.cardano-cli

pkgs.plantuml
pkgs.shellcheck
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@

{ inputs, cell }:

cell.library.plutus-apps-project.index-state
cell.library.plutus-apps-project.index-state-max
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@

{ inputs, cell }:

"ghc8107"
"ghc928"
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ cell.library.pkgs.haskell-nix.cabalProject' {
# b) Pull out the tools themselves from the HLS project so we can use
# them elsewhere
cabalProjectLocal = ''
constraints: stylish-haskell==0.13.0.0, hlint==3.2.8
constraints: stylish-haskell==0.14.2.0, hlint==3.4.1
'';

src = inputs.haskell-language-server;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ let
toHaddock =
haskellLib.collectComponents' "library" (
haskellLib.selectProjectPackages hspkgs // {
inherit (hspkgs) plutus-core plutus-tx plutus-tx-plugin plutus-ledger-api quickcheck-contractmodel;
inherit (hspkgs) plutus-core plutus-tx plutus-tx-plugin plutus-ledger-api; # quickcheck-contractmodel;
}
);

Expand Down
14 changes: 7 additions & 7 deletions __std__/cells/plutus-apps/packages/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -46,21 +46,21 @@

sphinx-build-readthedocs-site = import ./sphinx-build-readthedocs-site.nix block;

plutus-use-cases = import ./plutus-use-cases.nix block;
# plutus-use-cases = import ./plutus-use-cases.nix block;

plutus-uniswap = import ./plutus-uniswap.nix block;
# plutus-uniswap = import ./plutus-uniswap.nix block;

pab-cli = import ./pab-cli.nix block;
# pab-cli = import ./pab-cli.nix block;

plutus-chain-index = import ./plutus-chain-index.nix block;
# plutus-chain-index = import ./plutus-chain-index.nix block;

marconi-chain-index = import ./marconi-chain-index.nix block;
# marconi-chain-index = import ./marconi-chain-index.nix block;

plutus-playground-client-entrypoint = import ./plutus-playground-client-entrypoint.nix block;
# plutus-playground-client-entrypoint = import ./plutus-playground-client-entrypoint.nix block;

create-script-context = import ./create-script-context.nix block;

cardano-wallet = import ./cardano-wallet.nix block;
# cardano-wallet = import ./cardano-wallet.nix block;

scriv = import ./scriv.nix block;

Expand Down
172 changes: 9 additions & 163 deletions cabal.project
Original file line number Diff line number Diff line change
Expand Up @@ -11,33 +11,15 @@ repository cardano-haskell-packages
c00aae8461a256275598500ea0e187588c35a5d5d7454fb57eac18d9edb86a56
d4a35cd3121aa00d18544bb0ac01c3e1691d618f462c46129271bccf39f7e8ee

index-state: 2023-04-20T00:00:00Z

-- See CONTRIBUTING.adoc for how to update index-state
index-state:
, hackage.haskell.org 2023-04-20T00:00:00Z
, cardano-haskell-packages 2023-05-10T00:00:00Z
, hackage.haskell.org 2023-08-23T00:00:00Z
, cardano-haskell-packages 2023-08-23T00:00:00Z

packages: cardano-node-emulator
cardano-node-socket-emulator
cardano-streaming
doc
freer-extras
marconi-chain-index
marconi-core
pab-blockfrost
plutus-chain-index
plutus-chain-index-core
plutus-contract
plutus-contract-certification
plutus-contract-model
plutus-example
plutus-ledger
plutus-pab
plutus-pab-executables
packages: plutus-ledger
plutus-script-utils
plutus-tx-constraints
plutus-use-cases
cardano-node-emulator
freer-extras

-- We never, ever, want this.
write-ghc-environment-files: never
Expand All @@ -50,13 +32,15 @@ benchmarks: true
-- 'tasty' output.
test-show-details: direct

package cardano-crypto-praos
flags: -external-libsodium-vrf

allow-newer:
-- cardano-ledger packages need aeson >2, the following packages have a
-- too restictive upper bounds on aeson, so we relax them here. The hackage
-- trustees can make a revision to these packages cabal file to solve the
-- issue permanently.
, ekg:aeson
, ekg-json:aeson
, openapi3:aeson
, servant:aeson
, servant-client-core:aeson
Expand All @@ -65,142 +49,4 @@ allow-newer:
, blockfrost-api:lens

constraints:
-- cardano-prelude-0.1.0.0 needs
, protolude <0.3.1

-- cardano-ledger-byron-0.1.0.0 needs
, cardano-binary <1.5.0.1

-- plutus-core-1.0.0.1 needs
, cardano-crypto-class >2.0.0.0
, algebraic-graphs <0.7

-- cardano-ledger-core-0.1.0.0 needs
, cardano-crypto-class <2.0.0.1

-- cardano-crypto-class-2.0.0.0.1 needs
, cardano-prelude <0.1.0.1

-- dbvar from cardano-wallet needs
, io-classes <0.3.0.0

-- newer typed-protocols need io-classes>=0.3.0.0 which is incompatible with dbvar's constraint above
, typed-protocols==0.1.0.0

, aeson >= 2

, hedgehog >= 1.1

, resource-pool <0.4.0.0

, http2 <4.0.0

-- ouroboros-consensus-shelley-0.1.0.1 needs
, ouroboros-consensus-protocol==0.1.0.1

-- The plugin will typically fail when producing Haddock documentation. However,
-- in this instance you can simply tell it to defer any errors to runtime (which
-- will never happen since you're building documentation).
--
-- So, any package using 'PlutusTx.compile' in the code for which you need to
-- generate haddock documentation should use the following 'haddock-options'.
package plutus-ledger
haddock-options: "--optghc=-fplugin-opt PlutusTx.Plugin:defer-errors"
package plutus-script-utils
haddock-options: "--optghc=-fplugin-opt PlutusTx.Plugin:defer-errors"
package plutus-contract
haddock-options: "--optghc=-fplugin-opt PlutusTx.Plugin:defer-errors"
package plutus-contract-model
haddock-options: "--optghc=-fplugin-opt PlutusTx.Plugin:defer-errors"

-- These packages appear in our dependency tree and are very slow to build.
-- Empirically, turning off optimization shaves off ~50% build time.
-- It also mildly improves recompilation avoidance.
-- For dev work we don't care about performance so much, so this is okay.
package cardano-ledger-alonzo
optimization: False
package ouroboros-consensus-shelley
optimization: False
package ouroboros-consensus-cardano
optimization: False
package cardano-api
optimization: False
package cardano-wallet
optimization: False
package cardano-wallet-core
optimization: False
package cardano-wallet-cli
optimization: False
package cardano-wallet-launcher
optimization: False
package cardano-wallet-core-integration
optimization: False

-- Direct dependency.
-- Compared to others, cardano-wallet doesn't bump dependencies very often.
-- Making it a good place to start when bumping dependencies.
-- As, for example, bumping the node first highly risks breaking API with the wallet.
-- Unless early bug fixes are required, this is fine as the wallet tracks stable releases of the node.
-- And it is indeed nice for plutus-apps to track stable releases of the node too.
--
-- The current version is dated 2022/08/10
source-repository-package
type: git
location: https://github.com/input-output-hk/cardano-wallet
tag: 18a931648550246695c790578d4a55ee2f10463e
subdir:
lib/cli
lib/core
lib/core-integration
lib/dbvar
lib/launcher
lib/numeric
lib/shelley
lib/strict-non-empty-containers
lib/test-utils
lib/text-class

-- Should follow cardano-wallet.
source-repository-package
type: git
location: https://github.com/input-output-hk/cardano-addresses
tag: b7273a5d3c21f1a003595ebf1e1f79c28cd72513
subdir:
-- cardano-addresses-cli
command-line
-- cardano-addresses
core

-- This is needed because we rely on an unreleased branch of
-- cardano-ledger-alonzo. The feature we need
-- (evaluateTransactionExecutionUnitsWithLogs) in only included from
-- cardano-ledger-alonzo version 1.0.0.0
-- See https://github.com/input-output-hk/cardano-ledger/pull/3111
source-repository-package
type: git
location: https://github.com/input-output-hk/cardano-ledger
tag: da3e9ae10cf9ef0b805a046c84745f06643583c2
subdir:
eras/alonzo/impl
eras/alonzo/test-suite
eras/babbage/impl
eras/babbage/test-suite
eras/byron/chain/executable-spec
eras/byron/crypto
eras/byron/crypto/test
eras/byron/ledger/executable-spec
eras/byron/ledger/impl
eras/byron/ledger/impl/test
eras/shelley/impl
eras/shelley/test-suite
eras/shelley-ma/impl
eras/shelley-ma/test-suite
libs/cardano-ledger-core
libs/cardano-ledger-pretty
libs/cardano-protocol-tpraos
libs/cardano-data
libs/vector-map
libs/set-algebra
libs/small-steps
libs/small-steps-test
libs/non-integral
aeson ^>= 2.1
24 changes: 14 additions & 10 deletions cardano-node-emulator/cardano-node-emulator.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -45,48 +45,52 @@ library
-- Local components
--------------------
build-depends:
, freer-extras >=1.2.0
, plutus-ledger >=1.2.0
, freer-extras >=1.2.0
, plutus-ledger >=1.2.0
, plutus-script-utils >=1.2.0

--------------------------
-- Other IOG dependencies
--------------------------
build-depends:
, cardano-api:{cardano-api, gen} >=1.35
, cardano-api:{cardano-api, gen} ^>=8.2
, cardano-crypto
, cardano-ledger-allegra
, cardano-ledger-alonzo
, cardano-ledger-api
, cardano-ledger-babbage
, cardano-ledger-core
, cardano-ledger-mary
, cardano-ledger-shelley
, cardano-ledger-shelley-ma
, cardano-slotting
, mtl
, ouroboros-consensus
, plutus-core >=1.0.0
, plutus-ledger-api >=1.0.0
, plutus-tx >=1.0.0
, quickcheck-contractmodel >=0.1.4.0

-- , quickcheck-contractmodel >=0.1.4.0

------------------------
-- Non-IOG dependencies
------------------------
build-depends:
, aeson >=2
, aeson >=2
, array
, base >=4.9 && <5
, base >=4.9 && <5
, bytestring
, cardano-strict-containers
, containers
, data-default
, either
, freer-simple
, hedgehog
, lens
, mtl
, prettyprinter >=1.1.0.1
, prettyprinter >=1.1.0.1
, QuickCheck
, quickcheck-contractmodel
, quickcheck-dynamic
, serialise
, strict-containers
, text
, time

Expand Down
Loading