Skip to content

Commit

Permalink
Don't error if package index is missing (fix #10504)
Browse files Browse the repository at this point in the history
All of the packages Cabal needs may already be present in the local
package database; we don't know yet!

This is a partial revert of #8944.

See: #8944 (comment)
  • Loading branch information
9999years authored and ulysses4ever committed Nov 7, 2024
1 parent 48d2306 commit 88c4e3d
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
4 changes: 2 additions & 2 deletions cabal-install/src/Distribution/Client/IndexUtils.hs
Original file line number Diff line number Diff line change
Expand Up @@ -457,8 +457,8 @@ readRepoIndex verbosity repoCtxt repo idxState =
if isDoesNotExistError e
then do
case repo of
RepoRemote{..} -> dieWithException verbosity $ MissingPackageList repoRemote
RepoSecure{..} -> dieWithException verbosity $ MissingPackageList repoRemote
RepoRemote{..} -> warn verbosity $ exceptionMessageCabalInstall $ MissingPackageList repoRemote
RepoSecure{..} -> warn verbosity $ exceptionMessageCabalInstall $ MissingPackageList repoRemote
RepoLocalNoIndex local _ ->
warn verbosity $
"Error during construction of local+noindex "
Expand Down
6 changes: 4 additions & 2 deletions cabal-testsuite/PackageTests/Get/T7248/cabal.out
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
# cabal get
Warning: <ROOT>/cabal.config: Unrecognized stanza on line 3
Error: [Cabal-7160]
The package list for 'repo.invalid' does not exist. Run 'cabal update' to download it.
Warning: The package list for 'repo.invalid' does not exist. Run 'cabal update' to download it.
Error: [Cabal-7100]
There is no package named 'a-b-s-e-n-t'.
You may need to run 'cabal update' to get the latest list of available packages.

0 comments on commit 88c4e3d

Please sign in to comment.