pkg icon indicating copy to clipboard operation
pkg copied to clipboard

Lipo breaks building fat binary from node14-macos-x64 & node14-macos-arm64

Open has-n opened this issue 2 years ago • 4 comments

What version of pkg are you using?

5.3.2

What version of Node.js are you using?

14.17.3

What operating system are you using?

macOS

What CPU architecture are you using?

x86_64 AND Apple M1

What Node versions, OSs and CPU architectures are you building for?

node14-macos-x64 & node14-macos-arm64

Describe the Bug

When two builds are made targeting node14-macos-x64 and node14-macos-arm64, the individual binaries work fine. If I lipo them (upstream requirement) using lipo build-x64.app build-arm64.app -create -output build.app, the new fat binary throws an error:

`pkg/prelude/bootstrap.js:3 ); ^

SyntaxError: Unexpected token ')' at new Script (vm.js:103:7) at readPrelude (internal/bootstrap/pkg.js:29:13) at internal/bootstrap/pkg.js:36:18 at internal/bootstrap/pkg.js:43:4 at internal/bootstrap/pkg.js:44:2`

Expected Behavior

Fat binary should execute without a problem

To Reproduce

  1. make build targeting node14-macos-x64
  2. make build targeting node14-macos-arm64
  3. lipo both

has-n avatar Apr 21 '22 23:04 has-n

Some more tests which are also failing:

  • used pkg 5.6.0
  • use node16-macos-x64 and node16-macos-arm64
  • use the --no-bytecode and --public flags

has-n avatar Apr 22 '22 07:04 has-n

+1

We are also facing the same issue with the fat binary.

saurabh-deep avatar May 13 '22 12:05 saurabh-deep

This issue is stale because it has been open 90 days with no activity. Remove the stale label or comment or this will be closed in 5 days. To ignore this issue entirely you can add the no-stale label

github-actions[bot] avatar Aug 12 '22 00:08 github-actions[bot]

Still open

has-n avatar Aug 12 '22 02:08 has-n

+1, facing the same issue. Any updates on this?

haomiao-han avatar Nov 10 '22 16:11 haomiao-han

This issue is stale because it has been open 90 days with no activity. Remove the stale label or comment or this will be closed in 5 days. To ignore this issue entirely you can add the no-stale label

github-actions[bot] avatar Feb 09 '23 00:02 github-actions[bot]

This issue is now closed due to inactivity, you can of course reopen or reference this issue if you see fit.

github-actions[bot] avatar Feb 14 '23 00:02 github-actions[bot]

Still happening

tmm1 avatar Jun 20 '23 02:06 tmm1

Same here. Is there a solution in sight?

andikorol avatar Jul 27 '23 10:07 andikorol