Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix Homebrew release #23

Closed
bolinfest opened this issue Mar 29, 2024 · 2 comments
Closed

Fix Homebrew release #23

bolinfest opened this issue Mar 29, 2024 · 2 comments

Comments

@bolinfest
Copy link
Contributor

I believe the Homebrew release is not being done correctly.

For macOS, we release a universal binary:

macos:
needs: create-release
runs-on: macos-13
timeout-minutes: 30
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
with:
targets: aarch64-apple-darwin,x86_64-apple-darwin
- run: cargo test
- run: cargo clippy
- run: cargo build --release --target aarch64-apple-darwin
- run: cargo build --release --target x86_64-apple-darwin
- run: lipo -create -output dotslash target/aarch64-apple-darwin/release/dotslash target/x86_64-apple-darwin/release/dotslash
- run: tar -czvf "dotslash-macos.${GITHUB_REF#refs/tags/}.tar.gz" dotslash
shell: bash
- name: upload release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
shell: bash
run: gh release upload "${GITHUB_REF#refs/tags/}" "dotslash-macos.${GITHUB_REF#refs/tags/}.tar.gz"

As explained here:

:::note
On macOS, we **strongly** recommend running DotSlash as a
[Universal Binary](https://developer.apple.com/documentation/apple-silicon/building-a-universal-macos-binary)
rather than an x86 or ARM64 binary. If an x86 binary is running under
[Rosetta](https://developer.apple.com/documentation/apple-silicon/about-the-rosetta-translation-environment)
on Apple Silicon and ends up spawning `dotslash`, then for consistency with the
parent process, this will ensure that the `macos-x86_64` artifact will be run.
:::

But based on my read of how the Brew formula was created:

Homebrew/homebrew-core@8e53cba

and the subsequent changes to that file:

https://github.com/Homebrew/homebrew-core/commits/master/Formula/d/dotslash.rb

It looks like it is doing a simple cargo install, so it is not creating a universal binary.

Can we work with the Homebrew maintainers to fix this?

bolinfest referenced this issue in Homebrew/homebrew-core Mar 29, 2024
Adds a formula for https://github.com/facebook/dotslash.
The tool helps download and run executables from the web.

`brew audit --new` passes except that the repository is
fewer than 30 days old.
@abhinav
Copy link
Contributor

abhinav commented Mar 29, 2024

I don't know if this is still accurate, but as of Homebrew/brew#10307 and https://github.com/orgs/Homebrew/discussions/412, Homebrew does not support bottling universal binaries.

@alerque
Copy link

alerque commented Apr 10, 2024

I believe the Homebrew release is not being done correctly.

According to the detailed explanation given in the discussions linked above the Homebrew maintainers disagree with you. TL;DR They deliberately don't support universal binaries because it is problematic to cross-compile across the whole ecosystem and brew itself is specifically designed to run and install things that run on the host local system, not install apps that run on something else. If you are layering emulation layers that's your problem. You'll get binaries optimized for whatever platform brew itself is running on. That this trickles down to the binaries fetched by dotslash is unsurprising.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants