Ticket #542 (new defect)

Opened 4 years ago

Last modified 15 months ago

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

Reported by: nr Owned by:
Priority: low Milestone: cabal-install-0.16
Component: cabal-install tool Version: 1.6.0.1
Severity: minor Keywords:
Cc: Difficulty: unknown
GHC Version: Platform:

Description

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

Change History

  Changed 4 years ago by duncan

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.

follow-up: ↓ 3   Changed 4 years ago by 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.

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...

in reply to: ↑ 2   Changed 3 years ago by duncan

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.

  Changed 15 months ago by kosmikus

  • priority changed from normal to low
  • milestone set to cabal-install-0.16

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?

Note: See TracTickets for help on using tickets.