Skip to content

Cannot install a profiled library with cabal install --lib -p pkgname #7832

Closed
@goldfirere

Description

@goldfirere

Use case
I would like to experiment with performance characteristics of a few library functions. I am not building software to ship. I am just trying to learn more about Haskell. So I'd like to be able, say, to build an executable that depends on a few packages without needing to edit a .cabal file every time I change the set of dependencies. (Remember: the goal is quick experimentation!) A key requirement is that I need profiled libraries. The first one I wish to use is random. Read on to see what happens:

Describe the bug
I say cabal install --lib -p random. Cabal responds with Resolving dependencies... Up to date. Sounds encouraging. I can confirm that ghc Experiment.hs (which has import System.Random) works. But I want to say ghc Experiment.hs -prof. That does not work, with GHC saying I need profiled libraries. Note that I asked for profiled libraries with -p, above. I think: maybe my environment file has a stale entry. So I edit my env file to delete the line with rndm. I then cabal install --lib -p random again. The env file re-grows its rndm line... but the library still isn't profiled. I'm now pretty stuck.

Being stuck, but still eager to make progress, I try cabal v1-install -p random, remembering that such a command used to work brilliantly. After doing some building, I now get

Error while Error while updating world-file. : dieVerbatim: user error (cabal: Could not parse world file.
)

So that didn't work. I'm now completely stuck. I decide to do something other than learn more about Haskell for now.

To Reproduce
Included in the narrative above.

Expected behavior
I expected the first cabal install --lib -p random to update my env file with the correct entry to be able to do a profiled build depending on System.Random.

System information

  • Operating system: macOS 11.6
  • Cabal-3.6.2.0, cabal-install-3.6.2.0 ,ghc-8.10.7

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions