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

Support projects using cabal.project

Open Hrothen opened this issue 4 years ago • 3 comments

Multi-package projects using cabal.project files have one dist-newstyle in the root directory instead of having one for every package. cabal-bounds won't find this folder when run inside a specific package, and doesn't have a way to target packages from outside.

Hrothen avatar Jan 19 '21 16:01 Hrothen

Do you think just searching for the dist-newstyle directory in the root directories should do the job? Does the dist-newstyle/cache/plan.json file in the root directory then contain the build dependencies of all packages?

dan-t avatar Jan 20 '21 13:01 dan-t

It looks like the plan.json just has all the dependencies for all of the packages yes. So using it would require manually building the dependency tree using the name of the package in the current directory to find the associated root package in the plan.json.

It seems like the Cabal library should have support for figuring these things out but a quick search suggests that everything for interacting with cabal.project files is internal and only exposed to cabal-install, which seems weird. It looks like there's an issue for adding a flag to ignore the project when building haskell/cabal#7057 but that presumably won't work if the package depends on another package in the project, which is the whole point of projects.

Hrothen avatar Jan 20 '21 16:01 Hrothen

Can you send me a ˋplan.jsonˋ file for such a multi package project.

So projects are mostly about local dependencies? This means that cabal doesn‘t support local paths as dependencies in a cabal file? With all these different package managers it sometimes gets a bit confusing which one supports what.

dan-t avatar Jan 21 '21 23:01 dan-t