wjdp / htmltest

:white_check_mark: Test generated HTML for problems
MIT License
323 stars 54 forks source link

Build for Apple Silicon? #186

Closed faunaee closed 2 years ago

faunaee commented 2 years ago

I've just upgraded to a Macbook Pro with Apple Silicon. Unfortunately, there doesn't appear to be a macOS ARM64 build available, so the installation script exits with a non-zero exit code and no binary is installed.

$ curl https://htmltest.wjdp.uk | bash -s -- -b bin
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100 10278  100 10278    0     0  74478      0 --:--:-- --:--:-- --:--:-- 74478
wjdp/htmltest info checking GitHub for latest tag
wjdp/htmltest info found version: 0.15.0 for v0.15.0/macos/arm64
$ echo $?
1
$ ls bin
$
fviolette commented 2 years ago

I am facing the same issue. Thanks for this very useful utility.

wjdp commented 2 years ago

Hey, this should be doable if goreleaser supports arm osx. Your other option is using the homebrew packaged version: https://formulae.brew.sh/formula/htmltest#default

Ideally I'd like a mac person to help out with this as I don't have apple machines to test.

faunaee commented 2 years ago

Is does seem like goreleaser supports arm64 builds for macOS: https://github.com/goreleaser/goreleaser/pull/1956

I'd be happy to test any builds you create. I'm on a Macbook Pro with the Apple M1 Pro CPU, running Monterey 12.2.1.

faunaee commented 2 years ago

Locally, I've cloned this repo, and running ./build.sh built a working binary.

Performance for the amd64 variant:

✔✔✔ passed in 1.788798677s
tested 4022 documents

Performance for the arm64 variant:

✔✔✔ passed in 1.056330041s
tested 4022 documents

So, it looks good to add arm64 builds.

faunaee commented 2 years ago

It seems that is now deprecated and no longer maintained: https://github.com/goreleaser/godownloader

FYI: I've seen a suggestion to use go install <github repo>@latest, but I don't know how well that would work in a CI environment.

wjdp commented 2 years ago

@faunaee godownloader has been deprecated for a while, but as it just generates a simple(ish) bash script I'm still happy using it. Will have a look at adding arm64 to next release.

wjdp commented 2 years ago

Hi @faunaee I've put out an RC release with an macos arm64 build. If you can could you give this a test? https://github.com/wjdp/htmltest/releases/tag/v0.16.0-rc2

faunaee commented 2 years ago

I've tested the RC2 build for ARM64, and it appears to work well, catching errors when it should. No issues to report. 👍

wjdp commented 2 years ago

@faunaee Lovely, thank you very much! Will get a full release out soon.

wjdp commented 2 years ago

Release made

faunaee commented 2 years ago

Release works great via the goreleaser script for my Apple M1 Pro laptop. Thanks very much!