From 623720121d3937a287eb8828cac579e54f2f9854 Mon Sep 17 00:00:00 2001 From: Javier Sagredo Date: Fri, 20 Oct 2023 16:37:26 +0200 Subject: [PATCH 1/3] Add cabal-hoogle to nix infra Co-authored-by: Alexander Esgen --- CONTRIBUTING.md | 27 +++++++++++++++++++++++---- nix/shell.nix | 1 + nix/tools.nix | 10 ++++++++++ 3 files changed, 34 insertions(+), 4 deletions(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 0afe44928c..125f63741b 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -168,6 +168,29 @@ the right version of `stylish-haskell`. nix develop -c ./scripts/ci/run-stylish.sh ``` +# Generating documentation and setting up hoogle + +To generate the documentation, use the documentation script: + +```bash +./scripts/docs/haddocks.sh +``` + +Often times, it is useful to have a +[`hoogle`](https://github.com/ndmitchell/hoogle) server at hand, with the +packages and its dependencies. Our suggestion is to use +[`cabal-hoogle`](https://github.com/kokobd/cabal-hoogle) which is included in +the `nix` shell: + +```bash +nix develop +$ cabal-hoogle generate +$ cabal-hoogle run -- server --local +``` + +This will fire a `hoogle` server at https://localhost:8080/ with the local +packages and their dependencies. + ## Making and reviewing changes If you are working on changing a **substantial** part of Consensus, it is @@ -319,10 +342,6 @@ The core contributors to consensus codebase are: - [Joris Dral](https://github.com/jorisdral) -- [Bart Frenk](https://github.com/bartfrenk) - -- [Arnaud Bailly](https://github.com/abailly-iohk) - - [Fraser Murray](https://github.com/fraser-iohk) - [Damian Nadales](https://github.com/dnadales) diff --git a/nix/shell.nix b/nix/shell.nix index 98a6fc4591..fe38534c56 100644 --- a/nix/shell.nix +++ b/nix/shell.nix @@ -11,6 +11,7 @@ hsPkgs.shellFor { pkgs.nixpkgs-fmt pkgs.stylish-haskell pkgs.cabal-fmt + pkgs.cabal-hoogle pkgs.ghcid # release management diff --git a/nix/tools.nix b/nix/tools.nix index acf4710196..0a317949ff 100644 --- a/nix/tools.nix +++ b/nix/tools.nix @@ -35,6 +35,16 @@ in }]; }).cabal-install.components.exes.cabal; + cabal-hoogle = tool "cabal-hoogle" "git" { + src = final.fetchFromGitHub { + owner = "kokobd"; + repo = "cabal-hoogle"; + rev = "7452c2b1dbdae4eb675d280ed99ec135293adc13"; + hash = "sha256-w7PkNZfHJw1291c2nfviENSXykYpNV+4i3FmbMJqSMs="; + }; + index-state = null; # use upstream cabal.project + }; + stylish-haskell = tool "stylish-haskell" "0.14.4.0" { }; cabal-fmt = tool "cabal-fmt" "0.1.7" { }; From 2ee24d2ed4fd560305e0b803bdf3d7b0b4a257bc Mon Sep 17 00:00:00 2001 From: Javier Sagredo Date: Mon, 23 Oct 2023 09:40:23 +0200 Subject: [PATCH 2/3] Update Cabal cache for CI to pass --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 77329a501b..1948c9abf0 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -25,7 +25,7 @@ jobs: os: [ubuntu-latest] env: # Modify this value to "invalidate" the Cabal cache. - CABAL_CACHE_VERSION: "2023-09-25" + CABAL_CACHE_VERSION: "2023-10-23" steps: - uses: actions/checkout@v4 From 43a3a42702e95f9d6e95bee236214a83a796af65 Mon Sep 17 00:00:00 2001 From: Javier Sagredo Date: Mon, 23 Oct 2023 10:05:52 +0200 Subject: [PATCH 3/3] Update badges in README --- .github/workflows/checks.yml | 15 +++++++++++++++ README.md | 10 ++++++---- 2 files changed, 21 insertions(+), 4 deletions(-) diff --git a/.github/workflows/checks.yml b/.github/workflows/checks.yml index 13632f56e7..14d74788c1 100644 --- a/.github/workflows/checks.yml +++ b/.github/workflows/checks.yml @@ -48,3 +48,18 @@ jobs: - name: Cabal check run: ./scripts/ci/check-cabal-files.sh + + check-release-badges: + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v4 + + - name: Check README badges + run: | + for f in $(find ouroboros-consensus* *sop* -type f -name "*.cabal"); do + pkg=$(grep "^name: " $f | rev | cut -d' ' -f1 | rev) + ver=$(grep "^version: " $f | rev | cut -d' ' -f1 | rev) + echo "Checking badge for $pkg-$ver" + grep "$(echo $pkg | sed 's/-/--/g')-$ver" README.md + done diff --git a/README.md b/README.md index e3ebeb87f3..9142e16621 100644 --- a/README.md +++ b/README.md @@ -1,9 +1,11 @@ # [Ouroboros Consensus](https://input-output-hk.github.io/ouroboros-consensus/) -[![consensus](https://img.shields.io/badge/ouroboros--consensus-0.9.0.0-blue)](https://input-output-hk.github.io/cardano-haskell-packages/package/ouroboros-consensus-0.9.0.0/) -[![diffusion](https://img.shields.io/badge/ouroboros--consensus--diffusion-0.7.0.0-blue)](https://input-output-hk.github.io/cardano-haskell-packages/package/ouroboros-consensus-diffusion-0.7.0.0/) -[![protocol](https://img.shields.io/badge/ouroboros--consensus--protocol-0.5.0.4-blue)](https://input-output-hk.github.io/cardano-haskell-packages/package/ouroboros-consensus-protocol-0.5.0.4/) -[![cardano](https://img.shields.io/badge/ouroboros--consensus--cardano-0.7.0.0-blue)](https://input-output-hk.github.io/cardano-haskell-packages/package/ouroboros-consensus-cardano-0.7.0.0/) +[![consensus](https://img.shields.io/badge/ouroboros--consensus-0.12.0.0-blue)](https://input-output-hk.github.io/cardano-haskell-packages/package/ouroboros-consensus-0.12.0.0/) +[![diffusion](https://img.shields.io/badge/ouroboros--consensus--diffusion-0.8.0.1-blue)](https://input-output-hk.github.io/cardano-haskell-packages/package/ouroboros-consensus-diffusion-0.8.0.1/) +[![protocol](https://img.shields.io/badge/ouroboros--consensus--protocol-0.5.0.7-blue)](https://input-output-hk.github.io/cardano-haskell-packages/package/ouroboros-consensus-protocol-0.5.0.7/) +[![cardano](https://img.shields.io/badge/ouroboros--consensus--cardano-0.10.0.0-blue)](https://input-output-hk.github.io/cardano-haskell-packages/package/ouroboros-consensus-cardano-0.10.0.0/) +[![sop-extras](https://img.shields.io/badge/sop--extras-0.1.0.0-blue)](https://input-output-hk.github.io/cardano-haskell-packages/package/sop-extras-0.1.0.0/) +[![strict-sop-core](https://img.shields.io/badge/strict--sop--core-0.1.0.0-blue)](https://input-output-hk.github.io/cardano-haskell-packages/package/strict-sop-core-0.1.0.0/) [![docs](https://img.shields.io/badge/Documentation-yellow)](https://input-output-hk.github.io/ouroboros-consensus/)