Brew: Add DSL for formulae deprecation/disabling

Created on 12 Feb 2020  ·  12Comments  ·  Source: Homebrew/brew

We have odeprecated and odisabled as a Homebrew/brew method that can be used to deprecate and disable functions before they are removed. We should add a DSL to do the same thing for Homebrew/homebrew-core. It should:

  • allow specifying a date based on published EOL for a package version (if available)
  • deprecate a formula when we ever have a plan to remove it in the future.

    • This deprecation can be revoked if the underlying issue is fixed.

    • There should be warnings in brew doctor and when you brew install, brew reinstall or brew upgrade the formula

    • We should not run any CI on disable or deprecated formulae

    • A deprecated formulae should also deprecate all their dependents

  • disable a formula when it is EOL or should not be used.

    • brew extract should be able to extract this formula and remove the disabling

    • a disabled formula should refuse to brew install, brew reinstall or brew upgrade

We may want to also consider a tap_deprecations.json or similar instead of a formula DSL to allow easier extracting and to be able to trivially and quickly output all deprecated or disabled formulae.

help wanted outdated

Most helpful comment

I could also use some pointers on how to disable CI tests for deprecated formulae.

This should probably be in brew test-bot/brew cask ci via a simple call to Formula#deprecated?/Cask#deprecated?.

All 12 comments

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs.

Hey, can I work on this issue? 🙋🏽‍♀️

@vidusheeamoli, please go ahead! 👍

Ideally the same DSL should also be available for casks.

Hello everyone!

I am sorry for the delay, I was busy with my mid-semester exams last week. I'm now completely focusing on this issue.

I've realised that there can be 2 ways to go forward with the solution (If I understand correctly):

  • I can either implement a deprecate method in the Formula class
  • Or I could create a new file utils/deprecate.rb and include it in the Formula class.

What should the course of action be in this case?

I could also use some pointers on how to disable CI tests for deprecated formulae.

Thank you!

I think we'll probably need a combination of both. A common function which can then be used by both formulae and casks.

I could also use some pointers on how to disable CI tests for deprecated formulae.

This should probably be in brew test-bot/brew cask ci via a simple call to Formula#deprecated?/Cask#deprecated?.

I think we'll probably need a combination of both. A common function which can then be used by both formulae and casks.

Makes sense! Thank you :)

Hello, I have some questions again:

A deprecated formulae should also deprecate all their dependents

For more readability, let us assume that the formula being deprecated is X.

I can easily access the list of all dependencies of X but to deprecate all the dependents of X, i plan on iterating through all formulae and check if they have X as a dependency. This is a brute force solution and might also increase the complexity. Another disadvantage of this approach would be the inefficiency to revoke the deprecation. Is there any other efficient method to do this?

Hope this question isn't too ambiguous.

Thanks!

Also, would it be okay if I make a WIP pull request, so that it is easier to provide more context about the doubts I have?

@vidusheeamoli sure, you can just create a draft PR for now.

@vidusheeamoli Agreed, go for it! I would say just do whatever the simplest solution is now and we can work on improving performance together. Looking forward to it!

Was this page helpful?
0 / 5 - 0 ratings

Related issues

kirk86 picture kirk86  ·  3Comments

fxcoudert picture fxcoudert  ·  3Comments

fooness picture fooness  ·  4Comments

rtobrien picture rtobrien  ·  3Comments

DomT4 picture DomT4  ·  3Comments