Skip to content

Commit

Permalink
Merge pull request #19 from input-output-hk/mgalazyn/initial-setup-local
Browse files Browse the repository at this point in the history
Cleanup, add direnv and inotifywait, add cabal.project.local with development settings
  • Loading branch information
carbolymer authored Dec 4, 2023
2 parents c48ae18 + 7f9ea05 commit 316103b
Show file tree
Hide file tree
Showing 8 changed files with 168 additions and 93 deletions.
8 changes: 8 additions & 0 deletions .envrc
Original file line number Diff line number Diff line change
@@ -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
96 changes: 24 additions & 72 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,73 +1,25 @@
.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
*

!.gitignore
!.gitmodules
!README.md
!LICENSE

# metaproject configuration files
!.envrc
!cabal.project
!cabal.project.local
!hie.yaml
!CODEOWNERS
!haskdogs-dirs.txt
!inotifywait.sh

# cardano projects
!cardano-dev
!cardano-api
!cardano-cli
!cardano-node
24 changes: 24 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -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.
105 changes: 84 additions & 21 deletions cabal.project
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -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

Expand All @@ -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.

14 changes: 14 additions & 0 deletions cabal.project.local
Original file line number Diff line number Diff line change
@@ -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
9 changes: 9 additions & 0 deletions haskdogs-dirs.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
cardano-api
cardano-cli
cardano-base
cardano-ledger
cardano-node
ouroboros-consensus
ouroboros-network
plutus
plutus-apps
2 changes: 2 additions & 0 deletions hie.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
cradle:
cabal:
3 changes: 3 additions & 0 deletions inotifywait.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
#!/bin/env bash
inotifywait -e close_write -r . \
--exclude 'dist-newstyle|.git|./cardano-node/example'

0 comments on commit 316103b

Please sign in to comment.