Skip to content

Commit 113fe60

Browse files
committed
Mark public libs as an experimental feature
1 parent 191f073 commit 113fe60

File tree

13 files changed

+59
-1
lines changed

13 files changed

+59
-1
lines changed

Cabal/Cabal.cabal

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -215,6 +215,10 @@ extra-source-files:
215215
tests/ParserTests/regressions/pre-1.6-glob.check
216216
tests/ParserTests/regressions/pre-2.4-globstar.cabal
217217
tests/ParserTests/regressions/pre-2.4-globstar.check
218+
tests/ParserTests/regressions/public-multilib-1.cabal
219+
tests/ParserTests/regressions/public-multilib-1.check
220+
tests/ParserTests/regressions/public-multilib-2.cabal
221+
tests/ParserTests/regressions/public-multilib-2.check
218222
tests/ParserTests/regressions/shake.cabal
219223
tests/ParserTests/regressions/shake.expr
220224
tests/ParserTests/regressions/shake.format

Cabal/Distribution/InstalledPackageInfo.hs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,11 @@ parseInstalledPackageInfo s = case P.readFields s of
103103
Right fs -> case partitionFields fs of
104104
(fs', _) -> case P.runParseResult $ parseFieldGrammar cabalSpecLatest fs' ipiFieldGrammar of
105105
(ws, Right x) -> x `deepseq` Right (ws', x) where
106-
ws' = map (P.showPWarning "") ws
106+
ws' = [ P.showPWarning "" w
107+
| w@(P.PWarning wt _ _) <- ws
108+
-- filter out warnings about experimental features
109+
, wt /= P.PWTExperimental
110+
]
107111
(_, Left (_, errs)) -> Left errs' where
108112
errs' = fmap (P.showPError "") errs
109113

Cabal/Distribution/Parsec/Warning.hs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,8 @@ data PWarnType
3838

3939
| PWTVersionOperator -- ^ Version operators used (without cabal-version: 1.8)
4040
| PWTVersionWildcard -- ^ Version wildcard used (without cabal-version: 1.6)
41+
42+
| PWTExperimental -- ^ Experimental feature
4143
deriving (Eq, Ord, Show, Enum, Bounded, Generic)
4244

4345
instance Binary PWarnType

Cabal/Distribution/Types/Dependency.hs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -126,6 +126,7 @@ instance Parsec Dependency where
126126
libs <- option mainLib $ do
127127
_ <- char ':'
128128
versionGuardMultilibs
129+
parsecWarning PWTExperimental "colon specifier is experimental feature (issue #5660)"
129130
Set.singleton <$> parseLib <|> parseMultipleLibs
130131

131132
spaces -- https://github.com/haskell/cabal/issues/5846

Cabal/Distribution/Types/LibraryVisibility.hs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ instance Pretty LibraryVisibility where
3434
instance Parsec LibraryVisibility where
3535
parsec = do
3636
name <- P.munch1 isAlpha
37+
parsecWarning PWTExperimental "visibility is experimental feature (issue #5660)"
3738
case name of
3839
"public" -> return LibraryVisibilityPublic
3940
"private" -> return LibraryVisibilityPrivate

Cabal/tests/CheckTests.hs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,8 @@ checkTests = testGroup "regressions"
4040
, checkTest "ghc-option-j.cabal"
4141
, checkTest "multiple-libs-2.cabal"
4242
, checkTest "assoc-cpp-options.cabal"
43+
, checkTest "public-multilib-1.cabal"
44+
, checkTest "public-multilib-2.cabal"
4345
]
4446

4547
checkTest :: FilePath -> TestTree

Cabal/tests/ParserTests/regressions/issue-5846.format

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
issue-5846.cabal:11:23: colon specifier is experimental feature (issue #5660)
2+
issue-5846.cabal:10:23: colon specifier is experimental feature (issue #5660)
3+
issue-5846.cabal:7:23: colon specifier is experimental feature (issue #5660)
4+
issue-5846.cabal:8:23: colon specifier is experimental feature (issue #5660)
15
cabal-version: 3.0
26
name: issue
37
version: 5846

Cabal/tests/ParserTests/regressions/issue-6083-pkg-pkg.format

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
issue-6083-pkg-pkg.cabal:9:27: colon specifier is experimental feature (issue #5660)
12
cabal-version: 3.0
23
name: issue
34
version: 6083
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
cabal-version: 3.0
2+
name: public-multilib1
3+
version: 0
4+
synopsis: public-multilibs are not polished enough for Hackage
5+
category: Tests
6+
license: MIT
7+
8+
library
9+
default-language: Haskell2010
10+
build-depends: base ^>=4.14, internal
11+
exposed-modules: Foo
12+
13+
library internal
14+
default-language: Haskell2010
15+
build-depends: base ^>=4.14
16+
visibility: public
17+
exposed-modules: Bar
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
public-multilib-1.cabal:16:27: visibility is experimental feature (issue #5660)
2+
No 'maintainer' field.
3+
No 'description' field.
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
cabal-version: 3.0
2+
name: public-multilib1
3+
version: 0
4+
synopsis: public-multilibs are not polished enough for Hackage
5+
category: Tests
6+
license: MIT
7+
8+
library
9+
default-language: Haskell2010
10+
build-depends:
11+
, base ^>=4.14
12+
, somelib:internal
13+
14+
exposed-modules: Foo
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
public-multilib-2.cabal:12:15: colon specifier is experimental feature (issue #5660)
2+
No 'maintainer' field.
3+
No 'description' field.

cabal-testsuite/PackageTests/MultipleLibraries/cabal.out

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,11 @@ Build profile: -w ghc-<GHCVER> -O1
44
In order, the following will be built:
55
- d-0.1.0.0 (lib:privatelib) (first run)
66
- p-0.1.0.0 (lib) (first run)
7+
Warning: d.cabal:10:22: visibility is experimental feature (issue #5660)
78
Configuring library 'privatelib' for d-0.1.0.0..
89
Preprocessing library 'privatelib' for d-0.1.0.0..
910
Building library 'privatelib' for d-0.1.0.0..
11+
Warning: p.cabal:6:20: colon specifier is experimental feature (issue #5660)
1012
Configuring library for p-0.1.0.0..
1113
cabal: Encountered missing or private dependencies:
1214
d:{privatelib} ==0.1.0.0

0 commit comments

Comments
 (0)