mlabs-haskell / mlabs-tooling.nix

A flake that provides everything necessary to set up a project within our sopes. This includes the necessary maintenance as well as CI.
MIT License
7 stars 7 forks source link

Auto-include `source-repository`ies from `cabal.project` of upstream packages. #35

Open zmrocze opened 1 year ago

zmrocze commented 1 year ago

Hey, once again I have pab as dependency and need to manually include all the source-repository dependencies of it and other cardano packages external to CHaP.

Wouldn't it be a nice improvement to mlabs-tooling.nix if it parsed cabal.project's of source-repositories of our package and auto-included their upstream source-repository dependencies (transitively? [1])?

In theory this solves nothing, because it only touches the portion of our deps that are listed as source-repositories but there will still be (probably) CHaP dependencies that have their own source dependencies external to CHaP and those we need to explicitly provide ourselves. But in practice all the problems sit in PAB which is still not part of CHaP.

Maybe its not a big deal if 1) we dont use PAB in new projects (?) 2) we count on PAB to be included in CHAP soon, is it?

[1] - not needed i guess. assuming that the dependency doesn't use mlabs-tooling.nix, then it already lists the full transitive closure in cabal.project.

I was told here that this feature exists, but then it doesn't work like expected in this repro. So i don't know if its a feature request or bug report.

zmrocze commented 1 year ago

^ above i talked about source-repository from cabal.project but we could swap it for extraHackages in flake. In the repro above I've tried both ways and in neither the deps where included, I had to manually include quickcheck-contractmodel.

brainrake commented 1 year ago

maybe expose pab deps as a list in the flake output and then it's one line to include? would that be ok?

zmrocze commented 1 year ago

^ yes that would be simple and good

avnik commented 1 year ago

Would be also nice to have tool to extract constraints and allow-newer stanzas from cabal.project. Should be not super-complicated tool to cut/paste cabal.project sections, as well as exporting then to json and/or nix. Doable in day or two.