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

Build macOS arm64 variants #2618

Closed
wants to merge 3 commits into from

Conversation

reneleonhardt
Copy link

Fixes #2386

Old names:

  • jq-macos-13-clang

New names:

  • jq-macos-13-amd64
  • jq-macos-13-arm64

make -j4
echo "$(file ./jq) built against host ${{ matrix.arch }}-apple-darwin$(uname -r)")
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm guessing the build error:

/Users/runner/work/_temp/7b085663-5c80-4857-8ebd-8f06e512b15e.sh: line 6: syntax error near unexpected token `)'

Is because of the ending ")"

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There you see what happens if you can't debug locally ;)

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeap is a mess to debug and interate :)

@wader
Copy link
Member

wader commented Jun 17, 2023

Thanks! i was actually just thinking of looking into this ... and also do att alpine docker image :)

owenthereal added a commit to owenthereal/jq that referenced this pull request Jun 17, 2023
* Reorganize CI for different OSes (linux.yml, macos.yml & windows.yml)
  into ci.yml
* Add release job to release `jq` when tagged with v*
* Standardize artifact compiler with `clang` on CI.
* Provide extensible matrix for future cross-compile builds, e.g.
  jqlang#2618.
owenthereal added a commit to owenthereal/jq that referenced this pull request Jun 17, 2023
* Reorganize CI for different OSes (linux.yml, macos.yml & windows.yml)
  into ci.yml
* Add release job to release `jq` when tagged with v*
* Standardize artifact compiler with `clang` on CI.
* Provide extensible matrix for future cross-compile builds, e.g.
  jqlang#2618.
owenthereal added a commit to owenthereal/jq that referenced this pull request Jun 17, 2023
* Reorganize CI for different OSes (linux.yml, macos.yml & windows.yml)
  into ci.yml
* Add release job to release `jq` when tagged with v*
* Standardize artifact compiler with `clang` on CI.
* Provide extensible matrix for future cross-compile builds, e.g.
  jqlang#2618.
owenthereal added a commit to owenthereal/jq that referenced this pull request Jun 17, 2023
* Reorganize CI for different OSes (linux.yml, macos.yml & windows.yml)
  into ci.yml
* Add release job to release `jq` when tagged with v*
* Standardize artifact compiler with `clang` on CI.
* Provide extensible matrix for future cross-compile builds, e.g.
  jqlang#2618.
owenthereal added a commit to owenthereal/jq that referenced this pull request Jun 17, 2023
* Reorganize CI for different OSes (linux.yml, macos.yml & windows.yml)
  into ci.yml
* Add release job to release `jq` when tagged with v*
* Standardize artifact compiler with `clang` on CI.
* Provide extensible matrix for future cross-compile builds, e.g.
  jqlang#2618.
owenthereal added a commit to owenthereal/jq that referenced this pull request Jun 17, 2023
* Reorganize CI for different OSes (linux.yml, macos.yml & windows.yml)
  into ci.yml
* Add release job to release `jq` when tagged with v*
* Standardize artifact compiler with `clang` on CI.
* Provide extensible matrix for future cross-compile builds, e.g.
  jqlang#2618.
owenthereal added a commit to owenthereal/jq that referenced this pull request Jun 18, 2023
* Group CI builds for different OSes into `ci.yml`.
* Add release job to release `jq` when tag is in the format of v*.
* Use `clang` as the only compiler on CI.
* Provide extensible matrix for future cross-compile builds, e.g.
  for jqlang#2618.
owenthereal added a commit to owenthereal/jq that referenced this pull request Jun 18, 2023
* Group CI builds for different OSes into `ci.yml`.
* Add release job to release `jq` when tag is in the format of v*.
* Use `clang` as the only compiler on CI.
* Provide extensible matrix for future cross-compile builds, e.g.
  for jqlang#2618.
owenthereal added a commit to owenthereal/jq that referenced this pull request Jun 18, 2023
* Group CI builds for different OSes into `ci.yml`.
* Add release job to release `jq` when tag is in the format of v*.
* Use `clang` as the only compiler on CI.
* Provide extensible matrix for future cross-compile builds, e.g.
  for jqlang#2618.
owenthereal added a commit to owenthereal/jq that referenced this pull request Jun 18, 2023
* Group CI builds for different OSes into `ci.yml`.
* Add release job to release `jq` when tag is in the format of v*.
* Use `clang` as the only compiler on CI.
* Provide extensible matrix for future cross-compile builds, e.g.
  for jqlang#2618.
owenthereal added a commit to owenthereal/jq that referenced this pull request Jun 18, 2023
* Group CI builds for different OSes into `ci.yml`.
* Add release job to release `jq` when tag is in the format of v*.
* Use `clang` as the only compiler on CI.
* Provide extensible matrix for future cross-compile builds, e.g.
  for jqlang#2618.
owenthereal added a commit to owenthereal/jq that referenced this pull request Jun 18, 2023
* Group CI builds for different OSes into `ci.yml`.
* Add release job to release `jq` when tag is in the format of v*.
* Use `clang` as the only compiler on CI.
* Provide extensible matrix for future cross-compile builds, e.g.
  for jqlang#2618.
@owenthereal owenthereal mentioned this pull request Jun 18, 2023
MAKEVARS: ${{ matrix.makevars }}
run: |
autoreconf -fi
rm src/lexer.c src/lexer.h
rm src/parser.c src/parser.h
./configure --disable-valgrind --with-oniguruma=builtin YACC="$(brew --prefix)/opt/bison/bin/bison -y" $COVERAGE
./configure --disable-valgrind --with-oniguruma=builtin --target=${{ matrix.arch }}-apple-darwin$(uname -r) YACC="$(brew --prefix)/opt/bison/bin/bison -y" $COVERAGE
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fails on arm64 builds fails with:

If you meant to cross compile, use `--host'.

