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.

macOS pkg written to same filename for x64 and arm64

See original GitHub issue
  • Version: 22.10.5
  • Electron Version: 12.0.5
  • Electron Type (current, beta, nightly): current
  • Target: macOS pkg for x64 and arm64

electron-builder --mac pkg --x64 --arm64 builds both the x64 pkg and the arm64 pkg, but it writes them both to the same filename Zulip-5.6.0.pkg, so the latter immediately overwrites the former.

  • building        target=pkg arch=x64 file=dist/Zulip-5.6.0.pkg
…
  • building        target=pkg arch=arm64 file=dist/Zulip-5.6.0.pkg

I would expect the latter to go to Zulip-5.6.0-arm64.pkg, as already happens with DMG and zip.

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:5

github_iconTop GitHub Comments

1reaction
anderskcommented, May 3, 2021

Yeah, that works for me.

  • building        target=pkg arch=x64 file=dist/Zulip-5.7.0.pkg
…
  • building        target=pkg arch=arm64 file=dist/Zulip-5.7.0-arm64.pkg
0reactions
mmaiettacommented, May 3, 2021

Big thanks for the gist! Wish other tickets had those provided more often 🙂

I added the arch/pkg args to the build config and it repro’d there as well. Found the issue seems to only exist with pkg target. I tested zip and dmg too and both worked correctly.

I think I was able to identify the fix, can you try out this patch? File: app-builder-lib+22.10.5.patch

diff --git a/node_modules/app-builder-lib/out/targets/pkg.js b/node_modules/app-builder-lib/out/targets/pkg.js
index 9a53e36..abd8215 100644
--- a/node_modules/app-builder-lib/out/targets/pkg.js
+++ b/node_modules/app-builder-lib/out/targets/pkg.js
@@ -115,7 +115,7 @@ class PkgTarget extends _core().Target {
     const options = this.options;
     const appInfo = packager.appInfo; // pkg doesn't like not ASCII symbols (Could not open package to list files: /Volumes/test/t-gIjdGK/test-project-0/dist/Test App ßW-1.1.0.pkg)
 
-    const artifactName = packager.expandArtifactNamePattern(options, "pkg");
+    const artifactName = packager.expandArtifactNamePattern(options, "pkg", arch);
     const artifactPath = path.join(this.outDir, artifactName);
     await packager.info.callArtifactBuildStarted({
       targetPresentableName: "pkg",
Read more comments on GitHub >

github_iconTop Results From Across the Web

Building a Universal macOS Binary - Apple Developer
Create macOS apps and other executables that run natively on both Apple silicon and Intel-based Mac ... #if arch(arm64) // Put 64-bit arm64...
Read more >
Create a single file for application deployment - .NET
Single file apps are always OS and architecture specific. You need to publish for each configuration, such as Linux x64, Linux Arm64, Windows ......
Read more >
Silver Sparrow macOS malware with M1 compatibility
Clipping Silver Sparrow's wings: Outing macOS malware before it takes flight ... File name: updater.pkg (installer package for v1)
Read more >
pkg - npm
Package your Node.js project into an executable. ... macOS: possible to build x64 on arm64 with Rosetta 2 but not opposite.
Read more >
Error - R 4.2.2 for macOS (ARM64) can't be installed on this ...
Check if you selected the right package according to the processor build (Apple silicon / Intel) of your mac when manually downloading 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