Skip to content
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

Local no-index repositories cache leads to bad UX #9136

Open
andreabedini opened this issue Jul 18, 2023 · 4 comments
Open

Local no-index repositories cache leads to bad UX #9136

andreabedini opened this issue Jul 18, 2023 · 4 comments

Comments

@andreabedini
Copy link
Collaborator

Describe the bug

It's documented that, when using local no-index repositories.

cabal-install creates a .cache file, and will aggressively use its contents if it exists. Therefore if you change the contents of the directory, remember to wipe the cache too.

but cabal-install offers no warning or message about this leaving the user staring, confused, at a solver failure. See for example #9133.

Expected behavior

Cabal should either

  1. Provide a better caching mechanism, detecting changes to the local repository.
  2. Remnind the user that it will only look at the cache file and that the user should manually delete the cache file if the repository has changed.
@danse
Copy link

danse commented Jul 21, 2023

Regarding #9133, i think i built the one failing package like the others. Maybe i rebuilt it, i do not think i changed the version. When i was inspecting the sdist dirs, i thought that the noindex.cache and the tar.gz files were both outcomes of cabal v2-install. Maybe, if it is not too expensive, could be worth always regenerating the noindex.cache when the command succeeds

@taimoorzaeem
Copy link
Contributor

taimoorzaeem commented Aug 12, 2024

@ulysses4ever I would like to work on this issue. Could you kindly assign it to me? Let me know if there any updates to this issue.

@ulysses4ever
Copy link
Collaborator

hey @taimoorzaeem! I assigned you, thanks for volunteering!

Adding a warning is hard to get wrong, so please go on and open a PR so that we can see how it goes. We'll probably need a test and/or QA notes.

@andreabedini who opened this ticket may be a better mentor for this but I'll see what I can do if no one else pops up.

Also, it'd be great to actually fix this issue and add a proper cache invalidation via "file monitors". While not very complicated, perhaps, that would require more hacking... In the meantime, adding a warning seems like a noble feat.

@andreabedini
Copy link
Collaborator Author

@taimoorzaeem It's been a while since I opened this but feel free to reach out to me if you want to have a look together.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants