Incorrect PR instructions

I’ve been running both Homebrew (on macOS) and Linuxbrew (on various Ubuntu/Debian boxes) for some time now, and just tried to submit a pull request to upgrade a formula that was out-of-date by several release versions. I followed the instructions on the relevant docs, only to discover that my PR had over 10,000 commits in it.

You’ve probably guessed that I made the changes in Linuxbrew, but tried to PR against homebrew-core as the docs currently indicate. I finally did a clean PR on my macOS box instead, but as many formulas are cross-platform, I think the instructions really need to be clearer about which repo to PR against.

Questions:

  1. It seems that linuxbrew-core is updated from homebrew-core, but how about in the other direction?
  2. Does Linuxbrew’s bump-formula-pr operate against homebrew-core or linuxbrew-core?

I think the instructions really need to be clearer about which repo to PR against.

Looking forward to your pull request.

  1. It seems that linuxbrew-core is updated from homebrew-core , but how about in the other direction?

This basically never happens as all fixes that benefit both platforms should be submitted to homebrew upstream instead.

  1. Does Linuxbrew’s bump-formula-pr operate against homebrew-core or linuxbrew-core ?

I think it should operate against homebrew-core if the formula exits there.

@sjackman and @issyl0 can probably better answer this.

Thanks for the quick reply, Sean! Looks like there’s a fundamental disconnect in the Linuxbrew cross-platform formula PR process, since the “working” repo is linuxbrew-core, but the PR repo must be homebrew-core.

So how do other folks do this now? What I found myself doing:

  1. Fork homebrew-core, add remote to Homebrew on macOS.
  2. Update/test the Linuxbrew formula.
  3. Manually port the changes to Homebrew on macOS.
  4. Test on macOS for inadvertent breakage.
  5. Push PR branch from macOS.

Is there a better way?

If the fix is for a Linux issue, but you think it’s suitable for Homebrew-core (as opposed to Linuxbrew-core which is more typical) then what you describe is essentially the process. More typical is that the fix is for Linux, and the fix is submitted to Linuxbrew-core, which is pretty straight forward.

Thanks Shaun! That just leaves one question: Does bump-formula-pr in Linuxbrew issue PRs against linuxbrew-core or homebrew-core?

@gromgit If the formula is present in both repos, it issues the PR against the upstream Homebrew/homebrew-core repo. If it’s a Linux-only formula then it raises the PR against Homebrew/linuxbrew-core. But there are only 50 Linux-only formulae, so the vast majority of the time it raises PRs against the macOS repo.