Skip to content

Commit

Permalink
Prune remaining unused package dependencies. (#4273)
Browse files Browse the repository at this point in the history
## Issue

Follow-on from
#4270.

## Description

This PR:

1. Adjusts `cabal.project` so that `cabal build` will fail with an error
if there are any unused package dependencies in any package. (See
23873fd.)
2. Removes all remaining unused package dependencies from all packages.
  • Loading branch information
jonathanknowles authored Nov 29, 2023
2 parents 7da7158 + 1e2b4fe commit 46ff698
Show file tree
Hide file tree
Showing 5 changed files with 47 additions and 68 deletions.
4 changes: 4 additions & 0 deletions cabal.project
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
27 changes: 0 additions & 27 deletions lib/customer-deposit-wallet/customer-deposit-wallet.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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

Expand All @@ -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
44 changes: 27 additions & 17 deletions lib/wai-middleware-logging/wai-middleware-logging.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -33,44 +33,54 @@ common opts-exe
if flag(release)
ghc-options: -O2 -Werror

common deps
library
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

library
import: language, opts-lib, deps
hs-source-dirs: src
exposed-modules:
Network.Wai.Middleware.Logging
Network.Wai.Middleware.ServerError

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
main-is: Main.hs
build-depends: wai-middleware-logging
build-tool-depends: hspec-discover:hspec-discover
other-modules: Network.Wai.Middleware.LoggingSpec
build-depends:
, aeson
, base
, bytestring
, cardano-wallet-test-utils
, contra-tracer
, hspec
, http-client
, http-types
, iohk-monitoring
, network
, QuickCheck
, servant-server
, streaming-commons
, text
, text-class
, unliftio
, wai
, warp
, with-utf8
33 changes: 16 additions & 17 deletions lib/wallet-e2e/cardano-wallet-e2e.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -53,36 +53,31 @@ 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, 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
, 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
, text ^>=1.2.4.1
, time ^>=1.9.3
, timespan ^>=0.4
, typed-process ^>=0.2.11
Expand Down Expand Up @@ -117,13 +112,17 @@ 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
, prettyprinter ^>=1.7.1
, prettyprinter-ansi-terminal ^>=1.1.3
, path ^>=0.9.2
, path-io ^>=1.7.0
, relude ^>=1.2.0.0
, sydtest ^>=0.15
, tagged ^>=0.8.7
, with-utf8 ^>=1.0.2.4
7 changes: 0 additions & 7 deletions lib/wallet/cardano-wallet.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand All @@ -798,7 +794,6 @@ test-suite integration
, directory
, either
, filepath
, hspec
, hspec-core
, http-client
, iohk-monitoring
Expand All @@ -807,7 +802,6 @@ test-suite integration
, local-cluster
, mock-token-metadata
, network-uri
, string-interpolate
, tagged ^>=0.8.7
, temporary-extra
, text
Expand All @@ -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
Expand Down

0 comments on commit 46ff698

Please sign in to comment.