cabal-dev icon indicating copy to clipboard operation
cabal-dev copied to clipboard

hard to select compiler version

Open facundominguez opened this issue 14 years ago • 2 comments

I have installed in /usr both ghc-6.12.3 and ghc-7.0.3, and the default ghc is ghc-7.0.3

running cabal-dev install mypackage --with-compiler=/usr/local/bin/ghc-6.12.3 installs the package in cabal-dev/packages-7.0.3.conf despite of the fact that I'm using 6.12.3

The workaround is to invoke: cabal-dev install mypackage --with-compiler=/usr/local/bin/ghc-6.12.3 --package-db=pwd/cabal-dev/packages-6.12.3.conf

Ideally, packages of different compiler versions should not be so easy to mix.

facundominguez avatar Nov 16 '11 22:11 facundominguez

I gave a look to the code now. The default ghc-pkg is called to obtain the version which is used when naming the packages-.conf folder.

Switching the compiler version could be done perhaps with a command line parameter like --compiler-version=, so it is not necessary to specify the path to each of the compiler suit tools that cabal-dev may use. Another option is to infer the "compiler suite version" from the programs specified through --with-compiler=, --with-ghc= or --with-ghc-pkg= parameters. May this be what cabal-install does?

facundominguez avatar Nov 17 '11 15:11 facundominguez

Another option is to infer the "compiler suite version" from the programs specified through --with-compiler=, --with-ghc= or --with-ghc-pkg= parameters.

That sounds like a good idea to me.

creswick avatar Dec 06 '11 22:12 creswick