Ticket #431 (new defect)

Opened 4 years ago

Last modified 17 months ago

Distribution.Make requires to use sudo and --global

Reported by: shelarcy Owned by:
Priority: normal Milestone:
Component: Cabal library Version: 1.6.0.1
Severity: normal Keywords: wxHaskell
Cc: Difficulty: normal
GHC Version: 6.10.1 Platform:

Description

wxHaskell is heavily depends on self generated file. So, wxHaskell uses Distribution.Make to cabalize wxcore package now. But it causes trouble when using cabal command to install wxHaskell (wx and wxcore) from Hackage.

Distribution.Make and cabal don't path any package databases options to configure script. So, we can't install wxHaskell (wx package) straightforward way. We must use following horrible command.

sudo cabal install wxcore --global
cabal install wx

See  wxHaskell's bug tracker #2407551 and  wxhaskell-devel's thread.

Note: I tried to fix this problem by Custom Setup.lhs and Distribution.Make.WX. Attached file is that. But I can't get any package database information from Cabal and cabal. I checked configPackageDB flag's value by using unsafePerformIO.

optPackageDB = unsafePerformIO (print (configPackageDB flag) >> return []) 

It always shows just NoFlag?. Neither supplying package database option and cabal command affect that.

Attachments

WX.hs Download (10.5 KB) - added by shelarcy 4 years ago.

Change History

Changed 4 years ago by shelarcy

Changed 4 years ago by duncan

So the proper solution seems to be to tell configure which package db file(s) to read from and which package db to register into.

Ideally we would require that the makefile can spit out a package registration file. In fact that's really necessary for a cabalised package to work for a distro since it needs to run runghc Setup register --gen-pkg-config=foo.pkg.

So the details to sort out are exactly how to tell configure what package dbs to read from and which one to register into. We could do this perhaps using a ghc-pkg flags variable which we would set to something like --user or --package-conf. I guess the same flags should work for the register make target though I would prefer a method that produces the package registration info as output rather than actually doing the registration.

Changed 17 months ago by elga

Note: See TracTickets for help on using tickets.