You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
cabal[master]$ cabal outdated
Error: cabal: No cabal file found.
Please create a package description file <pkgname>.cabal
It would be helpful if cabal outdated could also deal with a cabal.project file (instead of .cabal files only), similar to cabal build etc. It could list the outdated dependencies for all packages mentioned in cabal.project (grouped per package).
Reacted by Phil de Joux, fendor, Mikolaj Konarski, Javier Neira , Tommy Bidne, Mitchell Dalvi Rosen, amesgen and Ilya Baryshnikov
Here's some ideas for how to improve cabal outdated with the nix-local-build UI in mind:
cabal outdated should support target-selectors like new-build et al:
cabal outdated all would then iterate over all local packages configured in cabal.project and check all components for over-constricted bounds.
And it also makes sense to limit outdated to some components, i.e. if only care about a few components (and e.g. not the testsuite): cabal outdated lib:foo exe:doo would only check the two named components in whichever local package they're located.
Conversely, we have special names to e.g. refer to all testsuites in the target-selector; so you could also say cabal outdated tests to iterate over all test-suite components in your cabal.project.
cabal outdated already supports cabal.project.freeze; however, it would be convenient to have a variant which consults the last computed install-plan (and possibly compute one if it's needs (re)computation); IOW, a variant that combines cabal new-freeze with cabal outdated --new-freeze-file but without generating/overwriting an existing cabal.project.freeze file.
Note that Distribution.Client.CmdOutdated is an odd-ball. It follows the naming of v2 commands (Cmd*) and it uses ProjectFlags but it looks like it follows the pattern of v1 commands after that.
Checks bounds which come from the project context (cabal.project.freeze, cabal.project, command line etc)
Check bounds in local packages
It could also be extended to check bounds for non-local packages, but this seemed like overkill.
Where is it different.
Works exactly the same
Checks the bounds for the project context, not just a cabal.project.freeze file. Which seems like more correct behaviour to me since a cabal.project.freeze file is no different from a cabal.project file. You might specify your freeze constraints in
Uses the project selector to work out which bounds to check and doesn't ignore bounds in flag sections.
If you could try out the patch it would be greatly appreciated @andreasabel. Perhaps I could also quickly add support for build-tool-depends as well if you could guide this collaboration.
Activity
erikd commentedon Oct 17, 2023
From
HEADof thecabalrepo I get:so this is definitely not working now.
andreabedini commentedon Oct 17, 2023
Copying here some comments from @hvr:
erikd commentedon Oct 17, 2023
Isn't this functionality already available somewhere else for all of the new commands to use?
andreabedini commentedon Oct 17, 2023
If you just want all the local packages you can take inspiration from here
cabal/cabal-install/src/Distribution/Client/CmdFreeze.hs
Lines 126 to 139 in 9f37325
If you want to accept a target like Herbert is saying you need to do something like this
https://github.com/haskell/cabal/blob/master/cabal-install/src/Distribution/Client/CmdListBin.hs#L100C3-L100C26
Note that
Distribution.Client.CmdOutdatedis an odd-ball. It follows the naming of v2 commands (Cmd*) and it usesProjectFlagsbut it looks like it follows the pattern of v1 commands after that.Implement v2-outdated command for cabal-install
Implement v2-outdated command for cabal-install
mpickering commentedon Mar 27, 2025
I have implemented v2-outdated on this branch - https://github.com/haskell/cabal/tree/wip/v2-outdated
If anyone wishes to try it out that would be good. I will tidy up the tests tomorrow.
This also fixes a bug where dependencies in conditional branches were not taken into account.
It didn't seem worth it to to keep the old
v1-outdatedcodepath.ulysses4ever commentedon Mar 27, 2025
I agree with this in principle, but I'd like to point out that last time a move like that prompted a somewhat intense debate: #9107
andreasabel commentedon Mar 27, 2025
Is
v1-outdateddoing something not covered byv2-outdated?mpickering commentedon Mar 28, 2025
v2-outdateddoes everything thatv1-outdateddid.It could also be extended to check bounds for non-local packages, but this seemed like overkill.
Where is it different.
If you could try out the patch it would be greatly appreciated @andreasabel. Perhaps I could also quickly add support for build-tool-depends as well if you could guide this collaboration.
andreasabel commentedon Mar 28, 2025
I am happy to try if you put up a (draft) PR.
Implement v2-outdated command for cabal-install
mpickering commentedon Mar 28, 2025
Thanks @andreasabel, see #10878
Implement v2-outdated command for cabal-install
Implement v2-outdated command for cabal-install
Implement v2-outdated command for cabal-install
Implement v2-outdated command for cabal-install
Implement v2-outdated command for cabal-install
Implement v2-outdated command for cabal-install
Implement v2-outdated command for cabal-install
Implement v2-outdated command for cabal-install
Implement v2-outdated command for cabal-install
Implement v2-outdated command for cabal-install
Implement v2-outdated command for cabal-install
Implement v2-outdated command for cabal-install