smudge / nightlight

A CLI for configuring "Night Shift" on macOS 🌕🌖🌗🌘🌑
MIT License
196 stars 8 forks source link

`brew install` builds instead of using binary #22

Open vogler opened 7 months ago

vogler commented 7 months ago

The binary under releases works on my M1, why is it not used for brew install? I don't want all the rust deps on this machine.

$ brew info smudge/smudge/nightlight
==> smudge/smudge/nightlight: stable 0.3.0
A CLI for configuring 'Night Shift' on macOS 🌕🌖🌗🌘🌑
https://github.com/smudge/nightlight
Not installed
From: https://github.com/smudge/homebrew-smudge/blob/HEAD/Formula/nightlight.rb
==> Dependencies
Build: rust ✘

$ brew install smudge/smudge/nightlight
==> Tapping smudge/smudge
Cloning into '/opt/homebrew/Library/Taps/smudge/homebrew-smudge'...
remote: Enumerating objects: 24, done.
remote: Counting objects: 100% (24/24), done.
remote: Compressing objects: 100% (15/15), done.
remote: Total 24 (delta 4), reused 22 (delta 2), pack-reused 0
Receiving objects: 100% (24/24), done.
Resolving deltas: 100% (4/4), done.
Tapped 3 formulae (14 files, 9.5KB).
==> Fetching dependencies for smudge/smudge/nightlight: z3, llvm and rust
==> Fetching z3
==> Downloading https://ghcr.io/v2/homebrew/core/z3/manifests/4.12.4
######################################################################################################################## 100.0%
==> Downloading https://ghcr.io/v2/homebrew/core/z3/blobs/sha256:db95e813c6ff08c47f749d56fad0d38c41c1448ef3f4ffd6ac4ba91c3c4123
######################################################################################################################## 100.0%
==> Fetching llvm
==> Downloading https://ghcr.io/v2/homebrew/core/llvm/manifests/17.0.6_1
######################################################################################################################## 100.0%
==> Downloading https://ghcr.io/v2/homebrew/core/llvm/blobs/sha256:8d739bdfa4152d278627ff4724f240f7a946172b5d95622368e1e3768ab7
#######                                                                                                                    6.0%
^C

$ # download from releases and unzup

$ ~/Downloads/nightlight status
off until 23:00
smudge commented 7 months ago

Oh, interesting that it works on M1! I assume it's running under Rosetta.

The reason it's not automatic is because I haven't configured a proper multi-platform build system and instead build & upload binaries manually when I release. Not ideal, of course, but the fallback does allow for installation on unsupported platforms, though as you said it requires the Rust dependencies.

I'm open to reviewing PRs to address this, but I probably won't have a chance to improve the build pipeline myself in the near term.... 😅

vogler commented 7 months ago

I don't know about Rosetta, I think whenever I ran some binary compiled for amd64 it didn't work, just noticed it work for casks/apps.

A quick search for GitHub Actions gave me this:

Prob. won't try though since so far I never used Rust and never released anything on Homebrew 😅