Pkg: Cross compilation mac -> linux

Created on 28 Jun 2018  路  6Comments  路  Source: vercel/pkg

HI,

Specifying an arm linux target seems to make pkg want to download a macos equivalent, which of course doesn't exist. It then tries (and fails to build an arm macos binary.

Is it possible to stop pkg even worrying about the macos-arm target, as I don't want it anyway!

pkg run.js -t latest-linux-armv7
> [email protected]
> Fetching base Node.js binaries to PKG_CACHE_PATH
  fetched-v10.4.1-macos-armv7  [                    ] 0%
> Error! 404 Not Found
  https://github.com/zeit/pkg-fetch/releases/download/v2.5/uploaded-v2.5-node-v10.4.1-macos-armv7
> Asset not found by direct link:
  {"tag":"v2.5","name":"uploaded-v2.5-node-v10.4.1-macos-armv7"}
> Not found in GitHub releases:
  {"tag":"v2.5","name":"uploaded-v2.5-node-v10.4.1-macos-armv7"}
> Building base binary from source:
  built-v10.4.1-macos-armv7
> Error! Not able to build for 'armv7' here, only for 'x64'

Most helpful comment

would love to see a fix for this

All 6 comments

would love to see a fix for this

Same problem here.

Same problem +1.

+1 here

As workaround I am using docker

$ docker run -it --rm -w /src -v $(pwd):/src node:10.4 bash

and inside of container I just run

> npm install --global pkg
> pkg -t latest-linux-armv7 .

Sadly this seems to still be an issue. Can't compile from Windows to linux-armv7 because it tries to incorrectly build for win-armv7 instead.

Was this page helpful?
0 / 5 - 0 ratings