Skip to content

Commit

Permalink
Mark public libs as an experimental feature
Browse files Browse the repository at this point in the history
  • Loading branch information
phadej committed Mar 22, 2020
1 parent 5392ac8 commit d2a895f
Show file tree
Hide file tree
Showing 11 changed files with 52 additions and 0 deletions.
4 changes: 4 additions & 0 deletions Cabal/Cabal.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -215,6 +215,10 @@ extra-source-files:
tests/ParserTests/regressions/pre-1.6-glob.check
tests/ParserTests/regressions/pre-2.4-globstar.cabal
tests/ParserTests/regressions/pre-2.4-globstar.check
tests/ParserTests/regressions/public-multilib-1.cabal
tests/ParserTests/regressions/public-multilib-1.check
tests/ParserTests/regressions/public-multilib-2.cabal
tests/ParserTests/regressions/public-multilib-2.check
tests/ParserTests/regressions/shake.cabal
tests/ParserTests/regressions/shake.expr
tests/ParserTests/regressions/shake.format
Expand Down
2 changes: 2 additions & 0 deletions Cabal/Distribution/Parsec/Warning.hs
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,8 @@ data PWarnType

| PWTVersionOperator -- ^ Version operators used (without cabal-version: 1.8)
| PWTVersionWildcard -- ^ Version wildcard used (without cabal-version: 1.6)

| PWTExperimental -- ^ Experimental feature
deriving (Eq, Ord, Show, Enum, Bounded, Generic)

instance Binary PWarnType
Expand Down
1 change: 1 addition & 0 deletions Cabal/Distribution/Types/Dependency.hs
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,7 @@ instance Parsec Dependency where
libs <- option mainLib $ do
_ <- char ':'
versionGuardMultilibs
parsecWarning PWTExperimental "colon specifier is experimental feature (issue #5660)"
Set.singleton <$> parseLib <|> parseMultipleLibs

spaces -- https://github.com/haskell/cabal/issues/5846
Expand Down
1 change: 1 addition & 0 deletions Cabal/Distribution/Types/LibraryVisibility.hs
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ instance Pretty LibraryVisibility where
instance Parsec LibraryVisibility where
parsec = do
name <- P.munch1 isAlpha
parsecWarning PWTExperimental "visibility is experimental feature (issue #5660)"
case name of
"public" -> return LibraryVisibilityPublic
"private" -> return LibraryVisibilityPrivate
Expand Down
2 changes: 2 additions & 0 deletions Cabal/tests/CheckTests.hs
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,8 @@ checkTests = testGroup "regressions"
, checkTest "ghc-option-j.cabal"
, checkTest "multiple-libs-2.cabal"
, checkTest "assoc-cpp-options.cabal"
, checkTest "public-multilib-1.cabal"
, checkTest "public-multilib-2.cabal"
]

checkTest :: FilePath -> TestTree
Expand Down
4 changes: 4 additions & 0 deletions Cabal/tests/ParserTests/regressions/issue-5846.format
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
issue-5846.cabal:11:23: colon specifier is experimental feature (issue #5660)
issue-5846.cabal:10:23: colon specifier is experimental feature (issue #5660)
issue-5846.cabal:7:23: colon specifier is experimental feature (issue #5660)
issue-5846.cabal:8:23: colon specifier is experimental feature (issue #5660)
cabal-version: 3.0
name: issue
version: 5846
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
issue-6083-pkg-pkg.cabal:9:27: colon specifier is experimental feature (issue #5660)
cabal-version: 3.0
name: issue
version: 6083
Expand Down
17 changes: 17 additions & 0 deletions Cabal/tests/ParserTests/regressions/public-multilib-1.cabal
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
cabal-version: 3.0
name: public-multilib1
version: 0
synopsis: public-multilibs are not polished enough for Hackage
category: Tests
license: MIT

library
default-language: Haskell2010
build-depends: base ^>=4.14, internal
exposed-modules: Foo

library internal
default-language: Haskell2010
build-depends: base ^>=4.14
visibility: public
exposed-modules: Bar
3 changes: 3 additions & 0 deletions Cabal/tests/ParserTests/regressions/public-multilib-1.check
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
public-multilib-1.cabal:16:27: visibility is experimental feature (issue #5660)
No 'maintainer' field.
No 'description' field.
14 changes: 14 additions & 0 deletions Cabal/tests/ParserTests/regressions/public-multilib-2.cabal
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
cabal-version: 3.0
name: public-multilib1
version: 0
synopsis: public-multilibs are not polished enough for Hackage
category: Tests
license: MIT

library
default-language: Haskell2010
build-depends:
, base ^>=4.14
, somelib:internal

exposed-modules: Foo
3 changes: 3 additions & 0 deletions Cabal/tests/ParserTests/regressions/public-multilib-2.check
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
public-multilib-2.cabal:12:15: colon specifier is experimental feature (issue #5660)
No 'maintainer' field.
No 'description' field.

0 comments on commit d2a895f

Please sign in to comment.