I tried this locally and this succeeded:

$ CC="clang -arch arm64" ./configure --disable-valgrind --with-oniguruma=builtin --host=arm64-apple-darwin$(uname -r) YACC="$(brew --prefix)/opt/bison/bin/bison -y" && make clean && make
...
$ file jq
jq: Mach-O 64-bit executable arm64

But i don't have much experience using clang+auto* to cross compile

@uogbuji
Copy link

uogbuji commented Jun 23, 2023

Hi all, forgive the intrusion, but I was hoping to just use this branch to build my own jq on my M1 Mac, but I don't use homebrew (otherwise I'd just get the brew version of jq, anyway), so it would be a ton of hoops jumping to build from scratch (I have Bison, but not e.g. autoreconf). Any chance a temporary release/download could be offered, maybe from the reneleonhardt fork?

@itchyny itchyny added this to the 1.7 release milestone Jun 25, 2023
owenthereal added a commit to owenthereal/jq that referenced this pull request Jul 1, 2023
* Group CI builds for different OSes into `ci.yml`.
* Add release job to release `jq` when tag is in the format of v*.
* Use `clang` as the only compiler on CI.
* Provide extensible matrix for future cross-compile builds, e.g.
  for jqlang#2618.
owenthereal added a commit that referenced this pull request Jul 2, 2023
* Release pipeline

* Group CI builds for different OSes into `ci.yml`.
* Add release job to release `jq` when tag is in the format of v*.
* Use `clang` as the only compiler on CI.
* Provide extensible matrix for future cross-compile builds, e.g.
  for #2618.

* Locate bison for Windows build

* Also install flex for Windows build

* Add matrix to test all available GH Actions images

* Enable all tests for Windows

* Run `brew update-reset` when `brew update` fails

`brew update` can fail for "Error: Fetching /usr/local/Homebrew/Library/Taps/homebrew/homebrew-cask failed!"

Ref: https://github.com/owenthereal/jq/actions/runs/5432314910/jobs/9879266028#step:3:19

* Select gcc binaries to release

* Only enable CI when push to master & tag

* Try out statick build

* No need to enforce the same `AM_INIT_AUTOMAKE` version for MacOS

* Disable static build for ubuntu-20.04

See #2620 (comment)
@itchyny itchyny closed this in #2665 Jul 9, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Provide darwin/arm64 builds of jq
5 participants