Commit 113fe601 authored by Oleg Grenrus's avatar Oleg Grenrus
Browse files

Mark public libs as an experimental feature

parent 191f0732
......@@ -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
......
......@@ -103,7 +103,11 @@ parseInstalledPackageInfo s = case P.readFields s of
Right fs -> case partitionFields fs of
(fs', _) -> case P.runParseResult $ parseFieldGrammar cabalSpecLatest fs' ipiFieldGrammar of
(ws, Right x) -> x `deepseq` Right (ws', x) where
ws' = map (P.showPWarning "") ws
ws' = [ P.showPWarning "" w
| w@(P.PWarning wt _ _) <- ws
-- filter out warnings about experimental features
, wt /= P.PWTExperimental
]
(_, Left (_, errs)) -> Left errs' where
errs' = fmap (P.showPError "") errs
......
......@@ -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
......
......@@ -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
......
......@@ -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
......
......@@ -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
......
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
......
issue-6083-pkg-pkg.cabal:9:27: colon specifier is experimental feature (issue #5660)
cabal-version: 3.0
name: issue
version: 6083
......
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
public-multilib-1.cabal:16:27: visibility is experimental feature (issue #5660)
No 'maintainer' field.
No 'description' field.
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
public-multilib-2.cabal:12:15: colon specifier is experimental feature (issue #5660)
No 'maintainer' field.
No 'description' field.
......@@ -4,9 +4,11 @@ Build profile: -w ghc-<GHCVER> -O1
In order, the following will be built:
- d-0.1.0.0 (lib:privatelib) (first run)
- p-0.1.0.0 (lib) (first run)
Warning: d.cabal:10:22: visibility is experimental feature (issue #5660)
Configuring library 'privatelib' for d-0.1.0.0..
Preprocessing library 'privatelib' for d-0.1.0.0..
Building library 'privatelib' for d-0.1.0.0..
Warning: p.cabal:6:20: colon specifier is experimental feature (issue #5660)
Configuring library for p-0.1.0.0..
cabal: Encountered missing or private dependencies:
d:{privatelib} ==0.1.0.0
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment