Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Failed build: setup-ffmpeg fails on macos-latest job #326

Closed
github-actions bot opened this issue Apr 28, 2024 · 4 comments · Fixed by #329
Closed

Failed build: setup-ffmpeg fails on macos-latest job #326

github-actions bot opened this issue Apr 28, 2024 · 4 comments · Fixed by #329
Labels
bug Something isn't working

Comments

@github-actions
Copy link
Contributor

Workflow failed: tests #713

@github-actions github-actions bot added the bug Something isn't working label Apr 28, 2024
@jayqi jayqi changed the title Failed build on master branch (tests #713) Failed build: setup-ffmpeg fails on macos-latest job May 3, 2024
@jayqi
Copy link
Member

jayqi commented May 3, 2024

We get the following error on macos-latest images:

Error: setup-ffmpeg can only be run on 64-bit systems

This seems to come from an explicit check here for x64 (i.e., x86-64) system architecture.

https://github.com/Iamshankhadeep/setup-ffmpeg/blob/97b7510c1d4db9526df0a4320a6f41a2d330b23c/src/action.js#L26-L30

This action seems to download macOS binaries from https://evermeet.cx/ffmpeg/ and that provider's website explicitly says:

I do not plan to provide native ffmpeg binaries for Apple Silicon ARM.

So we're going to have to change how we install ffmpeg (at a minimum for macos-latest) to get things to work.

@ejm714
Copy link
Collaborator

ejm714 commented May 14, 2024

It seems like our options are:

  • use macos-13 or earlier instead of macos-latest ("the new [M1] runner operates exclusively on macOS 14" (source)) -> EDIT: this looks out of date and it seems arm64 is in macos-13 too
    OR
  • use homebrew to install ffmpeg as we instruct in the zamba docs

Downside of the first option is it's not very future proof. Downside of the second option is it'll add about another minute to the CI run.

@ejm714
Copy link
Collaborator

ejm714 commented May 15, 2024

Think it makes sense to use homebrew to not be stuck on an old macos version and ultimately, an extra minute won't make much of difference given how slow the tests already are 😢

This basically means adding this block

      - if: matrix.os == 'macos-latest'
        name: Setup FFmpeg
        run: |
          brew install ffmpeg@4

However, we also need to add homebrew to the path

          echo 'export PATH="/opt/homebrew/opt/ffmpeg@4/bin:$PATH"' >> /Users/runner/.bash_profile
          source /Users/runner/.bash_profile

and that's where things get weird.

Oddly, things only work if I put that path block in the same step as make tests (where ffprobe gets called). I'd rather it live in the same block as brew install ffmpeg@4 but doing so only allows us to run ffmpeg or ffprobe in that install step, not in following steps like the test step.

The below is a workaround setup that I'd like to avoid because it's redundant, clunky, and it seems there should be a better way. @jayqi do you know if each action step uses a new shell or if there's a better way to tell the runner where to look for ffmpeg/ffprobe when on mac?

      - if: matrix.os == 'macos-latest'
        name: Run tests
        run: |
          echo 'export PATH="/opt/homebrew/opt/ffmpeg@4/bin:$PATH"' >> /Users/runner/.bash_profile
          source /Users/runner/.bash_profile
          ffmpeg -version
          ffprobe -version
          make tests

      - if: matrix.os == 'ubuntu-latest'
        name: Run tests
        run: |
          make tests

This is the current implementation in #329

@pjbull
Copy link
Member

pjbull commented May 15, 2024

@ejm714 I think you just need to do this in the ffmpeg install step to have it on the path for the rest of the steps:
https://docs.github.com/en/actions/using-workflows/workflow-commands-for-github-actions#adding-a-system-path

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants