Comments (6)
It'd be great to see where the bug has been introduced and whether the fix would be contained to cabal-install (together with cabal-install-solver) or whether it might involve any fixes to the Cabal API or file format (the latter probably unlikely). For now, I'm going to assume this does not block the release of Cabal 3.12.0.0, but is a likely blocker for cabal-install 3.12.1.0.
from cabal.
Thanks for investigating @cloudyluna !
from cabal.
I think I understand where the problem is. I am working on a patch.
from cabal.
Hi! I believe this bug location lives within this readRepoIndex
function:
Note that I tested this using git tag of cabal-install-v3.12.0.0-prerelease (I tested for this bug in cabal-3.10.3.0 beforehand and found it works without this bug, the same as in cabal-3.10.2.1)
This was introduced in this commit to be specific: d608d02.
For relevant strace
info it it helps (left picture is the compiled, unchanged version from mentioned git tag above. The right one is the same but patched with previously committed code. Please scroll down below for the patch.)
relevant ad-hoc patch to restore this file+noindex behavior for testing, though I'm pretty sure it breaks the recently introduced behavior.
diff --git a/cabal-install/src/Distribution/Client/IndexUtils.hs b/cabal-install/src/Distribution/Client/IndexUtils.hs
index 2dc7d37e2..945afcc0a 100644
--- a/cabal-install/src/Distribution/Client/IndexUtils.hs
+++ b/cabal-install/src/Distribution/Client/IndexUtils.hs
@@ -430,16 +430,15 @@ readRepoIndex
-> IO (PackageIndex UnresolvedSourcePackage, [Dependency], IndexStateInfo)
readRepoIndex verbosity repoCtxt repo idxState =
handleNotFound $ do
- ret@(_, _, isi) <-
- readPackageIndexCacheFile
- verbosity
- mkAvailablePackage
- (RepoIndex repoCtxt repo)
- idxState
- when (isRepoRemote repo) $ do
- warnIfIndexIsOld =<< getIndexFileAge repo
- dieIfRequestedIdxIsNewer isi
- pure ret
+ when (isRepoRemote repo) $ warnIfIndexIsOld =<< getIndexFileAge repo
+ -- note that if this step fails due to a bad repo cache, the the procedure can still succeed by reading from the existing cache, which is updated regardless.
+ updateRepoIndexCache verbosity (RepoIndex repoCtxt repo)
+ `catchIO` (\e -> warn verbosity $ "unable to update the repo index cache -- " ++ displayException e)
+ readPackageIndexCacheFile
+ verbosity
+ mkAvailablePackage
+ (RepoIndex repoCtxt repo)
+ idxState
where
mkAvailablePackage pkgEntry =
SourcePackage
@@ -460,8 +459,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 $ errMissingPackageList repoRemote
+ RepoSecure{..} -> warn verbosity $ errMissingPackageList repoRemote
RepoLocalNoIndex local _ ->
warn verbosity $
"Error during construction of local+noindex "
@@ -479,15 +478,10 @@ readRepoIndex verbosity repoCtxt repo idxState =
RepoSecure{..} -> warn verbosity $ warnOutdatedPackageList repoRemote dt
RepoLocalNoIndex{} -> return ()
- dieIfRequestedIdxIsNewer isi =
- let latestTime = isiHeadTime isi
- in case idxState of
- IndexStateTime t -> when (t > latestTime) $ case repo of
- RepoSecure{..} ->
- dieWithException verbosity $ UnusableIndexState repoRemote latestTime t
- RepoRemote{} -> pure ()
- RepoLocalNoIndex{} -> return ()
- IndexStateHead -> pure ()
+ errMissingPackageList repoRemote =
+ "The package list for '"
+ ++ unRepoName (remoteRepoName repoRemote)
+ ++ "' does not exist. Run 'cabal update' to download it."
warnOutdatedPackageList repoRemote dt =
"The package list for '"
Hope this helps a bit in narrowing down the actual problem.
from cabal.
@jasagredo @andreabedini tagging you as the authors of the commit which introduced the regression.
from cabal.
Thank you @alt-romes, I'll have a look.
from cabal.
Related Issues (20)
- Imported constraint edit not seen by cabal build HOT 1
- cabal init should create a .gitignore with dist-newstyle in it.
- Cabal (the library) advises use of `extensions:` when that field is deprecated HOT 2
- [3.12.0.0] Failed to find the installed unit HOT 1
- How to use static alpine job for testing HOT 6
- Ways logic only works by accident for cross compilers
- pkgsUseSharedLibrary logic is incorrect HOT 1
- cabal haddock-project suggests --haddock-all but then rejects it HOT 1
- Cabal-3.12.0.0 passes include dirs to GHC in a new order HOT 6
- build-tool-depends in Cabal regresses ghc ability to build from source distribution HOT 4
- Cabal external command requires typing Return to exit
- Support monitoring directory recursive globs
- cabal init fails if git is not installed HOT 5
- Failure to find a program produces an incomprehensible error
- Encountered possible bug during building rpki-prover HOT 14
- Using Setup.hs build --with-ghc looses configure --ghc-option
- Conditions don't work with flags HOT 2
- Are we validating `ghc-options` in `.cabal` files? HOT 2
- Do not pass environment variables to `happy`/`alex`, or at least allow a way to filter
- Is the `CabalParsing` class necessary?
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from cabal.