yao-pkg / pkg-binaries

Collection of pkg nodejs binaries that are not supported by pkg
MIT License
89 stars 23 forks source link

Not working as expected for ARMv7 #25

Closed ChandiraGunatilleke closed 4 months ago

ChandiraGunatilleke commented 4 months ago

I downloaded the binaries using curl into ~/.pkg-cache/custom. Then set the environment variables as mentioned in the README.

I am using the latest version of @yako-pkg/pkg. (v5.11.5).

Within my project folder I have a single index.js file. When I run the command: npx pkg -t node16-linux-armv7 index.js

I get the following output:

> pkg@5.11.5
> Fetching base Node.js binaries to PKG_CACHE_PATH
  fetched-v16.20.2-linux-armv7        [                    ] 0%
> Error! 404: Not Found
> Not found in remote cache:
  {"tag":"v3.5","name":"node-v16.20.2-linux-armv7"}
> Building base binary from source:
  built-v16.20.2-linux-armv7
> Fetching Node.js source archive from nodejs.org...
  node-v16.20.2.tar.gz.sha256sum      [====================] 100%
  node-v16.20.2.tar.gz                [=                   ] 7%^

It doesn't recognize the built-v16.16.0-linux-armv7 binary within ~/.pkg-cache/custom and tries to build from source.

I have both @yao-pkg/pkg and my project folders within WSL2 in my Windows machine with a x86 architecture. I need to cross compile into armv7 within this environment. Any help would be appreciated.

ChandiraGunatilleke commented 4 months ago

Checking it on the latest version using: npx pkg -t node20-linux-armv7 index.js

Starts a new download fetched-v20.11.1-linuxstatic-armv7 but hangs in the process. That also ignores the downloaded binary built-v20.11.1-linux-armv7.

robertsLando commented 4 months ago

each pkg version looks for a specific nodejs version, you should use the one that it expects (or you could also rename it the same way it expect to find)

ChandiraGunatilleke commented 4 months ago

I'm still having the same issue. I'm not sure what I'm doing wrong.

The steps I followed:

Since I'm using the latest pkg version from the forked repo (@yao-pkg/pkg), it seems to me that I don't need to manually download the binary from the releases page of this repo (@yao-pkg/pkg-binaries).

Unsure of how to proceed further.

ChandiraGunatilleke commented 4 months ago

Came across: https://github.com/yao-pkg/pkg-fetch/

Which says only Node 16 and 18 are supported on ARMv7 and sure enough it worked. Posting it here incase someone else runs into the same issue as me.