File tree Expand file tree Collapse file tree 3 files changed +22
-4
lines changed Expand file tree Collapse file tree 3 files changed +22
-4
lines changed Original file line number Diff line number Diff line change @@ -1782,9 +1782,16 @@ showConfigWithComments comment vals =
1782
1782
(fmap (field . savedConfigureFlags) mcomment)
1783
1783
((field . savedConfigureFlags) vals)
1784
1784
1785
- -- skip fields based on field name. currently only skips "remote-repo",
1786
- -- because that is rendered as a section. (see 'ppRemoteRepoSection'.)
1787
- skipSomeFields = filter ((/= " remote-repo" ) . fieldName)
1785
+ -- Skip fields based on field name.
1786
+ skipSomeFields =
1787
+ filter
1788
+ ( ( `notElem`
1789
+ [ " remote-repo" -- rendered as a section (see 'ppRemoteRepoSection')
1790
+ , " builddir" -- no effect in config file (see Note [reading project configuration])
1791
+ ]
1792
+ )
1793
+ . fieldName
1794
+ )
1788
1795
1789
1796
-- | Fields for the 'install-dirs' sections.
1790
1797
installDirsFields :: [FieldDescr (InstallDirs (Flag PathTemplate ))]
Original file line number Diff line number Diff line change @@ -2675,7 +2675,6 @@ testConfigOptionComments = do
2675
2675
" -- username" `assertHasCommentLine` " username"
2676
2676
" -- password" `assertHasCommentLine` " password"
2677
2677
" -- password-command" `assertHasCommentLine` " password-command"
2678
- " -- builddir" `assertHasCommentLine` " builddir"
2679
2678
2680
2679
" -- hoogle" `assertHasCommentLine` " hoogle"
2681
2680
" -- html" `assertHasCommentLine` " html"
Original file line number Diff line number Diff line change
1
+ synopsis: `cabal update`: create default config without comment about `builddir`
2
+ packages: cabal-install
3
+ prs: #11067
4
+ issues: #11050
5
+ description: {
6
+ When calling `cabal update` with an empty state (empty `CABAL_DIR` or new
7
+ machine), cabal writes out a default config file with many fields
8
+ commented out to show their defaults. This suggests that the user can
9
+ uncomment the field and override the default. This is wrong for fields
10
+ that aren't allowed in the config file like `builddir`. This patch
11
+ avoids generating a comment with `builddir` in the default config.
12
+ }
You can’t perform that action at this time.
0 commit comments