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

Command to 'reset' cabal #8340

Open
yaxu opened this issue Aug 3, 2022 · 3 comments
Open

Command to 'reset' cabal #8340

yaxu opened this issue Aug 3, 2022 · 3 comments
Labels
cabal-install: cmd/clean re: install --lib Concerning `cabal install --lib` type: enhancement type: RFC Requests for Comment

Comments

@yaxu
Copy link

yaxu commented Aug 3, 2022

Cabal has problems with working with libraries (e.g. #8337), where workarounds are to locate and delete files in hidden folders. These bugs have been around for years and aren't likely to be solved soon.

Would it be possible to have a command that 'reset' cabal to a clean state? E.g. cabal reset for deleting the environment file, perhaps with a modifier for deleting the whole package database?

@Mikolaj Mikolaj added type: enhancement cabal-install: cmd/clean type: RFC Requests for Comment re: install --lib Concerning `cabal install --lib` labels Aug 3, 2022
@Mikolaj
Copy link
Member

Mikolaj commented Aug 3, 2022

Where is the environment file located in your use cases? IIRC in something like ~/.ghc/foo? My main question is whether it's central location, because if it's in the working directory, cabal clean should probably do that. OTOH, if you do cabal install foo from Hackage, you don't have a working directory?

@Mikolaj
Copy link
Member

Mikolaj commented Aug 3, 2022

I also wonder what other commands we have that change global files. I think there's something like cabal config and perhaps there is a flag for that to remove or reset the ~/.cabal/config file. If that's true, we have a precedent and we can try to unify how it's done.

@fgaz
Copy link
Member

fgaz commented Aug 3, 2022

because if it's in the working directory, cabal clean should probably do that

Yes and no... it'd be nice but cabal can't yet know if a local environment file was generated by itself and thus safe to delete as part of clean. And what about environments generated through write-ghc-environment-files vs install --lib? A separate command would be best.

This should really be done properly as part of cabal env. Maybe we could proactively put such a command under a new env namespace (cabal env reset or cabal env delete --all) and make it just delete the global environments?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cabal-install: cmd/clean re: install --lib Concerning `cabal install --lib` type: enhancement type: RFC Requests for Comment
Projects
None yet
Development

No branches or pull requests

3 participants