obsproject / obs-plugintemplate

GNU General Public License v2.0
302 stars 138 forks source link

GitHub Actions - macOS arm64 run fails from CMake error "Bad CPU type in executable" #26

Closed nhielost closed 2 years ago

nhielost commented 2 years ago

Operating System Info

macOS 12

Other OS

No response

OBS Studio Version

Other

OBS Studio Version (Other)

27.2.3

OBS Studio Log URL

N/A

OBS Studio Crash Log URL

N/A

Expected Behavior

Expected CMake to generate the plugin properly (it doesn't even have to install).

Example: This is what happens on the macOS x86_64 build:

expected

Current Behavior

This is what happens on the macOS arm64 build:

image_2022-07-31_174724515

Steps to Reproduce

  1. Use the template and clone the resulting repository.
  2. Follow the README instructions.
  3. Add files (that are tested to be working in a Windows build) and adjust CMake accordingly.
  4. Commit and push new/fixed files to the remote repository.
  5. All GitHub Action runs succeed except macOS arm64.

Anything else we should know?

Also, I'm not sure if this is an issue (I don't think it is), but my repository has a dependency.

lopcode commented 2 years ago

Just in case it helps the maintainers, I ran in to this yesterday and did a quick fix as part of a Qt 6 upgrade. I think the main obs-studio project has a better cmake setup but this did the trick for now. CI needs "universal" Qt builds, as the cmake executable is x86_64 and Qt 6 moc is native arm64.

https://github.com/CarrotCodes/streamdeck-obs/commit/7451fe39e5457efef44d3f0f37d11935571f5cb2#diff-57d7fa352b65d16d5f4d17b84039224eb9a08760aeb1c04e0c5daafceae797c1R67

PatTheMav commented 2 years ago

It's probably a known issue because as you mentioned we had to change the CI builds to use universal builds of Qt, as creating arm64 variants that could also be used on x86_64 hosts turned out to be much of a hassle.

We're in the process of updating this repo this week already, so we'll revisit this issue then.

PatTheMav commented 2 years ago

Fixed via https://github.com/obsproject/obs-plugintemplate/commit/eb5423d41cba0d5992c18ed8d4c9a25b5edc78cd.