-
Notifications
You must be signed in to change notification settings - Fork 88
cabal-lint: add tool #4208
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
cabal-lint: add tool #4208
Conversation
@@ -0,0 +1,14 @@ | |||
The IOG Consensus team uses this `cabal-lint` tool to ensures some invariants among its `.cabal` files. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I see the following behavior, currently.
$ cabal-lint $(find ouroboros-consensus* -name '*.cabal') | sed 's/;/\n /g'
[E-MissingOptions] Component lib:ouroboros-consensus-protocol-test in package ouroboros-consensus-protocol/ouroboros-consensus-protocol.cabal is missing required options in its `ghc-options' fields: -Wall -Wcompat -Widentities -Wincomplete-record-updates -Wincomplete-uni-patterns -Wmissing-export-lists -Wpartial-fields -Wredundant-constraints
[E-RepeatDeps] Component lib in package ouroboros-consensus-shelley-test/ouroboros-consensus-shelley-test.cabal repeats dependencies in its `build-depends' fields: cardano-protocol-tpraos:lib
[E-MissingOptions] Component exe:unsoundswitch in package ouroboros-consensus/docs/report/unsoundswitch/unsoundswitch.cabal is missing required options in its `ghc-options' fields: -Wcompat -Widentities -Wincomplete-record-updates -Wincomplete-uni-patterns -Wmissing-export-lists -Wpartial-fields -Wredundant-constraints
[I-ConsistentVersions] Dependency QuickCheck:lib is consistently unconstrained
[I-ConsistentVersions] Dependency Win32:lib is consistently constrained to >=2.6.1.0
[I-ConsistentVersions] Dependency aeson:lib is consistently unconstrained
[I-ConsistentVersions] Dependency base-deriving-via:lib is consistently unconstrained
[I-ConsistentVersions] Dependency bifunctors:lib is consistently unconstrained
[I-ConsistentVersions] Dependency bimap:lib is consistently constrained to >=0.4 && <0.5
[I-ConsistentVersions] Dependency binary-search:lib is consistently unconstrained
[I-ConsistentVersions] Dependency byron-spec-chain:lib is consistently unconstrained
[I-ConsistentVersions] Dependency byron-spec-ledger:lib is consistently unconstrained
[I-ConsistentVersions] Dependency cardano-binary:lib is consistently unconstrained
[I-ConsistentVersions] Dependency cardano-crypto:lib is consistently unconstrained
[I-ConsistentVersions] Dependency cardano-crypto-class:lib is consistently unconstrained
[I-ConsistentVersions] Dependency cardano-crypto-praos:lib is consistently unconstrained
[I-ConsistentVersions] Dependency cardano-crypto-test:lib is consistently unconstrained
[I-ConsistentVersions] Dependency cardano-crypto-tests:lib is consistently unconstrained
[I-ConsistentVersions] Dependency cardano-crypto-wrapper:lib is consistently unconstrained
[I-ConsistentVersions] Dependency cardano-data:lib is consistently unconstrained
[I-ConsistentVersions] Dependency cardano-ledger-alonzo:lib is consistently unconstrained
[I-ConsistentVersions] Dependency cardano-ledger-alonzo-test:lib is consistently unconstrained
[I-ConsistentVersions] Dependency cardano-ledger-babbage:lib is consistently unconstrained
[I-ConsistentVersions] Dependency cardano-ledger-babbage-test:lib is consistently unconstrained
[I-ConsistentVersions] Dependency cardano-ledger-byron:lib is consistently unconstrained
[I-ConsistentVersions] Dependency cardano-ledger-byron-test:lib is consistently unconstrained
[I-ConsistentVersions] Dependency cardano-ledger-core:lib is consistently unconstrained
[I-ConsistentVersions] Dependency cardano-ledger-shelley:lib is consistently unconstrained
[I-ConsistentVersions] Dependency cardano-ledger-shelley-ma:lib is consistently unconstrained
[I-ConsistentVersions] Dependency cardano-ledger-shelley-ma-test:lib is consistently unconstrained
[I-ConsistentVersions] Dependency cardano-ledger-shelley-test:lib is consistently unconstrained
[I-ConsistentVersions] Dependency cardano-prelude:lib is consistently unconstrained
[I-ConsistentVersions] Dependency cardano-protocol-tpraos:lib is consistently unconstrained
[I-ConsistentVersions] Dependency cardano-slotting:lib is consistently unconstrained
[I-ConsistentVersions] Dependency cardano-strict-containers:lib is consistently unconstrained
[I-ConsistentVersions] Dependency contra-tracer:lib is consistently unconstrained
[I-ConsistentVersions] Dependency cryptonite:lib is consistently constrained to >=0.25 && <0.31
[I-ConsistentVersions] Dependency data-default-class:lib is consistently unconstrained
[I-ConsistentVersions] Dependency deepseq:lib is consistently unconstrained
[I-ConsistentVersions] Dependency digest:lib is consistently unconstrained
[I-ConsistentVersions] Dependency fgl:lib is consistently unconstrained
[I-ConsistentVersions] Dependency file-embed:lib is consistently unconstrained
[I-ConsistentVersions] Dependency filelock:lib is consistently unconstrained
[I-ConsistentVersions] Dependency formatting:lib is consistently constrained to >=6.3 && <7.2
[I-ConsistentVersions] Dependency generic-random:lib is consistently unconstrained
[I-ConsistentVersions] Dependency generics-sop:lib is consistently unconstrained
[I-ConsistentVersions] Dependency graphviz:lib is consistently unconstrained
[I-ConsistentVersions] Dependency hashable:lib is consistently unconstrained
[I-ConsistentVersions] Dependency hedgehog-quickcheck:lib is consistently unconstrained
[I-ConsistentVersions] Dependency io-sim:lib is consistently unconstrained
[I-ConsistentVersions] Dependency logfloat:lib is consistently unconstrained
[I-ConsistentVersions] Dependency measures:lib is consistently unconstrained
[I-ConsistentVersions] Dependency microlens:lib is consistently unconstrained
[I-ConsistentVersions] Dependency optparse-applicative:lib is consistently unconstrained
[I-ConsistentVersions] Dependency optparse-generic:lib is consistently unconstrained
[I-ConsistentVersions] Dependency orphans-deriving-via:lib is consistently unconstrained
[I-ConsistentVersions] Dependency ouroboros-consensus-byron:lib is consistently unconstrained
[I-ConsistentVersions] Dependency ouroboros-consensus-byron-test:lib is consistently unconstrained
[I-ConsistentVersions] Dependency ouroboros-consensus-byronspec:lib is consistently unconstrained
[I-ConsistentVersions] Dependency ouroboros-consensus-cardano:lib is consistently unconstrained
[I-ConsistentVersions] Dependency ouroboros-consensus-cardano-test:lib is consistently unconstrained
[I-ConsistentVersions] Dependency ouroboros-consensus-cardano-tools:lib is consistently unconstrained
[I-ConsistentVersions] Dependency ouroboros-consensus-diffusion:lib is consistently unconstrained
[I-ConsistentVersions] Dependency ouroboros-consensus-mock:lib is consistently unconstrained
[I-ConsistentVersions] Dependency ouroboros-consensus-mock-test:lib is consistently unconstrained
[I-ConsistentVersions] Dependency ouroboros-consensus-protocol:lib is consistently unconstrained
[I-ConsistentVersions] Dependency ouroboros-consensus-protocol:lib:ouroboros-consensus-protocol-test is consistently unconstrained
[I-ConsistentVersions] Dependency ouroboros-consensus-shelley:lib is consistently unconstrained
[I-ConsistentVersions] Dependency ouroboros-consensus-shelley-test:lib is consistently unconstrained
[I-ConsistentVersions] Dependency ouroboros-consensus-test:lib is consistently unconstrained
[I-ConsistentVersions] Dependency ouroboros-network-mock:lib is consistently unconstrained
[I-ConsistentVersions] Dependency ouroboros-network-protocols:lib:testlib is consistently unconstrained
[I-ConsistentVersions] Dependency pretty-show:lib is consistently unconstrained
[I-ConsistentVersions] Dependency psqueues:lib is consistently constrained to >=0.2.3 && <0.3
[I-ConsistentVersions] Dependency random:lib is consistently unconstrained
[I-ConsistentVersions] Dependency resourcet:lib is consistently unconstrained
[I-ConsistentVersions] Dependency semialign:lib is consistently constrained to >=1.1
[I-ConsistentVersions] Dependency small-steps:lib is consistently unconstrained
[I-ConsistentVersions] Dependency small-steps-test:lib is consistently unconstrained
[I-ConsistentVersions] Dependency statistics:lib is consistently unconstrained
[I-ConsistentVersions] Dependency streaming:lib is consistently unconstrained
[I-ConsistentVersions] Dependency strict-stm:lib is consistently constrained to ^>=0.2
[I-ConsistentVersions] Dependency tasty:lib is consistently unconstrained
[I-ConsistentVersions] Dependency tasty-golden:lib is consistently unconstrained
[I-ConsistentVersions] Dependency tasty-hunit:lib is consistently unconstrained
[I-ConsistentVersions] Dependency tasty-quickcheck:lib is consistently unconstrained
[I-ConsistentVersions] Dependency template-haskell:lib is consistently unconstrained
[I-ConsistentVersions] Dependency temporary:lib is consistently unconstrained
[I-ConsistentVersions] Dependency these:lib is consistently constrained to >=1.1 && <1.2
[I-ConsistentVersions] Dependency time:lib is consistently unconstrained
[I-ConsistentVersions] Dependency transformers:lib is consistently unconstrained
[I-ConsistentVersions] Dependency transformers-except:lib is consistently unconstrained
[I-ConsistentVersions] Dependency tree-diff:lib is consistently unconstrained
[I-ConsistentVersions] Dependency typed-protocols:lib is consistently unconstrained
[I-ConsistentVersions] Dependency unix:lib is consistently unconstrained
[I-ConsistentVersions] Dependency unix-bytestring:lib is consistently unconstrained
[I-ConsistentVersions] Dependency utf8-string:lib is consistently unconstrained
[I-ConsistentVersions] Dependency vector-map:lib is consistently unconstrained
[E-InconsistentVersions] Dependency base:lib is unconstrained in component test:test of package ouroboros-consensus-byron-test/ouroboros-consensus-byron-test.cabal, component exe:db-converter of package ouroboros-consensus-byron/ouroboros-consensus-byron.cabal, component lib of package ouroboros-consensus-cardano-test/ouroboros-consensus-cardano-test.cabal, component test:test of package ouroboros-consensus-cardano-test/ouroboros-consensus-cardano-test.cabal, component lib of package ouroboros-consensus-cardano-tools/ouroboros-consensus-cardano-tools.cabal, component exe:db-analyser of package ouroboros-consensus-cardano-tools/ouroboros-consensus-cardano-tools.cabal, component exe:db-synthesizer of package ouroboros-consensus-cardano-tools/ouroboros-consensus-cardano-tools.cabal, component test:test of package ouroboros-consensus-cardano-tools/ouroboros-consensus-cardano-tools.cabal, component test:test of package ouroboros-consensus-mock-test/ouroboros-consensus-mock-test.cabal, component lib of package ouroboros-consensus-protocol/ouroboros-consensus-protocol.cabal, component lib:ouroboros-consensus-protocol-test of package ouroboros-consensus-protocol/ouroboros-consensus-protocol.cabal, component test:test of package ouroboros-consensus-shelley-test/ouroboros-consensus-shelley-test.cabal, component test:test-consensus of package ouroboros-consensus-test/ouroboros-consensus-test.cabal, component test:test-infra of package ouroboros-consensus-test/ouroboros-consensus-test.cabal, component test:test-storage of package ouroboros-consensus-test/ouroboros-consensus-test.cabal
but constrained to ^>=4.14.1.0 in component exe:unsoundswitch of package ouroboros-consensus/docs/report/unsoundswitch/unsoundswitch.cabal
but constrained to >=4.9 && <4.17 in component lib of package ouroboros-consensus-byron-test/ouroboros-consensus-byron-test.cabal, component lib of package ouroboros-consensus-byron/ouroboros-consensus-byron.cabal, component lib of package ouroboros-consensus-byronspec/ouroboros-consensus-byronspec.cabal, component lib of package ouroboros-consensus-cardano/ouroboros-consensus-cardano.cabal, component lib of package ouroboros-consensus-diffusion/ouroboros-consensus-diffusion.cabal, component lib of package ouroboros-consensus-mock-test/ouroboros-consensus-mock-test.cabal, component lib of package ouroboros-consensus-mock/ouroboros-consensus-mock.cabal, component lib of package ouroboros-consensus-shelley-test/ouroboros-consensus-shelley-test.cabal, component lib of package ouroboros-consensus-shelley/ouroboros-consensus-shelley.cabal, component lib of package ouroboros-consensus-test/ouroboros-consensus-test.cabal, component lib of package ouroboros-consensus/ouroboros-consensus.cabal
[E-InconsistentVersions] Dependency base16-bytestring:lib is unconstrained in component lib of package ouroboros-consensus-test/ouroboros-consensus-test.cabal, component lib of package ouroboros-consensus/ouroboros-consensus.cabal
but constrained to >=1.0 in component lib of package ouroboros-consensus-cardano-tools/ouroboros-consensus-cardano-tools.cabal
[E-InconsistentVersions] Dependency binary:lib is unconstrained in component lib of package ouroboros-consensus-test/ouroboros-consensus-test.cabal, component test:test-consensus of package ouroboros-consensus-test/ouroboros-consensus-test.cabal, component test:test-storage of package ouroboros-consensus-test/ouroboros-consensus-test.cabal
but constrained to >=0.8 && <0.11 in component lib of package ouroboros-consensus/ouroboros-consensus.cabal
[E-InconsistentVersions] Dependency bytestring:lib is unconstrained in component test:test of package ouroboros-consensus-byron-test/ouroboros-consensus-byron-test.cabal, component exe:db-converter of package ouroboros-consensus-byron/ouroboros-consensus-byron.cabal, component test:test of package ouroboros-consensus-cardano-test/ouroboros-consensus-cardano-test.cabal, component lib of package ouroboros-consensus-cardano-tools/ouroboros-consensus-cardano-tools.cabal, component exe:db-synthesizer of package ouroboros-consensus-cardano-tools/ouroboros-consensus-cardano-tools.cabal, component test:test of package ouroboros-consensus-mock-test/ouroboros-consensus-mock-test.cabal, component lib of package ouroboros-consensus-protocol/ouroboros-consensus-protocol.cabal, component lib:ouroboros-consensus-protocol-test of package ouroboros-consensus-protocol/ouroboros-consensus-protocol.cabal, component test:test of package ouroboros-consensus-shelley-test/ouroboros-consensus-shelley-test.cabal, component test:test-consensus of package ouroboros-consensus-test/ouroboros-consensus-test.cabal, component test:test-storage of package ouroboros-consensus-test/ouroboros-consensus-test.cabal
but constrained to >=0.10 && <0.12 in component lib of package ouroboros-consensus-byron-test/ouroboros-consensus-byron-test.cabal, component lib of package ouroboros-consensus-byron/ouroboros-consensus-byron.cabal, component lib of package ouroboros-consensus-cardano/ouroboros-consensus-cardano.cabal, component lib of package ouroboros-consensus-diffusion/ouroboros-consensus-diffusion.cabal, component lib of package ouroboros-consensus-mock-test/ouroboros-consensus-mock-test.cabal, component lib of package ouroboros-consensus-mock/ouroboros-consensus-mock.cabal, component lib of package ouroboros-consensus-shelley-test/ouroboros-consensus-shelley-test.cabal, component lib of package ouroboros-consensus-shelley/ouroboros-consensus-shelley.cabal, component lib of package ouroboros-consensus-test/ouroboros-consensus-test.cabal, component lib of package ouroboros-consensus/ouroboros-consensus.cabal
[E-InconsistentVersions] Dependency cborg:lib is unconstrained in component test:test of package ouroboros-consensus-byron-test/ouroboros-consensus-byron-test.cabal, component test:test of package ouroboros-consensus-cardano-test/ouroboros-consensus-cardano-test.cabal, component lib of package ouroboros-consensus-cardano-tools/ouroboros-consensus-cardano-tools.cabal, component lib of package ouroboros-consensus-diffusion/ouroboros-consensus-diffusion.cabal, component test:test of package ouroboros-consensus-mock-test/ouroboros-consensus-mock-test.cabal, component lib of package ouroboros-consensus-protocol/ouroboros-consensus-protocol.cabal, component test:test of package ouroboros-consensus-shelley-test/ouroboros-consensus-shelley-test.cabal, component test:test-consensus of package ouroboros-consensus-test/ouroboros-consensus-test.cabal, component test:test-storage of package ouroboros-consensus-test/ouroboros-consensus-test.cabal
but constrained to >=0.2.2 && <0.3 in component lib of package ouroboros-consensus-byron/ouroboros-consensus-byron.cabal, component lib of package ouroboros-consensus-byronspec/ouroboros-consensus-byronspec.cabal, component lib of package ouroboros-consensus-cardano/ouroboros-consensus-cardano.cabal, component lib of package ouroboros-consensus-mock/ouroboros-consensus-mock.cabal, component lib of package ouroboros-consensus-shelley/ouroboros-consensus-shelley.cabal, component lib of package ouroboros-consensus-test/ouroboros-consensus-test.cabal, component lib of package ouroboros-consensus/ouroboros-consensus.cabal
[E-InconsistentVersions] Dependency containers:lib is unconstrained in component test:test of package ouroboros-consensus-byron-test/ouroboros-consensus-byron-test.cabal, component lib of package ouroboros-consensus-cardano-test/ouroboros-consensus-cardano-test.cabal, component test:test of package ouroboros-consensus-cardano-test/ouroboros-consensus-cardano-test.cabal, component lib of package ouroboros-consensus-cardano-tools/ouroboros-consensus-cardano-tools.cabal, component lib of package ouroboros-consensus-diffusion/ouroboros-consensus-diffusion.cabal, component test:test of package ouroboros-consensus-mock-test/ouroboros-consensus-mock-test.cabal, component lib of package ouroboros-consensus-protocol/ouroboros-consensus-protocol.cabal, component test:test of package ouroboros-consensus-shelley-test/ouroboros-consensus-shelley-test.cabal, component test:test-consensus of package ouroboros-consensus-test/ouroboros-consensus-test.cabal, component test:test-storage of package ouroboros-consensus-test/ouroboros-consensus-test.cabal
but constrained to >=0.5 && <0.7 in component lib of package ouroboros-consensus-byron-test/ouroboros-consensus-byron-test.cabal, component lib of package ouroboros-consensus-byron/ouroboros-consensus-byron.cabal, component lib of package ouroboros-consensus-byronspec/ouroboros-consensus-byronspec.cabal, component lib of package ouroboros-consensus-cardano/ouroboros-consensus-cardano.cabal, component lib of package ouroboros-consensus-mock-test/ouroboros-consensus-mock-test.cabal, component lib of package ouroboros-consensus-mock/ouroboros-consensus-mock.cabal, component lib of package ouroboros-consensus-shelley-test/ouroboros-consensus-shelley-test.cabal, component lib of package ouroboros-consensus-shelley/ouroboros-consensus-shelley.cabal, component lib of package ouroboros-consensus-test/ouroboros-consensus-test.cabal, component lib of package ouroboros-consensus/ouroboros-consensus.cabal
[E-InconsistentVersions] Dependency directory:lib is unconstrained in component exe:db-converter of package ouroboros-consensus-byron/ouroboros-consensus-byron.cabal, component lib of package ouroboros-consensus-cardano-tools/ouroboros-consensus-cardano-tools.cabal, component exe:db-synthesizer of package ouroboros-consensus-cardano-tools/ouroboros-consensus-cardano-tools.cabal, component lib of package ouroboros-consensus-test/ouroboros-consensus-test.cabal, component test:test-consensus of package ouroboros-consensus-test/ouroboros-consensus-test.cabal, component test:test-storage of package ouroboros-consensus-test/ouroboros-consensus-test.cabal
but constrained to >=1.3 && <1.4 in component lib of package ouroboros-consensus/ouroboros-consensus.cabal
[E-InconsistentVersions] Dependency filepath:lib is unconstrained in component test:test of package ouroboros-consensus-byron-test/ouroboros-consensus-byron-test.cabal, component exe:db-converter of package ouroboros-consensus-byron/ouroboros-consensus-byron.cabal, component test:test of package ouroboros-consensus-cardano-test/ouroboros-consensus-cardano-test.cabal, component lib of package ouroboros-consensus-cardano-tools/ouroboros-consensus-cardano-tools.cabal, component exe:db-synthesizer of package ouroboros-consensus-cardano-tools/ouroboros-consensus-cardano-tools.cabal, component lib of package ouroboros-consensus-diffusion/ouroboros-consensus-diffusion.cabal, component test:test of package ouroboros-consensus-shelley-test/ouroboros-consensus-shelley-test.cabal, component lib of package ouroboros-consensus-test/ouroboros-consensus-test.cabal
but constrained to >=1.4 && <1.5 in component lib of package ouroboros-consensus/ouroboros-consensus.cabal
[E-InconsistentVersions] Dependency io-classes:lib is unconstrained in component lib of package ouroboros-consensus-test/ouroboros-consensus-test.cabal, component test:test-consensus of package ouroboros-consensus-test/ouroboros-consensus-test.cabal, component test:test-storage of package ouroboros-consensus-test/ouroboros-consensus-test.cabal
but constrained to ^>=0.3 in component lib of package ouroboros-consensus-diffusion/ouroboros-consensus-diffusion.cabal, component lib of package ouroboros-consensus/ouroboros-consensus.cabal
[E-InconsistentVersions] Dependency mtl:lib is unconstrained in component test:test of package ouroboros-consensus-byron-test/ouroboros-consensus-byron-test.cabal, component exe:db-converter of package ouroboros-consensus-byron/ouroboros-consensus-byron.cabal, component lib of package ouroboros-consensus-cardano-test/ouroboros-consensus-cardano-test.cabal, component lib of package ouroboros-consensus-cardano-tools/ouroboros-consensus-cardano-tools.cabal, component lib of package ouroboros-consensus-diffusion/ouroboros-consensus-diffusion.cabal, component lib of package ouroboros-consensus-protocol/ouroboros-consensus-protocol.cabal, component test:test-consensus of package ouroboros-consensus-test/ouroboros-consensus-test.cabal, component test:test-storage of package ouroboros-consensus-test/ouroboros-consensus-test.cabal
but constrained to >=2.2 && <2.3 in component lib of package ouroboros-consensus-byron-test/ouroboros-consensus-byron-test.cabal, component lib of package ouroboros-consensus-byron/ouroboros-consensus-byron.cabal, component lib of package ouroboros-consensus-byronspec/ouroboros-consensus-byronspec.cabal, component lib of package ouroboros-consensus-cardano/ouroboros-consensus-cardano.cabal, component lib of package ouroboros-consensus-mock/ouroboros-consensus-mock.cabal, component lib of package ouroboros-consensus-shelley-test/ouroboros-consensus-shelley-test.cabal, component lib of package ouroboros-consensus-shelley/ouroboros-consensus-shelley.cabal, component lib of package ouroboros-consensus-test/ouroboros-consensus-test.cabal, component lib of package ouroboros-consensus/ouroboros-consensus.cabal
[E-InconsistentVersions] Dependency nothunks:lib is unconstrained in component lib of package ouroboros-consensus-byron/ouroboros-consensus-byron.cabal, component lib of package ouroboros-consensus-byronspec/ouroboros-consensus-byronspec.cabal, component lib of package ouroboros-consensus-cardano-tools/ouroboros-consensus-cardano-tools.cabal, component lib of package ouroboros-consensus-cardano/ouroboros-consensus-cardano.cabal, component lib of package ouroboros-consensus-mock/ouroboros-consensus-mock.cabal, component lib of package ouroboros-consensus-protocol/ouroboros-consensus-protocol.cabal, component lib of package ouroboros-consensus-shelley/ouroboros-consensus-shelley.cabal, component lib of package ouroboros-consensus-test/ouroboros-consensus-test.cabal, component test:test-consensus of package ouroboros-consensus-test/ouroboros-consensus-test.cabal, component test:test-storage of package ouroboros-consensus-test/ouroboros-consensus-test.cabal
but constrained to >=0.1.2 && <0.2 in component lib of package ouroboros-consensus/ouroboros-consensus.cabal
[E-InconsistentVersions] Dependency ouroboros-consensus:lib is unconstrained in component lib of package ouroboros-consensus-byron-test/ouroboros-consensus-byron-test.cabal, component test:test of package ouroboros-consensus-byron-test/ouroboros-consensus-byron-test.cabal, component lib of package ouroboros-consensus-byron/ouroboros-consensus-byron.cabal, component exe:db-converter of package ouroboros-consensus-byron/ouroboros-consensus-byron.cabal, component lib of package ouroboros-consensus-byronspec/ouroboros-consensus-byronspec.cabal, component lib of package ouroboros-consensus-cardano-test/ouroboros-consensus-cardano-test.cabal, component test:test of package ouroboros-consensus-cardano-test/ouroboros-consensus-cardano-test.cabal, component lib of package ouroboros-consensus-cardano-tools/ouroboros-consensus-cardano-tools.cabal, component exe:db-analyser of package ouroboros-consensus-cardano-tools/ouroboros-consensus-cardano-tools.cabal, component exe:db-synthesizer of package ouroboros-consensus-cardano-tools/ouroboros-consensus-cardano-tools.cabal, component lib of package ouroboros-consensus-cardano/ouroboros-consensus-cardano.cabal, component lib of package ouroboros-consensus-mock-test/ouroboros-consensus-mock-test.cabal, component test:test of package ouroboros-consensus-mock-test/ouroboros-consensus-mock-test.cabal, component lib of package ouroboros-consensus-mock/ouroboros-consensus-mock.cabal, component lib of package ouroboros-consensus-protocol/ouroboros-consensus-protocol.cabal, component lib of package ouroboros-consensus-shelley-test/ouroboros-consensus-shelley-test.cabal, component test:test of package ouroboros-consensus-shelley-test/ouroboros-consensus-shelley-test.cabal, component lib of package ouroboros-consensus-shelley/ouroboros-consensus-shelley.cabal, component lib of package ouroboros-consensus-test/ouroboros-consensus-test.cabal, component test:test-consensus of package ouroboros-consensus-test/ouroboros-consensus-test.cabal, component test:test-infra of package ouroboros-consensus-test/ouroboros-consensus-test.cabal, component test:test-storage of package ouroboros-consensus-test/ouroboros-consensus-test.cabal
but constrained to ^>=0.1 in component lib of package ouroboros-consensus-diffusion/ouroboros-consensus-diffusion.cabal
[E-InconsistentVersions] Dependency ouroboros-network:lib is unconstrained in component exe:db-converter of package ouroboros-consensus-byron/ouroboros-consensus-byron.cabal, component lib of package ouroboros-consensus-byronspec/ouroboros-consensus-byronspec.cabal, component lib of package ouroboros-consensus-cardano/ouroboros-consensus-cardano.cabal, component lib of package ouroboros-consensus-test/ouroboros-consensus-test.cabal, component test:test-consensus of package ouroboros-consensus-test/ouroboros-consensus-test.cabal
but constrained to ^>=0.2 in component lib of package ouroboros-consensus-diffusion/ouroboros-consensus-diffusion.cabal
[E-InconsistentVersions] Dependency ouroboros-network-api:lib is unconstrained in component lib of package ouroboros-consensus-byron-test/ouroboros-consensus-byron-test.cabal, component lib of package ouroboros-consensus-byron/ouroboros-consensus-byron.cabal, component lib of package ouroboros-consensus-cardano-test/ouroboros-consensus-cardano-test.cabal, component test:test of package ouroboros-consensus-cardano-test/ouroboros-consensus-cardano-test.cabal, component lib of package ouroboros-consensus-cardano-tools/ouroboros-consensus-cardano-tools.cabal, component lib of package ouroboros-consensus-mock/ouroboros-consensus-mock.cabal, component lib of package ouroboros-consensus-shelley-test/ouroboros-consensus-shelley-test.cabal, component lib of package ouroboros-consensus-shelley/ouroboros-consensus-shelley.cabal, component lib of package ouroboros-consensus-test/ouroboros-consensus-test.cabal, component test:test-consensus of package ouroboros-consensus-test/ouroboros-consensus-test.cabal, component test:test-storage of package ouroboros-consensus-test/ouroboros-consensus-test.cabal, component lib of package ouroboros-consensus/ouroboros-consensus.cabal
but constrained to ^>=0.1 in component lib of package ouroboros-consensus-diffusion/ouroboros-consensus-diffusion.cabal
[E-InconsistentVersions] Dependency ouroboros-network-framework:lib is unconstrained in component lib of package ouroboros-consensus-test/ouroboros-consensus-test.cabal, component test:test-consensus of package ouroboros-consensus-test/ouroboros-consensus-test.cabal
but constrained to ^>=0.2 in component lib of package ouroboros-consensus-diffusion/ouroboros-consensus-diffusion.cabal
[E-InconsistentVersions] Dependency ouroboros-network-protocols:lib is unconstrained in component lib of package ouroboros-consensus-byron-test/ouroboros-consensus-byron-test.cabal, component lib of package ouroboros-consensus-byron/ouroboros-consensus-byron.cabal, component lib of package ouroboros-consensus-cardano-test/ouroboros-consensus-cardano-test.cabal, component test:test of package ouroboros-consensus-cardano-test/ouroboros-consensus-cardano-test.cabal, component lib of package ouroboros-consensus-cardano-tools/ouroboros-consensus-cardano-tools.cabal, component test:test of package ouroboros-consensus-mock-test/ouroboros-consensus-mock-test.cabal, component lib of package ouroboros-consensus-mock/ouroboros-consensus-mock.cabal, component lib of package ouroboros-consensus-shelley-test/ouroboros-consensus-shelley-test.cabal, component test:test of package ouroboros-consensus-shelley-test/ouroboros-consensus-shelley-test.cabal, component lib of package ouroboros-consensus-shelley/ouroboros-consensus-shelley.cabal, component lib of package ouroboros-consensus-test/ouroboros-consensus-test.cabal, component test:test-consensus of package ouroboros-consensus-test/ouroboros-consensus-test.cabal, component test:test-storage of package ouroboros-consensus-test/ouroboros-consensus-test.cabal
but constrained to ^>=0.2 in component lib of package ouroboros-consensus-diffusion/ouroboros-consensus-diffusion.cabal, component lib of package ouroboros-consensus/ouroboros-consensus.cabal
[E-InconsistentVersions] Dependency quickcheck-state-machine:lib is unconstrained in component lib of package ouroboros-consensus-test/ouroboros-consensus-test.cabal, component test:test-consensus of package ouroboros-consensus-test/ouroboros-consensus-test.cabal
but constrained to >=0.7.0 in component test:test-storage of package ouroboros-consensus-test/ouroboros-consensus-test.cabal
[E-InconsistentVersions] Dependency quiet:lib is unconstrained in component test:test-consensus of package ouroboros-consensus-test/ouroboros-consensus-test.cabal
but constrained to >=0.2 && <0.3 in component lib of package ouroboros-consensus-shelley-test/ouroboros-consensus-shelley-test.cabal, component lib of package ouroboros-consensus-test/ouroboros-consensus-test.cabal, component lib of package ouroboros-consensus/ouroboros-consensus.cabal
[E-InconsistentVersions] Dependency serialise:lib is unconstrained in component lib of package ouroboros-consensus-cardano-tools/ouroboros-consensus-cardano-tools.cabal, component test:test of package ouroboros-consensus-mock-test/ouroboros-consensus-mock-test.cabal, component lib of package ouroboros-consensus-protocol/ouroboros-consensus-protocol.cabal, component test:test-consensus of package ouroboros-consensus-test/ouroboros-consensus-test.cabal, component test:test-storage of package ouroboros-consensus-test/ouroboros-consensus-test.cabal
but constrained to >=0.2 && <0.3 in component lib of package ouroboros-consensus-byron-test/ouroboros-consensus-byron-test.cabal, component lib of package ouroboros-consensus-byron/ouroboros-consensus-byron.cabal, component lib of package ouroboros-consensus-byronspec/ouroboros-consensus-byronspec.cabal, component lib of package ouroboros-consensus-diffusion/ouroboros-consensus-diffusion.cabal, component lib of package ouroboros-consensus-mock-test/ouroboros-consensus-mock-test.cabal, component lib of package ouroboros-consensus-mock/ouroboros-consensus-mock.cabal, component lib of package ouroboros-consensus-shelley/ouroboros-consensus-shelley.cabal, component lib of package ouroboros-consensus-test/ouroboros-consensus-test.cabal, component lib of package ouroboros-consensus/ouroboros-consensus.cabal
[E-InconsistentVersions] Dependency sop-core:lib is unconstrained in component lib of package ouroboros-consensus-cardano-test/ouroboros-consensus-cardano-test.cabal, component test:test of package ouroboros-consensus-cardano-test/ouroboros-consensus-cardano-test.cabal, component lib of package ouroboros-consensus-test/ouroboros-consensus-test.cabal, component test:test-consensus of package ouroboros-consensus-test/ouroboros-consensus-test.cabal
but constrained to >=0.5 && <0.6 in component lib of package ouroboros-consensus/ouroboros-consensus.cabal
[E-InconsistentVersions] Dependency text:lib is unconstrained in component exe:db-converter of package ouroboros-consensus-byron/ouroboros-consensus-byron.cabal, component lib of package ouroboros-consensus-cardano-tools/ouroboros-consensus-cardano-tools.cabal, component lib of package ouroboros-consensus-diffusion/ouroboros-consensus-diffusion.cabal, component lib of package ouroboros-consensus-protocol/ouroboros-consensus-protocol.cabal, component test:test-storage of package ouroboros-consensus-test/ouroboros-consensus-test.cabal
but constrained to >=1.2 && <1.3 in component lib of package ouroboros-consensus-byron/ouroboros-consensus-byron.cabal, component lib of package ouroboros-consensus-shelley/ouroboros-consensus-shelley.cabal, component lib of package ouroboros-consensus-test/ouroboros-consensus-test.cabal, component lib of package ouroboros-consensus/ouroboros-consensus.cabal
[E-InconsistentVersions] Dependency vector:lib is unconstrained in component test:test-storage of package ouroboros-consensus-test/ouroboros-consensus-test.cabal
but constrained to >=0.12 && <0.13 in component lib of package ouroboros-consensus/ouroboros-consensus.cabal
[E-InconsistentLanguages] The default language is unset in component lib of package ouroboros-consensus-byron/ouroboros-consensus-byron.cabal, component lib of package ouroboros-consensus-cardano-tools/ouroboros-consensus-cardano-tools.cabal, component lib of package ouroboros-consensus-cardano/ouroboros-consensus-cardano.cabal, component lib of package ouroboros-consensus-mock/ouroboros-consensus-mock.cabal, component lib of package ouroboros-consensus-protocol/ouroboros-consensus-protocol.cabal, component lib of package ouroboros-consensus-shelley/ouroboros-consensus-shelley.cabal, component lib of package ouroboros-consensus/ouroboros-consensus.cabal
but set to Haskell2010 in component lib of package ouroboros-consensus-byron-test/ouroboros-consensus-byron-test.cabal, component test:test of package ouroboros-consensus-byron-test/ouroboros-consensus-byron-test.cabal, component lib of package ouroboros-consensus-byron/ouroboros-consensus-byron.cabal, component exe:db-converter of package ouroboros-consensus-byron/ouroboros-consensus-byron.cabal, component lib of package ouroboros-consensus-byronspec/ouroboros-consensus-byronspec.cabal, component lib of package ouroboros-consensus-cardano-test/ouroboros-consensus-cardano-test.cabal, component test:test of package ouroboros-consensus-cardano-test/ouroboros-consensus-cardano-test.cabal, component lib of package ouroboros-consensus-cardano-tools/ouroboros-consensus-cardano-tools.cabal, component exe:db-analyser of package ouroboros-consensus-cardano-tools/ouroboros-consensus-cardano-tools.cabal, component exe:db-synthesizer of package ouroboros-consensus-cardano-tools/ouroboros-consensus-cardano-tools.cabal, component test:test of package ouroboros-consensus-cardano-tools/ouroboros-consensus-cardano-tools.cabal, component lib of package ouroboros-consensus-cardano/ouroboros-consensus-cardano.cabal, component lib of package ouroboros-consensus-diffusion/ouroboros-consensus-diffusion.cabal, component lib of package ouroboros-consensus-mock-test/ouroboros-consensus-mock-test.cabal, component test:test of package ouroboros-consensus-mock-test/ouroboros-consensus-mock-test.cabal, component lib of package ouroboros-consensus-mock/ouroboros-consensus-mock.cabal, component lib of package ouroboros-consensus-protocol/ouroboros-consensus-protocol.cabal, component lib:ouroboros-consensus-protocol-test of package ouroboros-consensus-protocol/ouroboros-consensus-protocol.cabal, component lib of package ouroboros-consensus-shelley-test/ouroboros-consensus-shelley-test.cabal, component test:test of package ouroboros-consensus-shelley-test/ouroboros-consensus-shelley-test.cabal, component lib of package ouroboros-consensus-shelley/ouroboros-consensus-shelley.cabal, component lib of package ouroboros-consensus-test/ouroboros-consensus-test.cabal, component test:test-consensus of package ouroboros-consensus-test/ouroboros-consensus-test.cabal, component test:test-infra of package ouroboros-consensus-test/ouroboros-consensus-test.cabal, component test:test-storage of package ouroboros-consensus-test/ouroboros-consensus-test.cabal, component exe:unsoundswitch of package ouroboros-consensus/docs/report/unsoundswitch/unsoundswitch.cabal, component lib of package ouroboros-consensus/ouroboros-consensus.cabal
$ echo $?
1
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That output raises one main question: do we want to introduce a new invariant, requiring that every dependency lists non-empty bounds?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
FWIW, the any PVP compliant package must give lower and upper bounds on all of its dependencies. So this might be a natural invariant to enforce, if we fully embrace PVP.
0f8de31
to
bcde684
Compare
@@ -0,0 +1,64 @@ | |||
cabal-version: 3.0 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Question for the reviewers: how much of the wheel did we I just reinvent? Does a cabal
linter already exist that we could enrich with any of our desiderata instead of implementing our own thusly? Or is this thing small enough as-is that, regardless of other projects, we'd like to have one tool narrowly-focused on our concerns?
Update: so far no one knows of existing alternatives nor reasons why no alternative exists.
bcde684
to
4f9d0fe
Compare
@@ -0,0 +1,45 @@ | |||
module Cabal.Lint.Summygroup ( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Question for the reviewers: does this class already exist in the ecosystem? If not, what's a better name than Summygroup
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Whether something similar exists, I don't know. I wonder what the advantage of this class is to using modifiers like Min a
or Max a
? Also, set intersection is still assocative, so we won't lose Semigroup
properties in the instsance for Summygroup (Always a)
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I agree with @jorisdral, my gut reaction would be to use a MonoidalMap
(defined locally or via monoidal-containers
) as well as an adapter that gives Map
a Semigroup
via intersectionWith (<>)
and then define
type MultiSet a = MonoidalMap a (Sum Int)
type Always a = IntersectionMonoid (MonoidalMap a (Min Int))
type Sometimes a = MonoidalMap a (Max Int)
which are pairwise coerce
ible.
As for the use case of writing generic code that is polymorphic in (Semigroup m, Summygroup m)
: This would probably first require finding out sensible laws how (<>)
and (<+>)
shall interact (i.e. some distributivity, otherwise, it seems too ad-hoc). Maybe they form a Semiring
?
In any case, parameterizing goTree
/goBranch
by an extra argument m -> m -> m
instead of Summygroup
(that is instantiated with coerce (<>) @...
) is another alternative.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I.e. maybe we can lift tropical semirings (also in Haskell) to Map
s? cc @bartfrenk
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Esgen and I chatted about this on our call today. See the new Haddock on the class for what we came up with.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Whether something similar exists, I don't know. I wonder what the advantage of this class is to using modifiers like
Min a
orMax a
.
-
My
a
types are not numbers, so I can't rely onMin
orMax
per se. My types are sets, maps of non-empty sets, tuples thereof, etc. -
So maybe I define my own more general newtypes
Minny
andMaxxy
. But at that point, I think I'd be relying on(Semigroup . Minny)
or whatever in just the same way as I'm relying onSummygroup
, wouldn't I?
The a
is the result of the tool's various analyses of the Cabal AST. The way I think about it as that that analysis codomain needs combinators for both juxtaposition (I use Monoid
for this) and combination of branches (I use Summygroup
for this).
5446bcc
to
03d763a
Compare
03d763a
to
c0d484c
Compare
MY only question is, why is this in the |
copyright: 2022 Input Output (Hong Kong) Ltd. | ||
author: IOHK Engineering Team | ||
maintainer: [email protected] | ||
category: Network |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
cabal-install
uses Distribution
, hlint
uses Development
, maybe pick one of the two?
@@ -0,0 +1,45 @@ | |||
module Cabal.Lint.Summygroup ( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Whether something similar exists, I don't know. I wonder what the advantage of this class is to using modifiers like Min a
or Max a
? Also, set intersection is still assocative, so we won't lose Semigroup
properties in the instsance for Summygroup (Always a)
.
-- | This module defines wrappers with arbitrary 'Ord' instances around types | ||
-- for which @Cabal@ does not derive 'Ord'; we only use these to put these | ||
-- types in maps, sets, etc. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do you mean by this that the instances don't follow Ord
type class laws?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No; the Ord
instances here are sound. But the Cabal
devs have chosen for some reason to not have them.
I assume that means these Ord
instances are sound only if you're ignoring the data types' other semantics (ie it's a syntactical Ord
).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks good, however I agree with @erikd that this can be a general tool for Haskell.
Note that this tool already uses I think the question was in the larger context of whether something like |
Closing; migrated to IntersectMBO/ouroboros-consensus#486 |
This PR adds the
cabal-lint
tool. The Consensus team is going to use this to enforce invariants amongst our.cabal
files that will help us maintain them given our new reliance on CHaP.