actions / runner-images

GitHub Actions runner images
MIT License
9.17k stars 2.84k forks source link

macOS14-arm64 detected as x86_64 by CMake #9676

Closed jcelerier closed 1 month ago

jcelerier commented 1 month ago

Description

Hello, I am running an action with the image macos-14 which according to README and my build log is ARM64:

Current runner version: '2.315.0'
Operating System
  macOS
  14.4.1
  23E224
Runner Image
  Image: macos-14-arm64
  Version: 20240405.1
  Included Software: https://github.com/actions/runner-images/blob/macos-14-arm64/20240405.1/images/macos/macos-14-arm64-Readme.md
  Image Release: https://github.com/actions/runner-images/releases/tag/macos-14-arm64%2F20240405.1
Runner Image Provisioner
  2.0.361.1+33a726b54233caea13315dba3887b0e7c5a1d482

Yet from within, my CMake invocation gives me this :

CMAKE_HOST_SYSTEM_PROCESSOR: x86_64
CMAKE_SYSTEM: Darwin-23.4.0
CMAKE_SYSTEM_PROCESSOR: x86_64

CMake just uses uname and the like to devise this information. How can I make sure I'm actually running on ARM64 ?

Platforms affected

Runner images affected

Image version and build link

20240405.1

failed build : https://github.com/ossia/score/actions/runs/8639881737/job/23686938913

action : https://github.com/ossia/score/blob/master/.github/workflows/mac-builds.yaml#L64

Is it regression?

no

Expected behavior

The apps running on this image should see an ARM64 processor, not an Intel one.

Actual behavior

The apps running on the image see an Intel processor. Maybe they are running under Rosetta ?

Repro steps

erik-bershel commented 1 month ago

Hey @jcelerier! I'll take a look ASAP. Sounds interesting and strange. I suppose that it is related to Rosetta as you said, but should be checked of course.

erik-bershel commented 1 month ago

Hey @jcelerier!

I checked your report on the macOS-14 runners - 10/10 arm64. Seems to be related to your project config, but not the runner itself. Default config for Cmake is arm64.

Example code:

name: Manual workflow

on:
  workflow_dispatch:

jobs:
  test:
    strategy:
      matrix:
        os: [ macos-14 ]
        try: [ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9 ]
    runs-on: ${{ matrix.os }}
    steps:
    - name: Run command ${{ matrix.try }}
      run: |
        cmake --system-information | grep CMAKE_HOST_SYSTEM_PROCESSOR

Result:

Screenshot 2024-04-11 at 15 12 39