How to compile dependencies for profiling in an isolated sandbox

I am trying to compile one of my executable files with profiling options. I added the -prof options to my cabal file. When I do this, I get a message that

 Could not find module 'Package-X' Perhaps you haven't installed the profiling libraries for package 'package-x'? Use -v to see a list of the files searched for. 

How can I do it? I tried cabal install --only-dependency --reinstall and got the following answer:

 All the requested packages are already installed: Use --reinstall if you want to reinstall anyway. 

I already used --reinstall , what should I do? I also tried cabal configure --enable-profiling-libraries , etc.

+5
source share
1 answer

The link suggested by bheklilr helped, but not right away.

I ended up adding library-profiling: True to my .cabal/config file and reinstalling everything. cabal install --reinstall wolrd does not work, maybe because I'm inside the sandbox. However, the good things about sandboxes are that you can drop them so I can reinstall everything using

 cabal sandbox delete cabal sandbox init cabal install 

Although this solution works, it is not satisfactory for the following reasons:

  • I had to modify .cabal/config , which is a global file, whereas in perfect wolrd I would only have to modify my sandbox. However, I did not try to create a local cabal configuration file

  • I had to reinstall EVERYTHING, that is, the profiling version of each library, as well as the regular version that was already installed.

+4
source

Source: https://habr.com/ru/post/1203307/


All Articles