Universal Binaries in Resources Don't Lipo

Open
#17 1 comment 8 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

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

Research direction

No implementation files or tests are named. Reproduce the failure by packaging the Go electron-helper in extraFiles with separate --arm64 and --x64 builds, then combine them with --universal and inspect the resource-lipoing path. Done means an already universal resource no longer fails because both inputs report x86_64, while architecture-specific resources still combine correctly.

Written by the indexing model from the issue text.

Description

I have a Golang universal binary called electron-helper listed in my extraFiles for a build.

When building --arm64 and --x64 independently the both work fine. However when I try to build it via the --universal flag it has an issue lipo-ing this resource:

  ⨯ Command failed with a non-zero return code (1):
lipo /private/var/folders/_c/ykyhj8_93dj1lf0pyyg5d0dr0000gn/T/electron-universal-qQ3oug/Tmp.app/Contents/Resources/dist/electron-helper /Users/projects/electron/dist/electron/mac-universal--arm64/Main.app/Contents/Resources/dist/electron-helper -create -output /private/var/folders/_c/ykyhj8_93dj1lf0pyyg5d0dr0000gn/T/electron-universal-qQ3oug/Tmp.app/Contents/Resources/dist/electron-helper

fatal error: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/lipo: /private/var/folders/_c/ykyhj8_93dj1lf0pyyg5d0dr0000gn/T/electron-universal-qQ3oug/Tmp.app/Contents/Resources/dist/electron-helper and /Users/projects/electron/dist/electron/mac-universal--arm64/Main.app/Contents/Resources/dist/electron-helper have the same architectures (x86_64) and can't be in the same fat output file  stackTrace=

Anyway to get it to ignore already lipo'd binaries? I can also put the binary conditionally for each architecture but it seems like there is no way to conditionalize extraFiles by architecture.

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.