question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Can't use extraFiles that contain Universal binaries

See original GitHub issue
  • Version: 22.10.4
  • Electron Version: 11.2.0
  • Electron Type (current, beta, nightly): current
  • Target: macOS Universal

I have universal binaries built from another project which I want to include via extraFiles, and have been doing so a while, but I’ve since updated builds to create Universal binaries.

I’m specifying the folder for the binaries as:

"extraFiles": [
  {
    "from": "binaries/${arch}",
    "to": "binaries"
  }
],

So the configuration only expects to find files in x64 and arm64 folders, so it only attributes these files to one of those architectures.

Ideally, it should either test the contents of the files given in either folder, or have a new configuration option for a ‘universal’ arch to indicate the files are already universal, or additionally search the universal arch as well as x64 and arm64.

I’ve resorted to splitting the binaries with lipo -extract for now so that builder is happy, but I don’t think this is an ideal solution.

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Reactions:7
  • Comments:17 (2 by maintainers)

github_iconTop GitHub Comments

3reactions
IanMDaycommented, Mar 18, 2022

My prebuilt universals get lipo extracted before the build into binaries/arm64 and binaries/x64

lipo -extract arm64 myUniversalBinary -output binaries/arm64/myUniversalBinary
lipo -extract x86_64 myUniversalBinary -output binaries/x64/myUniversalBinary

Then included into the package with extraFiles:

"extraFiles": [
    {
        "from": "binaries/${arch}",
        "to": "binaries"
    }
],

The builder then uses lipo to recombine them back again.

3reactions
mmaiettacommented, Jul 28, 2021

Pretty sure any changes that could be made here for detecting whether a binary is already universal would be part of either @electron/electron-osx-sign or @electron/universal libraries.

I’d advocate for using this workaround https://github.com/electron-userland/electron-builder/issues/5552#issuecomment-805615861

Read more comments on GitHub >

github_iconTop Results From Across the Web

Put your Mac on a diet with CleanMyMac - Engadget
It cleans out all of the useless cache files, logs, languages you don't know or don't want, universal binary code that your specific...
Read more >
xcode - How to fix my build: .framework file with CocoaPods ...
Create universal binary file using lipo and place the combined executable in the copied framework directory echo "Combining executables" ...
Read more >
Unreal Game Sync Troubleshooting
Cannot detect Precompiled Binaries. Detecting PCBs can take a long time. UGS will first load all the CLs, then cross-reference them to see...
Read more >
Common Configuration - electron-builder
extraFiles The extra files configuration. asar = true AsarOptions | Boolean | “undefined” - Whether to package the application's source code into an...
Read more >
Free SYNC software? - Apple Community
... know of any freeware sync software (perferrably Universal Binary) that allows you ... I use RSyncX which is a GUI for the...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found