Skip to content

Add cabal default dir flag #2303

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

Closed

Conversation

gibiansky
Copy link

This adds a cabal-default-dir flag and configuration item. When this is set, it will be used to place setup-exe-cache in the right place, thus dealing with #1126 and #1242.

I am afraid I am not a regular cabal contributor, so I do not know all the places this should be used. I am most interested in dealing with setup-exe-cache, but I feel that it would be wrong to have this feature if it is blatantly disrespected elsewhere. What other places should this be used instead of $HOME/.cabal?

@gibiansky
Copy link
Author

To clarify, I'd like further feedback on what places should use this flag for their default values, and where in the code this should perhaps be modified.

The following three were mentioned by @luite:

  • Package index
  • Log file
  • World file

@ezyang
Copy link
Contributor

ezyang commented Dec 23, 2015

A year later, let me try to give some commentary based on a half hour of browsing around here.

I think the answer to your question is that you should grep for defaultCabalDir (and its siblings), and see where they are being improperly directly called. Those should be refactored so that we are NOT directly calling it and instead getting the appropriate value from GlobalFlags. Then all you need to do call "fromFlag $ defaultCabalDir globalFlags" to get it (ala how globalWorldFile is implemented right now.) (Though I don't like it, because fromFlag is a partial function and that's cabal-install is simply conspiring to ensure that it is always Just by the time you get there. Bad juju...)

Also, re the patch, I would appreciate it a lot of globalFlags came earlier in the arguments list; e.g. before the command-specific arguments arg.

@23Skidoo 23Skidoo modified the milestones: cabal-install 1.24, cabal-install 1.26 Feb 21, 2016
@ezyang ezyang modified the milestone: cabal-install 2.0 Sep 6, 2016
@m-renaud
Copy link
Collaborator

m-renaud commented Apr 1, 2020

This PR hasn't been touched in >4 years, if this is still relevant please leave a comment with more up to date info. If no updates have been posted in a few weeks I'm going to close this out and we can start a new PR if desired.

@m-renaud m-renaud closed this May 3, 2020
@Mikolaj
Copy link
Member

Mikolaj commented Jun 25, 2021

This is likely to be solved by #680 and related PRs.

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

Successfully merging this pull request may close these issues.

6 participants