cabal build and cabal install should emit warnings

Created on 3 Nov 2017  Â·  11Comments  Â·  Source: haskell/cabal

If we are intending to transition to cabal new-... stuff then cabal build and cabal install should probably emit warnings saying that they are no longer the recommended way to do things.

[This ticket filed as discussed with angerman [on Haskell Reddit](https://www.reddit.com/r/haskell/comments/7a9d8b/why_is_cabal_so_bad_at_managing_modules/dpag3j0/)]

nix-local-build priority enhancement

Most helpful comment

@hvr That's fair enough. I'll slightly refine my suggestion then: whilst the old behaviour still exists add old-.. aliases for it (that don't warn).

All 11 comments

Thanks!

@23Skidoo, @hvr any objections to adding warnings when using the "old" commands?

Yep, it makes sense to add a warning in 2.2, but there should be an option to turn it off. I suggest something along the following lines:

Warning: The behaviour of this command will change in the upcoming 3.0 release. 
To read more about the upcoming changes, see <https://URL>. If you want to try 
the new behaviour right now, use the new-{build,install,test} set of commands 
instead of this one.
To turn this warning off permanently, add 'disable-new-build-warning: True' to your 
'~/.cabal/config' file.

I was thinking more of an encouraging warning: you likely want to use new-* unless you rely on the old behavior.

Sent from my iPhone

On 3 Nov 2017, at 11:55 PM, Mikhail Glushenkov notifications@github.com wrote:

Yep, it makes sense to add a warning in 2.2, but there should be an option to turn it off. I suggest something along the following lines:

Warning: The behaviour of this command will change in the upcoming 3.0 release.
To read more about the upcoming changes, see https://URL. If you want to try
the new behaviour right now, use the new-{build,install,test} set of commands
instead of this one.
To turn this warning off permanently, add 'disable-new-build-warning: True' to your
'~/.cabal/config' file.
—
You are receiving this because you were assigned.
Reply to this email directly, view it on GitHub, or mute the thread.

I don't know what you generally do for your deprecation process or what you planned for this functionality, but have you considered adding old-build and old-install and mentioning in the warning for build and install that they should use old-build and old-install if they want to preserve the behaviour in the next version?

That might make the transition easier.

@tomjaguarpaw tbh, it'd be great (at least that's the thing I can't wait to do) if we could get rid of the old codepaths asap in order to allow us to radically refactor and make the code-base less confusing and easier to develop/maintain (also, old-build codepaths will quickly bitrot once we start defaulting to new-build); which would mean to get rid of the old-* commands with cabal 3.0 ideally. If you need the old-build commands, you can just install cabal < 3 imho.

@hvr That's fair enough. I'll slightly refine my suggestion then: whilst the old behaviour still exists add old-.. aliases for it (that don't warn).

@23Skidoo please don't forget about this one!

@typedrat isn't this done?

I forgot to close it.

See #5358, #5378.

Was this page helpful?
0 / 5 - 0 ratings