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 =
17821782 (fmap (field . savedConfigureFlags) mcomment)
17831783 ((field . savedConfigureFlags) vals)
17841784
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+ )
17881795
17891796-- | Fields for the 'install-dirs' sections.
17901797installDirsFields :: [FieldDescr (InstallDirs (Flag PathTemplate ))]
Original file line number Diff line number Diff line change @@ -2675,7 +2675,6 @@ testConfigOptionComments = do
26752675 " -- username" `assertHasCommentLine` " username"
26762676 " -- password" `assertHasCommentLine` " password"
26772677 " -- password-command" `assertHasCommentLine` " password-command"
2678- " -- builddir" `assertHasCommentLine` " builddir"
26792678
26802679 " -- hoogle" `assertHasCommentLine` " hoogle"
26812680 " -- 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