From 6ea491edfe4d266cfd9b7f31a7bbebaf13c969d2 Mon Sep 17 00:00:00 2001 From: Jonathan Knowles Date: Wed, 29 Nov 2023 05:04:05 +0000 Subject: [PATCH 01/13] Trigger build failure for unused package dependencies. --- cabal.project | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/cabal.project b/cabal.project index 95d13206d16..fe39a51ab59 100644 --- a/cabal.project +++ b/cabal.project @@ -194,6 +194,10 @@ package cardano-config package cardano-node flags: -systemd +-- Fail to build if there are any unused package dependencies: +package * + ghc-options: -Wunused-packages + -- ------------------------------------------------------------------------- -- Enable specific tests in this repo From 1a7a25ac4be744083eb8e5503bfe07f5140e1d8e Mon Sep 17 00:00:00 2001 From: Jonathan Knowles Date: Wed, 29 Nov 2023 01:30:53 +0000 Subject: [PATCH 02/13] Inline common dependencies in `wai-middleware-logging:lib`. --- .../wai-middleware-logging.cabal | 25 ++++++++++++++++++- 1 file changed, 24 insertions(+), 1 deletion(-) diff --git a/lib/wai-middleware-logging/wai-middleware-logging.cabal b/lib/wai-middleware-logging/wai-middleware-logging.cabal index 76c5b264f04..1da30ce927e 100644 --- a/lib/wai-middleware-logging/wai-middleware-logging.cabal +++ b/lib/wai-middleware-logging/wai-middleware-logging.cabal @@ -59,11 +59,34 @@ common deps , with-utf8 library - import: language, opts-lib, deps + import: language, opts-lib hs-source-dirs: src exposed-modules: Network.Wai.Middleware.Logging Network.Wai.Middleware.ServerError + build-depends: + , aeson + , base + , binary + , bytestring + , cardano-wallet-test-utils + , contra-tracer + , hspec + , http-client + , http-types + , iohk-monitoring + , network + , QuickCheck + , servant-server + , streaming-commons + , text + , text-class + , time + , unliftio + , unordered-containers + , wai + , warp + , with-utf8 test-suite unit import: language, opts-exe, deps From d53267c61d160fee2d5819c877e6bf51304312ad Mon Sep 17 00:00:00 2001 From: Jonathan Knowles Date: Wed, 29 Nov 2023 01:31:46 +0000 Subject: [PATCH 03/13] Inline common dependencies in `wai-middleware-logging:test:unit`. --- .../wai-middleware-logging.cabal | 25 ++++++++++++++++++- 1 file changed, 24 insertions(+), 1 deletion(-) diff --git a/lib/wai-middleware-logging/wai-middleware-logging.cabal b/lib/wai-middleware-logging/wai-middleware-logging.cabal index 1da30ce927e..1452dc2323b 100644 --- a/lib/wai-middleware-logging/wai-middleware-logging.cabal +++ b/lib/wai-middleware-logging/wai-middleware-logging.cabal @@ -89,7 +89,7 @@ library , with-utf8 test-suite unit - import: language, opts-exe, deps + import: language, opts-exe ghc-options: -with-rtsopts=-M2G -with-rtsopts=-N4 type: exitcode-stdio-1.0 hs-source-dirs: test @@ -97,3 +97,26 @@ test-suite unit build-depends: wai-middleware-logging build-tool-depends: hspec-discover:hspec-discover other-modules: Network.Wai.Middleware.LoggingSpec + build-depends: + , aeson + , base + , binary + , bytestring + , cardano-wallet-test-utils + , contra-tracer + , hspec + , http-client + , http-types + , iohk-monitoring + , network + , QuickCheck + , servant-server + , streaming-commons + , text + , text-class + , time + , unliftio + , unordered-containers + , wai + , warp + , with-utf8 From 0f1bf3161b0fff3b24dd50efab111fe81518d1a5 Mon Sep 17 00:00:00 2001 From: Jonathan Knowles Date: Wed, 29 Nov 2023 01:34:59 +0000 Subject: [PATCH 04/13] Remove unused dependencies in `wai-middleware-logging:lib`. --- lib/wai-middleware-logging/wai-middleware-logging.cabal | 8 -------- 1 file changed, 8 deletions(-) diff --git a/lib/wai-middleware-logging/wai-middleware-logging.cabal b/lib/wai-middleware-logging/wai-middleware-logging.cabal index 1452dc2323b..3c655b6cf95 100644 --- a/lib/wai-middleware-logging/wai-middleware-logging.cabal +++ b/lib/wai-middleware-logging/wai-middleware-logging.cabal @@ -69,24 +69,16 @@ library , base , binary , bytestring - , cardano-wallet-test-utils , contra-tracer - , hspec - , http-client , http-types , iohk-monitoring - , network - , QuickCheck , servant-server - , streaming-commons , text , text-class , time , unliftio , unordered-containers , wai - , warp - , with-utf8 test-suite unit import: language, opts-exe From 4ee16b7e48fa294fba52082a43259f357aed0a93 Mon Sep 17 00:00:00 2001 From: Jonathan Knowles Date: Wed, 29 Nov 2023 01:35:59 +0000 Subject: [PATCH 05/13] Remove unused dependencies in `wai-middleware-logging:test:unit`. --- lib/wai-middleware-logging/wai-middleware-logging.cabal | 3 --- 1 file changed, 3 deletions(-) diff --git a/lib/wai-middleware-logging/wai-middleware-logging.cabal b/lib/wai-middleware-logging/wai-middleware-logging.cabal index 3c655b6cf95..fb2e2f6804c 100644 --- a/lib/wai-middleware-logging/wai-middleware-logging.cabal +++ b/lib/wai-middleware-logging/wai-middleware-logging.cabal @@ -92,7 +92,6 @@ test-suite unit build-depends: , aeson , base - , binary , bytestring , cardano-wallet-test-utils , contra-tracer @@ -106,9 +105,7 @@ test-suite unit , streaming-commons , text , text-class - , time , unliftio - , unordered-containers , wai , warp , with-utf8 From 6e36fa6a83f8990a21504a3b00287b08583eb3e0 Mon Sep 17 00:00:00 2001 From: Jonathan Knowles Date: Wed, 29 Nov 2023 01:33:02 +0000 Subject: [PATCH 06/13] Remove common dependencies in `wai-middleware-logging`. --- .../wai-middleware-logging.cabal | 25 ------------------- 1 file changed, 25 deletions(-) diff --git a/lib/wai-middleware-logging/wai-middleware-logging.cabal b/lib/wai-middleware-logging/wai-middleware-logging.cabal index fb2e2f6804c..af3d7874ab2 100644 --- a/lib/wai-middleware-logging/wai-middleware-logging.cabal +++ b/lib/wai-middleware-logging/wai-middleware-logging.cabal @@ -33,31 +33,6 @@ common opts-exe if flag(release) ghc-options: -O2 -Werror -common deps - build-depends: - , aeson - , base - , binary - , bytestring - , cardano-wallet-test-utils - , contra-tracer - , hspec - , http-client - , http-types - , iohk-monitoring - , network - , QuickCheck - , servant-server - , streaming-commons - , text - , text-class - , time - , unliftio - , unordered-containers - , wai - , warp - , with-utf8 - library import: language, opts-lib hs-source-dirs: src From 41c5815b2451108574d93e991292c6877b0e0303 Mon Sep 17 00:00:00 2001 From: Jonathan Knowles Date: Wed, 29 Nov 2023 01:51:42 +0000 Subject: [PATCH 07/13] Inline common dependencies in `cardano-wallet-e2e:lib`. --- lib/wallet-e2e/cardano-wallet-e2e.cabal | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/lib/wallet-e2e/cardano-wallet-e2e.cabal b/lib/wallet-e2e/cardano-wallet-e2e.cabal index d3f6ecaea80..436bad03bfc 100644 --- a/lib/wallet-e2e/cardano-wallet-e2e.cabal +++ b/lib/wallet-e2e/cardano-wallet-e2e.cabal @@ -64,10 +64,11 @@ common dependencies , text ^>=1.2.4.1 library - import: options, dependencies + import: options hs-source-dirs: src build-depends: , aeson ^>=2.1.2.1 + , base ^>=4.14.3.0 , base58-bytestring ^>=0.1 , cardano-addresses ^>=3.12 , cardano-crypto ^>=1.1.2 @@ -78,11 +79,17 @@ library , http-types ^>=0.12.3 , local-cluster ^>=0.1 , memory ^>=0.18 + , path ^>=0.9.2 + , path-io ^>=1.7.0 , random ^>=1.2.1.1 + , relude ^>=1.2.0.0 , resourcet ^>=1.3 , retry ^>=0.9.3.1 , scientific ^>=0.3.7 + , sydtest ^>=0.15 , tagged ^>=0.8.7 + , tagged ^>=0.8.7 + , text ^>=1.2.4.1 , time ^>=1.9.3 , timespan ^>=0.4 , typed-process ^>=0.2.11 From 9f1e852791c8a03c6aba39b61cdd95ad80b8f07e Mon Sep 17 00:00:00 2001 From: Jonathan Knowles Date: Wed, 29 Nov 2023 01:56:08 +0000 Subject: [PATCH 08/13] Inline common dependencies in `cardano-wallet-e2e:exe`. --- lib/wallet-e2e/cardano-wallet-e2e.cabal | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/lib/wallet-e2e/cardano-wallet-e2e.cabal b/lib/wallet-e2e/cardano-wallet-e2e.cabal index 436bad03bfc..5e53609f974 100644 --- a/lib/wallet-e2e/cardano-wallet-e2e.cabal +++ b/lib/wallet-e2e/cardano-wallet-e2e.cabal @@ -124,13 +124,20 @@ library Cardano.Wallet.Spec.TimeoutSpec executable wallet-e2e - import: options, dependencies + import: options hs-source-dirs: exe main-is: Main.hs ghc-options: -threaded -rtsopts -with-rtsopts=-N build-depends: + , base ^>=4.14.3.0 , cardano-wallet-e2e , optparse-applicative ^>=0.17.1 + , path ^>=0.9.2 + , path-io ^>=1.7.0 , prettyprinter ^>=1.7.1 , prettyprinter-ansi-terminal ^>=1.1.3 + , relude ^>=1.2.0.0 + , sydtest ^>=0.15 + , tagged ^>=0.8.7 + , text ^>=1.2.4.1 , with-utf8 ^>=1.0.2.4 From 97ffe416c154f36ea0c49a9f3a63b590fb4ef422 Mon Sep 17 00:00:00 2001 From: Jonathan Knowles Date: Wed, 29 Nov 2023 01:53:54 +0000 Subject: [PATCH 09/13] Remove unused dependencies in `cardano-wallet-e2e:lib`. --- lib/wallet-e2e/cardano-wallet-e2e.cabal | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/lib/wallet-e2e/cardano-wallet-e2e.cabal b/lib/wallet-e2e/cardano-wallet-e2e.cabal index 5e53609f974..8a698969fa6 100644 --- a/lib/wallet-e2e/cardano-wallet-e2e.cabal +++ b/lib/wallet-e2e/cardano-wallet-e2e.cabal @@ -73,19 +73,17 @@ library , cardano-addresses ^>=3.12 , cardano-crypto ^>=1.1.2 , cardano-wallet-client ^>=0.1 - , effectful ^>=2.2.2.0 + , effectful-core ^>=2.2.2.0 , effectful-th ^>=1.0.0.1 , http-client ^>=0.7.13.1 , http-types ^>=0.12.3 , local-cluster ^>=0.1 - , memory ^>=0.18 , path ^>=0.9.2 , path-io ^>=1.7.0 , random ^>=1.2.1.1 , relude ^>=1.2.0.0 , resourcet ^>=1.3 , retry ^>=0.9.3.1 - , scientific ^>=0.3.7 , sydtest ^>=0.15 , tagged ^>=0.8.7 , tagged ^>=0.8.7 From 6604e47f9792f6cab57bd792290c0945d5c163d1 Mon Sep 17 00:00:00 2001 From: Jonathan Knowles Date: Wed, 29 Nov 2023 01:58:00 +0000 Subject: [PATCH 10/13] Remove unused dependencies in `cardano-wallet-e2e:exe`. --- lib/wallet-e2e/cardano-wallet-e2e.cabal | 3 --- 1 file changed, 3 deletions(-) diff --git a/lib/wallet-e2e/cardano-wallet-e2e.cabal b/lib/wallet-e2e/cardano-wallet-e2e.cabal index 8a698969fa6..4315fb0490e 100644 --- a/lib/wallet-e2e/cardano-wallet-e2e.cabal +++ b/lib/wallet-e2e/cardano-wallet-e2e.cabal @@ -132,10 +132,7 @@ executable wallet-e2e , optparse-applicative ^>=0.17.1 , path ^>=0.9.2 , path-io ^>=1.7.0 - , prettyprinter ^>=1.7.1 - , prettyprinter-ansi-terminal ^>=1.1.3 , relude ^>=1.2.0.0 , sydtest ^>=0.15 , tagged ^>=0.8.7 - , text ^>=1.2.4.1 , with-utf8 ^>=1.0.2.4 From 73ee0226f070425baa0cd7597ac7ccadfd80665a Mon Sep 17 00:00:00 2001 From: Jonathan Knowles Date: Wed, 29 Nov 2023 01:58:32 +0000 Subject: [PATCH 11/13] Remove common dependencies in `cardano-wallet-e2e`. --- lib/wallet-e2e/cardano-wallet-e2e.cabal | 10 ---------- 1 file changed, 10 deletions(-) diff --git a/lib/wallet-e2e/cardano-wallet-e2e.cabal b/lib/wallet-e2e/cardano-wallet-e2e.cabal index 4315fb0490e..b83390c4410 100644 --- a/lib/wallet-e2e/cardano-wallet-e2e.cabal +++ b/lib/wallet-e2e/cardano-wallet-e2e.cabal @@ -53,16 +53,6 @@ common options relude (Relude as Prelude, Relude.Container.One), relude -common dependencies - build-depends: - , base ^>=4.14.3.0 - , path ^>=0.9.2 - , path-io ^>=1.7.0 - , relude ^>=1.2.0.0 - , sydtest ^>=0.15 - , tagged ^>=0.8.7 - , text ^>=1.2.4.1 - library import: options hs-source-dirs: src From 2e4116bccfcf7328c46ea9a2c58a26c906b6f6c5 Mon Sep 17 00:00:00 2001 From: Jonathan Knowles Date: Wed, 29 Nov 2023 03:07:16 +0000 Subject: [PATCH 12/13] Remove unused dependencies for `cardano-wallet` package. --- lib/wallet/cardano-wallet.cabal | 7 ------- 1 file changed, 7 deletions(-) diff --git a/lib/wallet/cardano-wallet.cabal b/lib/wallet/cardano-wallet.cabal index 2b7b2530fe2..13fdf2d0862 100644 --- a/lib/wallet/cardano-wallet.cabal +++ b/lib/wallet/cardano-wallet.cabal @@ -524,18 +524,15 @@ executable cardano-wallet hs-source-dirs: exe main-is: cardano-wallet.hs build-depends: - , address-derivation-discovery , base , cardano-wallet , cardano-wallet-api-http - , cardano-wallet-application-extras , cardano-wallet-launcher , cardano-wallet-network-layer , contra-tracer , iohk-monitoring , iohk-monitoring-extra , lobemo-backend-ekg - , local-cluster , network-uri , optparse-applicative , text @@ -782,7 +779,6 @@ test-suite integration hs-source-dirs: test/integration test/data main-is: shelley-integration-test.hs build-depends: - , address-derivation-discovery , base , cardano-addresses , cardano-ledger-shelley @@ -798,7 +794,6 @@ test-suite integration , directory , either , filepath - , hspec , hspec-core , http-client , iohk-monitoring @@ -807,7 +802,6 @@ test-suite integration , local-cluster , mock-token-metadata , network-uri - , string-interpolate , tagged ^>=0.8.7 , temporary-extra , text @@ -832,7 +826,6 @@ benchmark restore , cardano-wallet , cardano-wallet-api-http , cardano-wallet-bench - , cardano-wallet-integration , cardano-wallet-launcher , cardano-wallet-network-layer , cardano-wallet-primitive From 1e2b4fe1c9b89bc0b30d3ad01df019d4e0f309ce Mon Sep 17 00:00:00 2001 From: Jonathan Knowles Date: Wed, 29 Nov 2023 03:41:37 +0000 Subject: [PATCH 13/13] Remove unused dependencies from `customer-deposit-wallet`. --- .../customer-deposit-wallet.cabal | 27 ------------------- 1 file changed, 27 deletions(-) diff --git a/lib/customer-deposit-wallet/customer-deposit-wallet.cabal b/lib/customer-deposit-wallet/customer-deposit-wallet.cabal index 0d5951db1c7..4cecfee46fc 100644 --- a/lib/customer-deposit-wallet/customer-deposit-wallet.cabal +++ b/lib/customer-deposit-wallet/customer-deposit-wallet.cabal @@ -46,36 +46,19 @@ library build-depends: , async , base - , bech32 , bytestring - , cardano-addresses , cardano-wallet , cardano-wallet-network-layer , cardano-wallet-primitive , cardano-ledger-byron , containers , contra-tracer - , deepseq , delta-store , delta-types - , directory - , filepath - , io-classes - , iohk-monitoring , iohk-monitoring-extra ^>=0.1 - , network - , network-mux - , network-uri - , nothunks - , ntp-client - , ouroboros-consensus-cardano , persistent ^>=2.13 - , persistent-sqlite ^>=2.13 - , persistent-template ^>=2.12 - , retry , text , time - , typed-protocols exposed-modules: Cardano.Wallet.Deposit.IO Cardano.Wallet.Deposit.IO.DB @@ -111,15 +94,7 @@ library customer-deposit-wallet-http import: language, opts-lib hs-source-dirs: api/http build-depends: - , base - , aeson , customer-deposit-wallet - , http-api-data - , http-types - , optparse-applicative - , tls - , servant - , servant-server exposed-modules: Cardano.Wallet.Deposit.HTTP @@ -128,7 +103,5 @@ executable customer-deposit-wallet hs-source-dirs: exe build-depends: , base - , customer-deposit-wallet - , customer-deposit-wallet-http main-is: customer-deposit-wallet.hs