Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

Already on GitHub? Sign in to your account

installing cabal-install refers to editing nonexistent file $HOME/.cabal/config #535

Closed
bos opened this Issue May 24, 2012 · 4 comments

Comments

Projects
None yet
2 participants
Contributor

bos commented May 24, 2012

(Imported from Trac #542, reported by nr on 2009-04-19)

cabal --help invites me to edit a file that doesn't exist, and I can't easily find documentation for the file:

: nr@homedog 5520 ; cabal --help
This program is the command line interface to the Haskell Cabal infrastructure.
 ...
You can edit the cabal configuration file to set defaults:
  /home/nr/.cabal/config
: nr@homedog 5521 ; ls -l   /home/nr/.cabal/config
ls: cannot access /home/nr/.cabal/config: No such file or directory
Contributor

bos commented May 24, 2012

(Imported comment by @dcoutts on 2009-04-19)

The config file gets created the first time you run any interesting command, like update or install.

What do you think we should do about this situation? I updated the README recently so that it's a bit clearer that one should run update before editing the config file.

Contributor

bos commented May 24, 2012

(Imported comment by nr on 2009-04-19)

I think the config file should be created at install time. It's a reasonable expectation and will prevent you from having to change documentation. If you can find no other way, it's better to run 'cabal update' at install time than it is to leave things as they are now.

But it would be still better to have a cabal command just to create the config file and to run that. After all, code to 'create config if it does not already exist' has got to be right handy someplace...

Contributor

bos commented May 24, 2012

(Imported comment by @dcoutts on 2009-04-21)

Replying to nr:

I think the config file should be created at install time. It's a reasonable expectation and will prevent you from having to change documentation. If you can find no other way, it's better to run 'cabal update' at install time than it is to leave things as they are now.

Unfortunately we cannot do anything at install time, only the first time the program is used.

But it would be still better to have a cabal command just to create the config file and to run that. After all, code to 'create config if it does not already exist' has got to be right handy someplace...

Right but the problem is you're not going to know that you should run that. Perhaps cabal --help should check if the config file exists before saying you can edit it. If it doesn't exist, perhaps it should suggest running cabal update.

Contributor

bos commented May 24, 2012

(Imported comment by @kosmikus on 2009-12-22)

While it's obvious to me that it can't be done at install time, I fail to see why we need to wait until an "interesting" command is executed. Why can't the first invocation of cabal create the config file? Does config file creation depend on update having been run before?

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