From 251b692539e3c399080a201186088a29f7d180c4 Mon Sep 17 00:00:00 2001 From: Taylor Fausak Date: Thu, 25 Jan 2024 02:20:11 +0000 Subject: [PATCH 1/7] Upgrade to GHC 9.8.1 --- .devcontainer/compose.yaml | 14 ++++++++++---- .devcontainer/devcontainer.json | 1 + .github/workflows/workflow.yaml | 4 ++-- monadoc.cabal | 28 ++++++++++++++-------------- 4 files changed, 27 insertions(+), 20 deletions(-) diff --git a/.devcontainer/compose.yaml b/.devcontainer/compose.yaml index 25a8778..964ea00 100644 --- a/.devcontainer/compose.yaml +++ b/.devcontainer/compose.yaml @@ -1,15 +1,21 @@ { "services": { "devcontainer": { - "command": "sh -exc 'while sleep 1m; do :; done'", - "image": "public.ecr.aws/acilearning/haskell:9.6.2", + "command": "sleep infinity", + "image": "public.ecr.aws/acilearning/haskell:9.8.1", "init": true, "volumes": [ "..:/workspace", - "./volumes/cabal/cache:/home/vscode/.cache/cabal", - "./volumes/cabal/state:/home/vscode/.local/state/cabal", + "cabal-cache:/home/vscode/.cache/cabal", + "cabal-state:/home/vscode/.local/state/cabal", ], "working_dir": "/workspace" } + }, + "volumes": { + "cabal-cache": null, + "cabal-state": { + "external": true + } } } diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json index 4edb76d..64ce71c 100644 --- a/.devcontainer/devcontainer.json +++ b/.devcontainer/devcontainer.json @@ -11,6 +11,7 @@ } }, "dockerComposeFile": "compose.yaml", + "initializeCommand": "docker volume create cabal-state", "postCreateCommand": "cabal update", "postStartCommand": "git config --global --add safe.directory \"$PWD\"", "service": "devcontainer", diff --git a/.github/workflows/workflow.yaml b/.github/workflows/workflow.yaml index 167782e..6d4b2eb 100644 --- a/.github/workflows/workflow.yaml +++ b/.github/workflows/workflow.yaml @@ -22,8 +22,8 @@ "id": "haskell", "uses": "haskell-actions/setup@v2", "with": { - "cabal-version": "3.10.1.0", - "ghc-version": "9.6.2" + "cabal-version": "3.10.2.1", + "ghc-version": "9.8.1" } }, { diff --git a/monadoc.cabal b/monadoc.cabal index b9af926..6ede9e2 100644 --- a/monadoc.cabal +++ b/monadoc.cabal @@ -30,7 +30,7 @@ flag pedantic manual: True common library - build-depends: base ^>=4.18.0.0 + build-depends: base ^>=4.19.0.0 default-language: Haskell2010 ghc-options: -Weverything -Wno-all-missed-specialisations -Wno-implicit-prelude @@ -53,20 +53,20 @@ library build-depends: , aeson ^>=2.2.1.0 , async ^>=2.2.5 - , bytestring ^>=0.11.4.0 - , Cabal-syntax ^>=3.10.1.0 + , bytestring ^>=0.12.0.2 + , Cabal-syntax ^>=3.10.2.0 , case-insensitive ^>=1.2.1.0 - , containers ^>=0.6.7 + , containers ^>=0.6.8 , crypton ^>=0.31 - , direct-sqlite ^>=2.3.28 + , direct-sqlite ^>=2.3.29 , directory ^>=1.3.8.1 , exceptions ^>=0.10.7 - , filepath ^>=1.4.100.1 + , filepath ^>=1.4.100.4 , formatting ^>=7.2.0 , haddock-library ^>=1.11.0 , hashable ^>=1.4.3.0 , hspec ^>=2.11.7 - , http-client ^>=0.7.15 + , http-client ^>=0.7.16 , http-client-tls ^>=0.3.6.3 , http-types ^>=0.12.4 , lucid2 ^>=0.0.20230706 @@ -74,26 +74,26 @@ library , monad-control ^>=1.0.3.1 , monad-loops ^>=0.4.3 , network-uri ^>=2.6.4.2 - , patrol ^>=1.0.0.6 + , patrol ^>=1.0.0.7 , QuickCheck ^>=2.14.3 , random ^>=1.2.1.1 , resource-pool ^>=0.4.0.0 , saturn:{saturn, spec} ^>=1.0.0.3 , say ^>=0.1.0.1 - , sqlite-simple ^>=0.4.18.2 - , stm ^>=2.5.1.0 + , sqlite-simple ^>=0.4.19.0 + , stm ^>=2.5.2.1 , tar ^>=0.6.0.0 , temporary ^>=1.3 - , text ^>=2.0.2 + , text ^>=2.1 , time ^>=1.12.2 , transformers ^>=0.6.1.0 , uuid ^>=1.3.15 , vault ^>=0.3.1.5 , wai ^>=3.2.4 - , wai-extra ^>=3.1.13.0 + , wai-extra ^>=3.1.14 , wai-middleware-static ^>=0.9.2 - , warp ^>=3.3.31 - , witch ^>=1.2.0.3 + , warp ^>=3.4.0 + , witch ^>=1.2.0.4 , zlib ^>=0.6.3.0 default-extensions: From c8c472e0272e93de0facdae3f4f910e717019040 Mon Sep 17 00:00:00 2001 From: Taylor Fausak Date: Thu, 25 Jan 2024 02:37:35 +0000 Subject: [PATCH 2/7] Fix some warnings --- .github/workflows/workflow.yaml | 2 +- .gitignore | 1 - monadoc.cabal | 5 +++-- source/library/Monadoc/Model/Blob.hs | 8 ++++---- source/library/Monadoc/Type/ComponentId.hs | 6 +++--- 5 files changed, 11 insertions(+), 11 deletions(-) diff --git a/.github/workflows/workflow.yaml b/.github/workflows/workflow.yaml index 6d4b2eb..a988213 100644 --- a/.github/workflows/workflow.yaml +++ b/.github/workflows/workflow.yaml @@ -212,7 +212,7 @@ { "uses": "haskell-actions/hlint-setup@v2", "with": { - "version": 3.6.1 + "version": 3.8 } }, { diff --git a/.gitignore b/.gitignore index ab7f26b..f8954b8 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,3 @@ -/.devcontainer/volumes/ /.vscode/ /cabal.project.* /dist-newstyle/ diff --git a/monadoc.cabal b/monadoc.cabal index 6ede9e2..5936cfb 100644 --- a/monadoc.cabal +++ b/monadoc.cabal @@ -36,8 +36,9 @@ common library -Weverything -Wno-all-missed-specialisations -Wno-implicit-prelude -Wno-missed-specialisations -Wno-missing-deriving-strategies -Wno-missing-export-lists -Wno-missing-exported-signatures - -Wno-missing-kind-signatures -Wno-missing-safe-haskell-mode - -Wno-prepositive-qualified-module -Wno-safe -Wno-unsafe + -Wno-missing-kind-signatures -Wno-missing-role-annotations + -Wno-missing-safe-haskell-mode -Wno-prepositive-qualified-module + -Wno-safe -Wno-unsafe if flag(pedantic) ghc-options: -Werror diff --git a/source/library/Monadoc/Model/Blob.hs b/source/library/Monadoc/Model/Blob.hs index 44aa7b0..56e3ac6 100644 --- a/source/library/Monadoc/Model/Blob.hs +++ b/source/library/Monadoc/Model/Blob.hs @@ -49,9 +49,9 @@ migrations = ] new :: ByteString.ByteString -> Blob -new contents = +new c = Blob - { contents = contents, - hash = Hash.new contents, - size = ByteString.length contents + { contents = c, + hash = Hash.new c, + size = ByteString.length c } diff --git a/source/library/Monadoc/Type/ComponentId.hs b/source/library/Monadoc/Type/ComponentId.hs index df8298c..e3d3b5a 100644 --- a/source/library/Monadoc/Type/ComponentId.hs +++ b/source/library/Monadoc/Type/ComponentId.hs @@ -16,9 +16,9 @@ data ComponentId = ComponentId instance Witch.TryFrom String ComponentId where tryFrom = Witch.maybeTryFrom $ \string -> do let (before, after) = break ((==) ':') string - type_ <- Either.hush $ Witch.tryFrom before - name <- Either.hush . Witch.tryFrom $ drop 1 after - pure ComponentId {type_ = type_, name = name} + t <- Either.hush $ Witch.tryFrom before + n <- Either.hush . Witch.tryFrom $ drop 1 after + pure ComponentId {type_ = t, name = n} instance Witch.TryFrom Text.Text ComponentId where tryFrom = Witch.eitherTryFrom $ Witch.tryFrom . Witch.into @String From 8c5ac7ad88b568e04f7898d55567adf3693de3d5 Mon Sep 17 00:00:00 2001 From: Taylor Fausak Date: Thu, 25 Jan 2024 12:48:08 +0000 Subject: [PATCH 3/7] Update actions --- .github/workflows/deploy.yaml | 2 +- .github/workflows/workflow.yaml | 21 +++++++++------------ 2 files changed, 10 insertions(+), 13 deletions(-) diff --git a/.github/workflows/deploy.yaml b/.github/workflows/deploy.yaml index 01c8e8f..6b39793 100644 --- a/.github/workflows/deploy.yaml +++ b/.github/workflows/deploy.yaml @@ -10,7 +10,7 @@ "uses": "actions/checkout@v4" }, { - "uses": "superfly/flyctl-actions/setup-flyctl@v1" + "uses": "superfly/flyctl-actions/setup-flyctl@fc53c09e1bc3be6f54706524e3b82c4f462f77be" }, { "env": { diff --git a/.github/workflows/workflow.yaml b/.github/workflows/workflow.yaml index a988213..22e88de 100644 --- a/.github/workflows/workflow.yaml +++ b/.github/workflows/workflow.yaml @@ -7,12 +7,9 @@ { "uses": "actions/checkout@v4" }, - { - "run": "mkdir artifact" - }, { "id": "artifact", - "run": "echo directory=artifact/${{ matrix.platform }} >> $GITHUB_OUTPUT", + "run": "echo directory=artifact-${{ matrix.platform }} >> $GITHUB_OUTPUT", "shell": "bash" }, { @@ -51,7 +48,7 @@ "run": "cabal outdated --v2-freeze-file cabal.project.freeze" }, { - "uses": "actions/cache@v3", + "uses": "actions/cache@v4", "with": { "key": "${{ matrix.platform }}/${{ hashFiles('cabal.project.freeze') }}", "path": "${{ steps.haskell.outputs.cabal-store }}", @@ -77,10 +74,10 @@ } }, { - "uses": "actions/upload-artifact@v3", + "uses": "actions/upload-artifact@v4", "with": { "name": "monadoc-${{ github.sha }}", - "path": "artifact" + "path": "${{ steps.artifact.outputs.directory }}" } }, { @@ -139,17 +136,17 @@ "uses": "actions/checkout@v4" }, { - "uses": "actions/download-artifact@v3", + "uses": "actions/download-artifact@v4", "with": { "name": "monadoc-${{ github.sha }}", - "path": "artifact" + "path": "artifact-ubuntu" } }, { - "run": "cd artifact/ubuntu && tar xf monadoc-*.tar.gz" + "run": "cd artifact-ubuntu && tar xf monadoc-*.tar.gz" }, { - "run": "mv artifact/ubuntu/monadoc-*/data artifact/ubuntu/monadoc docker" + "run": "mv artifact-ubuntu/monadoc-*/data artifact-ubuntu/monadoc docker" }, { "run": "chmod +x docker/monadoc" @@ -191,7 +188,7 @@ "uses": "actions/checkout@v4" }, { - "uses": "superfly/flyctl-actions/setup-flyctl@v1" + "uses": "superfly/flyctl-actions/setup-flyctl@fc53c09e1bc3be6f54706524e3b82c4f462f77be" }, { "env": { From d053b09d1c20e2e5a0ed32a26ebfc3b4fe019d0d Mon Sep 17 00:00:00 2001 From: Taylor Fausak Date: Thu, 25 Jan 2024 13:10:11 +0000 Subject: [PATCH 4/7] Fix artifact uploading --- .github/workflows/workflow.yaml | 29 ++++++++++++----------------- 1 file changed, 12 insertions(+), 17 deletions(-) diff --git a/.github/workflows/workflow.yaml b/.github/workflows/workflow.yaml index 22e88de..d4f0e9a 100644 --- a/.github/workflows/workflow.yaml +++ b/.github/workflows/workflow.yaml @@ -8,12 +8,7 @@ "uses": "actions/checkout@v4" }, { - "id": "artifact", - "run": "echo directory=artifact-${{ matrix.platform }} >> $GITHUB_OUTPUT", - "shell": "bash" - }, - { - "run": "mkdir ${{ steps.artifact.outputs.directory }}" + "run": "mkdir artifact" }, { "id": "haskell", @@ -24,7 +19,7 @@ } }, { - "run": "cabal sdist --output-dir ${{ steps.artifact.outputs.directory }}" + "run": "cabal sdist --output-dir artifact" }, { "run": "cabal configure --enable-optimization=2 --enable-tests --flags pedantic --jobs" @@ -33,7 +28,7 @@ "run": "cat cabal.project.local" }, { - "run": "cp cabal.project.local ${{ steps.artifact.outputs.directory }}" + "run": "cp cabal.project.local artifact" }, { "run": "cabal freeze" @@ -42,7 +37,7 @@ "run": "cat cabal.project.freeze" }, { - "run": "cp cabal.project.freeze ${{ steps.artifact.outputs.directory }}" + "run": "cp cabal.project.freeze artifact" }, { "run": "cabal outdated --v2-freeze-file cabal.project.freeze" @@ -65,19 +60,19 @@ "run": "cabal build" }, { - "run": "cp $( cabal list-bin monadoc ) ${{ steps.artifact.outputs.directory }}" + "run": "cp $( cabal list-bin monadoc ) artifact" }, { "uses": "svenstaro/upx-action@v2", "with": { - "file": "${{ steps.artifact.outputs.directory }}/monadoc${{ matrix.extension }}" + "file": "artifact/monadoc${{ matrix.extension }}" } }, { "uses": "actions/upload-artifact@v4", "with": { - "name": "monadoc-${{ github.sha }}", - "path": "${{ steps.artifact.outputs.directory }}" + "name": "monadoc-${{ matrix.platform }}-${{ github.sha }}", + "path": "artifact" } }, { @@ -138,15 +133,15 @@ { "uses": "actions/download-artifact@v4", "with": { - "name": "monadoc-${{ github.sha }}", - "path": "artifact-ubuntu" + "name": "monadoc-ubuntu-${{ github.sha }}", + "path": "artifact" } }, { - "run": "cd artifact-ubuntu && tar xf monadoc-*.tar.gz" + "run": "cd artifact && tar xf monadoc-*.tar.gz" }, { - "run": "mv artifact-ubuntu/monadoc-*/data artifact-ubuntu/monadoc docker" + "run": "mv artifact/monadoc-*/data artifact/monadoc docker" }, { "run": "chmod +x docker/monadoc" From 83ee7743c79282366741b916ad64e383dd8c0437 Mon Sep 17 00:00:00 2001 From: Taylor Fausak Date: Thu, 25 Jan 2024 07:29:39 -0600 Subject: [PATCH 5/7] Use `files` instead of `file` --- .github/workflows/workflow.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/workflow.yaml b/.github/workflows/workflow.yaml index d4f0e9a..8970842 100644 --- a/.github/workflows/workflow.yaml +++ b/.github/workflows/workflow.yaml @@ -65,7 +65,7 @@ { "uses": "svenstaro/upx-action@v2", "with": { - "file": "artifact/monadoc${{ matrix.extension }}" + "files": "artifact/monadoc${{ matrix.extension }}" } }, { From aef189ddaf7e547667583a3153eaba1100063ac6 Mon Sep 17 00:00:00 2001 From: Taylor Fausak Date: Thu, 25 Jan 2024 07:39:16 -0600 Subject: [PATCH 6/7] Pin Ormolu version --- .github/workflows/workflow.yaml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/.github/workflows/workflow.yaml b/.github/workflows/workflow.yaml index 8970842..412dc51 100644 --- a/.github/workflows/workflow.yaml +++ b/.github/workflows/workflow.yaml @@ -223,7 +223,10 @@ "uses": "actions/checkout@v4" }, { - "uses": "haskell-actions/run-ormolu@v14" + "uses": "haskell-actions/run-ormolu@v14", + "with": { + "version": "0.7.3.0" + } } ] } From c05bf3f2635a6a72907b752464739bdd2011d0dd Mon Sep 17 00:00:00 2001 From: Taylor Fausak Date: Thu, 25 Jan 2024 11:53:30 -0600 Subject: [PATCH 7/7] Version 0.2024.1.25 --- monadoc.cabal | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/monadoc.cabal b/monadoc.cabal index 5936cfb..49f9c2a 100644 --- a/monadoc.cabal +++ b/monadoc.cabal @@ -1,6 +1,6 @@ cabal-version: 3.0 name: monadoc -version: 0.2024.1.4 +version: 0.2024.1.25 build-type: Simple category: Documentation data-dir: data