Skip to content

Add CI MacOS Arm64 support - #356

Merged
gchatelet merged 4 commits into
google:mainfrom
toor1245:arm64-macos-github
Aug 29, 2024
Merged

gchatelet merged 4 commits into
google:mainfrom
toor1245:arm64-macos-github

Conversation

@toor1245

@toor1245 toor1245 commented Aug 25, 2024 •

Copy link
Copy Markdown
Contributor

@toor1245
toor1245 force-pushed the arm64-macos-github branch 2 times, most recently from a9834ac to 2f11344 Compare August 26, 2024 00:29
- name: Check cmake
run: cmake --version
- name: Configure
run: cmake -S. -Bbuild -G "Xcode" -DCMAKE_CONFIGURATION_TYPES=Release -DCMAKE_INSTALL_PREFIX:PATH=destination

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Added -DCMAKE_INSTALL_PREFIX:PATH=destination to fix the following error for the latest macos version:

make[1]: Nothing to be done for `preinstall'.
Install the project...
/opt/homebrew/Cellar/cmake/3.30.2/bin/cmake -P cmake_install.cmake
CMake Error at cmake_install.cmake:41 (file):
-- Install configuration: "Release"
  file cannot create directory: /usr/local/lib.  Maybe need administrative
  privileges.

ref: https://github.com/toor1245/cpu_features/actions/runs/10551135880/job/29228120369#step:7:167

@toor1245

Copy link
Copy Markdown
Contributor Author

@gchatelet, @Mizux, this PR is ready to review please take a look.

@@ -0,0 +1,35 @@
name: AArch64 MacOS Bazel

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Can you add this line on top ?

# ref: https://github.com/actions/runner-images

e.g. https://github.com/google/or-tools/blob/main/.github/workflows/amd64_linux_cmake_cpp.yml#L1

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

done

@@ -0,0 +1,43 @@
name: AArch64 MacOS CMake

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

same here

# ref: https://github.com/actions/runner-images

@Mizux Mizux self-assigned this Aug 27, 2024
@Mizux Mizux added enhancement New feature or request cmake CMake related issue Apple M1 Apple M1 related issues labels Aug 27, 2024
@Mizux

Mizux commented Aug 27, 2024

Copy link
Copy Markdown
Collaborator

Requested change: aarch64 -> arm64

Context
for ARCH naming I usually use what Docker use:
see: https://github.com/docker-library/official-images
Which is based on the "indexes" in the OCI image specification
Which is based on Golang GOARCH naming: https://go.dev/doc/install/source#environment
i.e. arm64

For OS we prefer to use macos (as now) following the github runner convention
ref: https://github.com/actions/runner-images
note: github also tend to use arm for M1 based runners...

So could you rename file as arm64_macos_[bazel/cmake].yml and use Arm64 MacOS ... in name: (first line) ?

@toor1245
toor1245 force-pushed the arm64-macos-github branch from ec9f4d8 to 1318965 Compare August 27, 2024 18:35
@toor1245

toor1245 commented Aug 27, 2024 •

Copy link
Copy Markdown
Contributor Author

Requested change: aarch64 -> arm64

Context for ARCH naming I usually use what Docker use: see: https://github.com/docker-library/official-images Which is based on the "indexes" in the OCI image specification Which is based on Golang GOARCH naming: https://go.dev/doc/install/source#environment i.e. arm64

For OS we prefer to use macos (as now) following the github runner convention ref: https://github.com/actions/runner-images note: github also tend to use arm for M1 based runners...

So could you rename file as arm64_macos_[bazel/cmake].yml and use Arm64 MacOS ... in name: (first line) ?

Updated, should we rename aarch64_linux_[bazel/cmake].yml to arm64_linux_[bazel/cmake].yml for consistency?

Comment thread .github/workflows/arm64_macos_bazel.yml Outdated
jobs:
# Building using the github runner environement directly.
bazel:
runs-on: macos-latest

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Can you add # Using M1 processors, ref: https://github.com/actions/runner-images

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

done

Comment thread .github/workflows/arm64_macos_cmake.yml Outdated
jobs:
# Building using the github runner environement directly.
xcode:
runs-on: macos-latest

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

ditto

@Mizux

Mizux commented Aug 28, 2024

Copy link
Copy Markdown
Collaborator

Updated, should we rename aarch64_linux_[bazel/cmake].yml to arm64_linux_[bazel/cmake].yml for consistency?

TLDR: Not yet.

Context:
Currently our top README.md table mix native runner build (windows-latest, macos-13, ubuntu-latest...) and cross compilation using a CMake toolchain (aarch64, mips, powerpc) (+ QEMU for testing when possible).

I think we should split our CI matrix result in two tables:

  • native runner build and
  • cross-compilation build
    note: currently most of our cells doesn't make any sense e.g Riscv-Windows, mips-macos etc...

Also to ease the work of @gchatelet to adapt his script to generate the badges, we are thinking to add a prefix cross_ or xxx_toolchain (idea welcome) to be able to automatically split .yml files in two categories then generate both tables (native build and cross compile ones) automatically with few lines change in the script....
ref: https://github.com/google/cpu_features/blob/main/scripts/generate_badges.d

@toor1245
toor1245 force-pushed the arm64-macos-github branch from 1318965 to 2194fea Compare August 28, 2024 23:00
@toor1245
toor1245 requested review from Mizux and gchatelet August 29, 2024 00:09
@gchatelet
gchatelet merged commit c5fc491 into google:main Aug 29, 2024
@toor1245
toor1245 deleted the arm64-macos-github branch August 29, 2024 09:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Apple M1 Apple M1 related issues cmake CMake related issue enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants