river icon indicating copy to clipboard operation
river copied to clipboard

Release: Setup Homebrew support

Open jamesmunns opened this issue 1 year ago • 1 comments

cargo-dist includes generation of homebrew packages. This was generated in https://github.com/memorysafety/river/releases/tag/v0.2.0, but we haven't set up publishing this yet.

We should figure out how to get the aarch64 mac builds available there.

jamesmunns avatar Apr 29 '24 17:04 jamesmunns

https://github.com/Homebrew/homebrew-core/blob/2b59118b7ba6dbbe700400d12ead8ed8040a5ffd/Formula/r/river.rb

Fexiven avatar May 22 '24 19:05 Fexiven

Thank you @Fexiven for submitting this upstream!

I'm not so familiar with the homebrew project's practices, but is there a reason not to use the formula generated by cargo-dist? We already prepare sha256 signed artifacts and pre-built binaries, visible in the dist-manifest.json. There is also a generated river.rb script generated automatically as part of the cargo-dist process, which seems not to have been used.

Additionally, is there some way we can ensure that future releases stay up to date in homebrew's package tracker?

Like I said - this is outside my current expertise, so I'm happy to be pointed to any docs or other best practices I can learn from.

jamesmunns avatar May 24 '24 11:05 jamesmunns

I'm not so familiar with the homebrew project's practices, but is there a reason not to use the formula generated by cargo-dist?

Yes, would work as it is, but the generated file does not comply with the "brew audit --strict" and "brew test" neccessary for getting it pushed to the core repo. If there would be a custom river homebrew "tap" it would have worked.

Additionally, is there some way we can ensure that future releases stay up to date in homebrew's package tracker?

It should be automatically updated, its in the autobump file https://github.com/Homebrew/homebrew-core/blob/2b59118b7ba6dbbe700400d12ead8ed8040a5ffd/.github/autobump.txt#L1909. In the next release it should be updated to 0.3.0 or whatever it will be.

Here's the documentation of the fomulas: https://docs.brew.sh/Formula-Cookbook

Fexiven avatar May 24 '24 13:05 Fexiven

Thanks! I've passed this up to the cargo-dist folks: https://github.com/axodotdev/cargo-dist/issues/1093, I also appreciate the docs link :)

jamesmunns avatar May 24 '24 14:05 jamesmunns

The autobump seems to work as expected: https://github.com/Homebrew/homebrew-core/pull/173597

Just one thing to keep in mind is https://github.com/Homebrew/homebrew-core/blob/6ade34390ee819819b31f995ceaf5ecfa3fc86ac/Formula/r/river.rb#L40

if anything should change in the config structure (probably will) in the future, or if there will be a better way to check for functionality this should get updated

Fexiven avatar Jun 05 '24 09:06 Fexiven

Thank you @Fexiven, I was going to look into this and you beat me to it! I'll keep that in mind, and likely add it to the release checklist so we don't forget.

Is there a proper ordering to this to avoid broken builds? e.g. if I DO change the config file details, should I make a PR to homebrew before or after I do the GH tagged release?

jamesmunns avatar Jun 05 '24 13:06 jamesmunns

I would say first release, then create a new PR with a revision https://docs.brew.sh/Formula-Cookbook#formulae-revisions

They are usually quite fast reviewing it.

Fexiven avatar Jun 05 '24 14:06 Fexiven