actions / runner-images

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

macOS-14 (latest) homebrew confused about cpu architecture #9760

Closed ReenigneArcher closed 2 weeks ago

ReenigneArcher commented 2 weeks ago

Description

macos-latest tag now points to macos-14-arm64, under this architecture homebrew has issues installing some packages.

The following command:

brew install \
  boost \
  cmake \
  miniupnpc \
  node \
  opus \
  pkg-config

Results in:

Warning: Treating cmake as a formula. For the cask, use homebrew/cask/cmake or specify the `--cask` flag.
Warning: cmake 3.29.2 is already installed and up-to-date.
To reinstall 3.29.2, run:
  brew reinstall cmake
Warning: pkg-config 0.29.2_3 is already installed and up-to-date.
To reinstall 0.29.2_3, run:
  brew reinstall pkg-config
Error: Cannot install under Rosetta 2 in ARM default prefix (/opt/homebrew)!
To rerun under ARM use:
    arch -arm64 brew install ...
To install under x86_64, install Homebrew into /usr/local.
Error: Process completed with exit code 1.

I noticed that running uname -m returns x86_64. That seems a little fishy if the image is actually arm64.

Platforms affected

Runner images affected

Image version and build link

Image: macos-14-arm64 Version: 20240422.3 Included Software: https://github.com/actions/runner-images/blob/macos-14-arm64/20240422.3/images/macos/macos-14-arm64-Readme.md Image Release: https://github.com/actions/runner-images/releases/tag/macos-14-arm64%2F20240422.3

Is it regression?

Yes. macos-12 (when it was macos-latest) https://github.com/actions/runner-images/releases/tag/macOS-12%2F20240418.1

Expected behavior

Homebrew properly detects image architecture, and uname properly reports it.

Actual behavior

Homebrew doesn't properly detect image architecture and uname doesn't properly report it.

Repro steps

Run this workflow: https://github.com/ReenigneArcher/brew-error-reproduction/blob/master/.github/workflows/brew_error.yml

mikhailkoliada commented 2 weeks ago

Please provide a full workflow file you see the problem with

ReenigneArcher commented 2 weeks ago

This is the simplest reproduction I could create. https://github.com/ReenigneArcher/brew-error-reproduction/blob/master/.github/workflows/brew_error.yml

It works fine if not using the codeql setup step first. Here are the logs: https://github.com/ReenigneArcher/brew-error-reproduction/actions/runs/8870403949/job/24352158742

sergei-pyshnoi commented 2 weeks ago

Hello @ReenigneArcher. Thanks for your report. Unfortunately we do not maintain CodeQL here. Please fill related in github/codeql-action repo . I am closing this issue as not runner-images related but if you have additional questions feel free to ask.