Skip to content
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

Field exposed-modules is not allowed in common stanza #8551

Closed
fendor opened this issue Oct 22, 2022 · 2 comments
Closed

Field exposed-modules is not allowed in common stanza #8551

fendor opened this issue Oct 22, 2022 · 2 comments
Labels
Cabal: common stanza Concerning `common` stanzas in `.cabal` files type: enhancement

Comments

@fendor
Copy link
Collaborator

fendor commented Oct 22, 2022

Common stanzas may not define exposed-modules field.
E.g. this cabal file:

cabal-version:      3.8
name:               some-dir
version:            0.1.0.0

common warnings
    ghc-options: -Wall

common mods
    exposed-modules:
        MyLib

library
    import:           warnings, mods
    build-depends:    base
    hs-source-dirs:   src
    default-language: Haskell2010

is not what you want and you get the following:

> cabal repl
Resolving dependencies...
Build profile: -w ghc-8.10.7 -O1
In order, the following will be built (use -v for more details):
 - some-dir-0.1.0.0 (lib) (first run)
Warning: some-dir.cabal:9:5: Unknown field: "exposed-modules"
Configuring library for some-dir-0.1.0.0..
Preprocessing library for some-dir-0.1.0.0..
Warning: No exposed modules
GHCi, version 8.10.7: https://www.haskell.org/ghc/  :? for help
Prelude> :q
Leaving GHCi.

Idk whether this is simply an oversight or a design decision, but it should probably be documented here https://cabal.readthedocs.io/en/stable/cabal-package.html?highlight=common#common-stanzas

@ulysses4ever
Copy link
Collaborator

The reason it doesn't work currently, I believe, is the same as what's discussed in #6117. Time long have come to get more specialized version of common stanzas.

@ulysses4ever ulysses4ever added type: enhancement Cabal: common stanza Concerning `common` stanzas in `.cabal` files labels Oct 22, 2022
@fendor
Copy link
Collaborator Author

fendor commented Aug 23, 2024

Closing this in favour of #6117

@fendor fendor closed this as completed Aug 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Cabal: common stanza Concerning `common` stanzas in `.cabal` files type: enhancement
Projects
None yet
Development

No branches or pull requests

2 participants