-
Notifications
You must be signed in to change notification settings - Fork 697
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
"active-repositories: none" reportedly broken #10504
Comments
I understand MercuryTechnologies@ec242b1 fixes the problem. Should we cherry pick it? |
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)
Note that this issue occurs only if there is no exising |
But that gets us back to the question of why it even matters if |
Indeed, the error occurs with or without active-repositories passed. Its simply that with active-repositories passed, we might hope it would disable the error. what appears to be happening is we don't take into account active-repos when reading and validating the repo-index state. rather, we always fetch from all the available repos. active-repos says, out of all the repos, which are "active" for solving our package set. i'm much less certain about how bad this behavior is now, and also less certain how far we might want to go to fix it. that said, one solution would be to just turn this one specific error back into a warnning, as it is a different error than the bad index state error. rather, it reads: The reason I'm ok with this being turned into a warning is if the user needed that package list to proceed (i.e. for the solver), then subsequent steps would fail anyway -- so all we've done is make the failure mode slightly faster at hte cost of making it overly general. |
Hrm, in fact, that's what the proposed patch PR does. It still throws in every other case -- only in the |
It would be great to turn those errors back to warnings. Also, if |
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)
We may have a definition problem, which that comment exacedrbates: cabal has an offline mode, but it disables all network access, it doesn't do anything to what repositories are available or how cabal uses them. (Meaning, you must update your repositories and download any dependencies before going offline, which is what most things mean by offline mode.) |
cabal actually has |
Then, if I understand it correctly, maybe Cabal is missing a flag to state "build with the packages I provide"? It is a fairly common use case where you want to use Cabal for building but not for package management. Historically, this is what I (mis?)used |
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)
Ah I was not following the discussion in this thread. So I see that the desired use case is to be able to tell cabal to not use any indices, which in turn means something like an offline mode. At the moment the offline mode seems to mean "do not do network interaction" but it doesn't imply "do not look at the indices", it will actually look at the local copies of the indices when building the plan. On the other hand, cabal seems to need to read the local indices even when Therefore my proposal would be to add a flag
This effectively will make cabal just a tool to orchestrate which options to pass to GHC where, and how to build the current package, leaving aside the package-management functionality. Seems reasonable to me. Another option would be to name the flag |
Don't error if package index is missing (fix #10504)
Let's not close it right away. |
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) (cherry picked from commit d58a75e)
It is reported on #8944 that this broke
active-repositories: none
. If so, that's very bad and we should fix it!The text was updated successfully, but these errors were encountered: