ffmpeg module does not rebuild according to `arch`

Open
#106 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
28/100
Issue type
Feature
Clarity
Mostly clear
Activity status
Stale
Tech stack
electron, macos, typescript

Research direction

Start by reproducing the universal build with x64 and arm64 Electron applications, then inspect how the universal build process handles ffmpeg-static, npm_config_arch, and os.arch. Use the reported npm rebuild commands and file check as the baseline; done means the process supports per-architecture rebuilding and includes the correct ffmpeg binaries for both architectures.

Written by the indexing model from the issue text.

Description

We are using ffmpeg-static in our Electron app, but when the universal build is created, only the arm64 ffmpeg binary exists. I have confirmed that the ffmpeg-static module can be rebuilt with an arch param (npm rebuild --arch=arm64 -f ffmpeg-static, then confirmed with file node_modules/ffmpeg-static/ffmpeg) and the correct binary is created/downloaded. But when running the universal build, only os.arch() seems to be respected (which is an M1 machine in CircleCI).

If there were hooks in the universal build process, or some env vars set, I could manually rebuild this one module according to an arch. For example this ffmpeg module does read process.env.npm_config_arch, so if I were able to set that in between the x64 and arm64 builds (or electron/universal did), the module would build the correct ffmpeg binary.

Dominant language
TypeScript
Stars
148
Forks
48
Avg merge
3h 57m
Merged PRs (30d)
5

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from electron/universal

All issues in electron/universal

Similar issues

More TypeScript issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.