Skip to content

Actual state

Rodrigo Garcia edited this page Apr 29, 2022 · 4 revisions

THIS IS THE BIBLE IN ORDER TO GET PRQL ON HOMEBREW 👀

  • Formula created:

  • The initial formula has been created, it contains the basic structure. Now each part has to be defined properly.

  • Dependencies checked

  • Thanks to cargo, the only dependency needed for homebrew is Rust (depends_on "rust" => :build). This command tells Homebrew that the Rust formula is needed and it's gets installed. the :build hash indicates that is a build-time only dependency. Then, with Rust (and cargo installed) the cargo build command will take care of the inner-rust-dependencies of prql.

  • Install defined:

  • The install definition has been created. For now It just build the crate from cargo build --release --bin prql.

    - - release: Build optimized artifacts with the release profile.

    - - bin: A target selection. Build the specified binary.

  • bin.install "target/release/prql" is used to move the bin generated by cargo build (which is in target/release/prql) to the *homebrew directory*/Cellar/prql/*version*/bin and make it executable (chmod 0555 prql).

  • OS availables

  • For the formula to be accepted by homebrew it's needs to build and pass tests on the latest 3 supported macOS versions and on x86_64 Linux.

  • Test on Linux: 0/3

  • Test on macOS: 0/3

  • Versioning system

It would be optimal that the formula automatically have the last stable release of the github. (Or even better, that the formula change so as you can download which version you pleased)

There's a rough idea about using azure pipelines in order to achieve it

The actual solution to this will be done in GitHub Actions. The workflow would be like:

  1. A new release on prql/prql is made ---> Trigger a workflow on: release that send a workflow_dispatch.
  2. on prql/homebrew-prql ---> There's a workflow listening for the workflow_dispatch event. This workflow would change the .tar URL and the version from the Formula

The summary of this solution can be follow on the issue: #1 Versioning system

References

Homebrew for a Rust app.

Publish a rust app on homebrew (espanso).

Rust docs.

Homebrew docs.

Clone this wiki locally