-
-
Notifications
You must be signed in to change notification settings - Fork 11
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
macOS arm64 build #8
Conversation
|
||
- run: yarn install --ignore-engines | ||
|
||
- run: yarn start --node-range node${{ matrix.target-node }} --arch arm64 --output dist |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How does this work? Is it actually compiling the node binary?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah that's what the scripts in this package do. As far as I remember.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is that script coming from the https://github.com/actions/setup-node/tree/main/src. I'm not super familiar with GitHub Actions, where can I find the source for what the actual script is?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
e.g. https://github.com/yao-pkg/pkg-fetch/blob/main/lib/build.ts, with the actual entry point defined in package.json.
This entire repo is essentially a script/package to build and fetch patched node binaries suitable for pkg.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't understand how this could work if gh actions runner is not an arm64...
Cross compilation You can build arm64 binaries on Intel macs with new enough macOS and compiler versions. |
|
.github/workflows/build-macos.yml
Outdated
- name: Use Node.js 14 | ||
uses: actions/setup-node@v1 | ||
with: | ||
node-version: 14 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Use matrix.target-node
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think that's only the node version that is used for running the build script and doesn't matter as long as its new enough to run it. No need to vary it per target-node.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
At least use 18/20 as it's the currently lts
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah. Probably should update this for all the jobs.
I would like you to manually trigger this action on your fork so I can test if the binary is really an arm64 or not |
I did, but for some reason, although the job took a while, I can't see the build output and it didn't save the artifact. I'm not sure what's wrong running it there. https://github.com/segevfiner/pkg-fetch/actions/runs/6640925313 |
@segevfiner As you can see the upload artifact step is skipped this means the output is not found, strange that no output is shown when building nodejs binaries, I can actually see it when I use it here: https://github.com/yao-pkg/pkg-binaries/actions/runs/6613054379/job/17960133505#step:4:22 |
Any idea why? I want to see the output to see if it actually built anything or what failed? |
Sincerly I have no idea, try to run the action with debug turn on maybe? Or maybe it's because of some env var |
Running it again seems to have shown the output 🤷♂️ I'll see if I can get it working for real now. |
👍🏼 LMK |
Well done @segevfiner ! |
Once this is done (it usually takes 6h) I will bump expected sha, pkg fetch and pkg https://github.com/yao-pkg/pkg-fetch/actions/runs/6664583716 |
@robertsLando it succeeded! Can we get a new release! This is awesome!! |
It's already out! Check latest @yao-pkg/pkg |
Cool, but I was referring to the actual binary output that should be a new release on this repository as it is currently still 3.5. I integrate into Nix, so I need a persistent download link to the exact arm64 build. |
@CMCDragonkai I still don't undestand what you mean... If you install https://github.com/yao-pkg/pkg In order to understand how pkg-fetch releases work I suggest you to give a look at https://github.com/yao-pkg/pkg-fetch/blob/main/DEVELOPMENT.md. Essentially new releases of this package will not create a new GH release, only minor releases will have a related GH release and that should happen only when something changes on patches (like new method added or else that requires ALL patches to be built again as them will not be compatible with the old ones... also the pkg-fetch version is used in the path to the binaries cache, so bumping a minor would change also that for no reason. |
Fixes #5. We should test the resulting binaries of course.