ianfab / fairyground

playground for Fairy-Stockfish in the browser
https://fairyground.vercel.app/
GNU General Public License v3.0
20 stars 5 forks source link

Release Maker feature #48

Closed yjf2002ghty closed 3 months ago

yjf2002ghty commented 6 months ago

Currently using fairyground requires to install node.js and set up the environment, which can be complicated to end users.

After this change, release maker can pack node.js runtime into a binary executable which does not need to install a node.js environment. It would be much easier for local usage.

This change has no effect to online version.

vercel[bot] commented 6 months ago

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
fairyground ✅ Ready (Inspect) Visit Preview 💬 Add feedback Mar 19, 2024 5:45am
ianfab commented 6 months ago

Hi, is there a specific reason why you closed the PR? Hadn't fully made it through the CR yet, but from what I had seen so far it looked fine, though I haven't tested it yet.

yjf2002ghty commented 6 months ago

I thought that you might have rejected this PR as this is a very small change and you didn't give any reply on this for about 3 days.

I've tested the binary executables on Windows and Linux on X64 platform and worked fine. The ARM64 versions should also work but I don't have an ARM64 machine.

ianfab commented 6 months ago

I do not ignore PRs, when I reject them I do reply. Just takes time.

ianfab commented 6 months ago

For me this doesn't seem to work properly. I fixed the shell script to make it work on linux, but I keep getting warnings on running pkg, like Warning Failed to make bytecode node18-arm64 for file C:\snapshot\release_make\index.js or Warning Failed to make bytecode node18-arm64 for file /snapshot/release_make/index.js.

yjf2002ghty commented 6 months ago

Does it happen on x86 targets? If not, probably this is due to version problems. I use pkg v5.8.1, node v18.16.0, express v4.18.2 If the problem still exists, try changing the target node version to others like node17 or node14. For example: pkg . --target node17-linux-arm64 --output ./release-builds/linux/arm64/FairyGround If it still occurs, abandon the problematic targets.

ianfab commented 5 months ago

Sorry for the long delay. For me this only happened for ARM, not for x86. However, I generally would like to avoid "works on my machine" problems, especially for optional features, so I would suggest that if we include this it should be covered by CI. If you are willing to add CI for it and it works, I am happy to include it, otherwise I do not feel comfortable merging it.

yjf2002ghty commented 3 months ago

I've updated the ci.yml to automate it. The build seems to work when adding --no-bytecode --public --public-packages to those targets that cannot generate a bytecode. However I noticed that when building MacOS targets, there is a new problem on signature:

> pkg@5.8.1
> Warning Unable to sign the macOS executable
  Due to the mandatory code signing requirement, before the
  executable is distributed to end users, it must be signed.
  Otherwise, it will be immediately killed by kernel on launch.
  An ad-hoc signature is sufficient.
  To do that, run pkg on a Mac, or transfer the executable to a Mac
  and run "codesign --sign - <executable>", or (if you use Linux)
  install "ldid" utility to PATH and then run pkg again

It seems that when generating non-bytecode versions this problem always occurs. Currently I don't have any good solutions on this as it needs an external tool like ldid or codesign.

yjf2002ghty commented 3 months ago

See build log

ianfab commented 3 months ago

Thank you, looks ready for merge now.