Repository: electron/electron (language: cpp)

Issue:
[Bug]: Mismatched Released "ffmpeg" Architectures
### Preflight Checklist

- [X] I have read the [Contributing Guidelines](https://github.com/electron/electron/blob/main/CONTRIBUTING.md) for this project.
- [X] I agree to follow the [Code of Conduct](https://github.com/electron/electron/blob/main/CODE_OF_CONDUCT.md) that this project adheres to.
- [X] I have searched the [issue tracker](https://www.github.com/electron/electron/issues) for a bug report that matches the one I want to file, without success.

### Electron Version

31, 29, Unsure

### What operating system(s) are you using?

macOS

### Operating System Version

MacOS Sonoma 14.2

### What arch are you using?

x64

### Last Known Working Electron version

Unsure

### Expected Behavior

Expected the `ffmpeg-${version}-darwin-x64.zip` to be the `x64` MacOS shared library.

### Actual Behavior

The `ffmpeg-${version}-darwin-x64.zip` is actually the `arm64` shared library. This can be confirmed by running `file ../path/to/ffmpeg.dylib`.

### Testcase Gist URL

_No response_

### Additional Information

Currently the `ffmpeg` releases for versions 29 and 31 point to the wrong architecture for MacOS x64 builds. Unsure how many versions of Electron releases that could be effected by this.


Discussion / hints:
@electron/wg-infra this is probably GHA related 🤔

Fix patch:
diff --git a/.github/actions/build-electron/action.yml b/.github/actions/build-electron/action.yml
index dcf24aec4ca5f..ba725e638f09c 100644
--- a/.github/actions/build-electron/action.yml
+++ b/.github/actions/build-electron/action.yml
@@ -36,7 +36,7 @@ runs:
       shell: bash
       if: ${{ inputs.target-arch == 'x64' && inputs.target-platform == 'macos' }}
       run: |
-        GN_APPENDED_ARGS="$GN_EXTRA_ARGS v8_snapshot_toolchain=\"//build/toolchain/mac:clang_x64\""
+        GN_APPENDED_ARGS="$GN_EXTRA_ARGS target_cpu=\"x64\" v8_snapshot_toolchain=\"//build/toolchain/mac:clang_x64\""
         echo "GN_EXTRA_ARGS=$GN_APPENDED_ARGS" >> $GITHUB_ENV
     - name: Build Electron ${{ inputs.step-suffix }}
       shell: bash


Test patch: