diff --git a/.envrc b/.envrc new file mode 100644 index 0000000..5e25dca --- /dev/null +++ b/.envrc @@ -0,0 +1,8 @@ +strict_env +if has ghcup; then + GHC_VER="$(grep -oP '^with-compiler: ghc-\K[\d.]+' cabal.project.local)" + PATH_add $(ghcup run --ghc "$GHC_VER" -i 2>/dev/null) +fi + +# load_prefix /usr +load_prefix /usr/local diff --git a/.gitignore b/.gitignore index 52c85c4..6858f55 100644 --- a/.gitignore +++ b/.gitignore @@ -1,73 +1,24 @@ -.stack-work/ -.ghc.environment.* -.nix-shell-cabal.project -/cabal.project.diff -/cabal.project.freeze -/cabal.project.local* -/cabal.project.old -configuration/defaults/simpleview/genesis/ -configuration/defaults/liveview/genesis/ -dist-newstyle/ -dist-profiled/ -dist/ -*~ -\#* -\.#* -*.swp -.dir-locals.el -.Rhistory -result* -/launch-* -stack.yaml.lock -/.cache -/db -/db-[0-9] -/logs -/mainnet -/profile -/launch_* -/state-* -*.eventlog -*.hp -*.prof -*.stats -/cluster -/cluster.* -/run -supervisord.pid - -tags -/config -/data -./*.skey -./*.vkey -./*.cert - -# For now require that users generate their own hie.yaml -hie.yaml - -# Ignore Visual Studio code configuration -.vscode/tasks.json - -# Ignore files generated by tests -tmp -logs -/chairman/db -/html - -# Ignore files generated by haddock -/haddocks -/*.socket - -# Ignore files generated by scripts -/example -/testnet - -.vscode/ - -# Test artifacts -cardano-tracer/cardano-tracer-test - -# IntellIJ project folder -.idea/ +# this ignores everything except meta-project configuration files +# this allows users to keep anything they want in this directory like +# temporarily cloned repos with dependencies for the time being +* + +# metaproject configuration files +!.envrc +!.gitignore +!.gitmodules +!README.md +!cabal.project +!cabal-hackage.project +!cabal.project.local +!hie.yaml +!CODEOWNERS +!haskdogs-dirs.txt +!inotifywait.sh + +# cardano projects +!cardano-dev +!cardano-api +!cardano-cli +!cardano-node diff --git a/README.md b/README.md index 2c397e3..e022e8d 100644 --- a/README.md +++ b/README.md @@ -1,2 +1,26 @@ # fusion-flamingo Development repository for the fusion-flamingo team + +## Tools and configurations + +### `inotifywait.sh` +Constantly watches the directory, and exits when changes are made. +Useful for rebuilding on file change for example: +```bash +while :; do cabal test cardano-cli-test-golden; sleep 0.5; ./inotifywait.sh ; done +``` + +### `haskdogs.txt` +List of directories useful for generating ctags + +```bash +haskdogs -d haskdogs.txt +``` + +### `.envrc` +`direnv` configuration. +Adds prefixes for building the projects with crypto libraries. +Downloads GHC configured in `cabal.project.local` **if** `ghcup` is present. + +### `hie.yaml` +Generic HLS configuration to make it work everywhere. diff --git a/cabal.project b/cabal.project index 2c3228c..3bdd9e2 100644 --- a/cabal.project +++ b/cabal.project @@ -1,4 +1,4 @@ --- Custom repository for cardano haskell packages, see CONTRIBUTING for more + repository cardano-haskell-packages url: https://input-output-hk.github.io/cardano-haskell-packages secure: True @@ -10,28 +10,73 @@ repository cardano-haskell-packages c00aae8461a256275598500ea0e187588c35a5d5d7454fb57eac18d9edb86a56 d4a35cd3121aa00d18544bb0ac01c3e1691d618f462c46129271bccf39f7e8ee --- See CONTRIBUTING for information about these, including some Nix commands --- you need to run if you change them index-state: - , hackage.haskell.org 2023-08-06T23:58:58Z - , cardano-haskell-packages 2023-10-06T00:47:56Z + , hackage.haskell.org 2023-11-09T23:50:15Z + , cardano-haskell-packages 2023-11-30T13:34:51Z packages: - cardano-api/cardano-api - cardano-api/cardano-api-gen - cardano-cli/cardano-cli - hedgehog-extras + -- cardano-node/*/*.cabal + -- cardano-node/cardano-node/cardano-node.cabal + -- cardano-node/cardano-testnet/cardano-testnet.cabal + cardano-cli/*/*.cabal + cardano-api/*/*.cabal + -- bech32/*/*.cabal -package cardano-api - ghc-options: -Werror + -- from: git@github.com:input-output-hk/hedgehog-extras.git + -- hedgehog-extras/*.cabal -package cardano-api-gen - ghc-options: -Werror + -- from: git@github.com:input-output-hk/ouroboros-network.git + -- ouroboros-network/cardano-ping/*.cabal + -- ouroboros-network/network-mux/*.cabal + + -- from: git@github.com:input-output-hk/ouroboros-consensus.git + -- ouroboros-consensus/*/*.cabal + + -- from: git@github.com:input-output-hk/cardano-ledger.git + -- cardano-ledger/eras/allegra/impl + -- cardano-ledger/eras/alonzo/impl + -- cardano-ledger/eras/alonzo/test-suite + -- cardano-ledger/eras/babbage/impl + -- cardano-ledger/eras/babbage/test-suite + -- cardano-ledger/eras/byron/chain/executable-spec + -- cardano-ledger/eras/byron/crypto + -- cardano-ledger/eras/byron/crypto/test + -- cardano-ledger/eras/byron/ledger/executable-spec + -- cardano-ledger/eras/byron/ledger/impl + -- cardano-ledger/eras/byron/ledger/impl/test + -- cardano-ledger/eras/conway/impl + -- cardano-ledger/eras/conway/test-suite + -- cardano-ledger/eras/mary/impl + -- cardano-ledger/eras/shelley-ma/test-suite + -- cardano-ledger/eras/shelley/impl + -- cardano-ledger/eras/shelley/test-suite + -- cardano-ledger/libs/cardano-data + -- cardano-ledger/libs/cardano-ledger-api + -- cardano-ledger/libs/cardano-ledger-binary + -- cardano-ledger/libs/cardano-ledger-core + -- cardano-ledger/libs/cardano-ledger-pretty + -- cardano-ledger/libs/cardano-ledger-test + -- cardano-ledger/libs/cardano-protocol-tpraos + -- cardano-ledger/libs/ledger-state + -- cardano-ledger/libs/non-integral + -- cardano-ledger/libs/plutus-preprocessor + -- cardano-ledger/libs/set-algebra + -- cardano-ledger/libs/small-steps-test + -- cardano-ledger/libs/small-steps + -- cardano-ledger/libs/vector-map + + -- from: git@github.com:input-output-hk/cardano-base.git + -- cardano-base/cardano-crypto-class/*.cabal + -- cardano-base/cardano-crypto-praos/*.cabal + -- cardano-base/cardano-crypto-tests/*.cabal + -- cardano-base/cardano-mempool/*.cabal + + -- ****** + -- beware of repos with multiple cabal projects with different release cadence + -- these may render the project unbuildable when including all cabal projects here + -- for example that's the case for ouroboros-network + -- ****** -package cryptonite - -- Using RDRAND instead of /dev/urandom as an entropy source for key - -- generation is dubious. Set the flag so we use /dev/urandom by default. - flags: -support_rdrand tests: True @@ -40,11 +85,29 @@ test-show-details: direct -- Always write GHC env files, because they are needed for ghci. write-ghc-environment-files: always -allow-newer: text +package * + ghc-options: -Wwarn + +-- package cardano-api +-- ghc-options: -fdefer-type-errors + +package cryptonite + -- Using RDRAND instead of /dev/urandom as an entropy source for key + -- generation is dubious. Set the flag so we use /dev/urandom by default. + flags: -support_rdrand + +package snap-server + flags: +openssl + +package cardano-crypto-praos + flags: -external-libsodium-vrf + +allow-newer: + , base + , ghc-prim + , text constraints: dependent-sum-template < 0.1.2 --- 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/cabal.project.local b/cabal.project.local new file mode 100644 index 0000000..002b972 --- /dev/null +++ b/cabal.project.local @@ -0,0 +1,14 @@ +jobs: $ncpus +ignore-project: False +optimization: False +test-show-details: direct + +program-options + ghc-options: -fobject-code -freverse-errors -Wwarn -Wunused-packages + +package cardano-crypto-praos + flags: -external-libsodium-vrf + +-- with-compiler: ghc-8.10.7 +-- with-compiler: ghc-9.2.8 +with-compiler: ghc-9.6.3 diff --git a/haskdogs-dirs.txt b/haskdogs-dirs.txt new file mode 100644 index 0000000..77736e3 --- /dev/null +++ b/haskdogs-dirs.txt @@ -0,0 +1,9 @@ +cardano-api +cardano-cli +cardano-base +cardano-ledger +cardano-node +ouroboros-consensus +ouroboros-network +plutus +plutus-apps diff --git a/hie.yaml b/hie.yaml new file mode 100644 index 0000000..04cd243 --- /dev/null +++ b/hie.yaml @@ -0,0 +1,2 @@ +cradle: + cabal: diff --git a/inotifywait.sh b/inotifywait.sh new file mode 100755 index 0000000..9f13232 --- /dev/null +++ b/inotifywait.sh @@ -0,0 +1,3 @@ +#!/bin/env bash +inotifywait -e close_write -r . \ + --exclude 'dist-newstyle|.git|./cardano-node/example'