phoenix-ru / fervid

All-in-One Vue compiler written in Rust
https://phoenix-ru.github.io/fervid/
Apache License 2.0
371 stars 9 forks source link

feat: Add support for `aarch64-apple-darwin` and `x86_64-unknown-linux-musl` #12

Closed ErKeLost closed 8 months ago

ErKeLost commented 8 months ago

We should support the mainstream arm64 architecture, and we can readjust the project structure and ci later.

phoenix-ru commented 8 months ago

@ErKeLost I see you are struggling with running tests on ARM builds. This is due to GitHub-hosted runners which currently only offer x86-64. Using ARM seems to be impossible at the moment.

How is Farm/SWC handling that?

ErKeLost commented 8 months ago

@phoenix-ru Since my mac uses the ARM architecture, but it seems that github ci can only compile ARM but not test ARM, the ci tested in farm does not use ARM and only x64. I have removed the test for ARM

ErKeLost commented 8 months ago

I have a few suggestions for building for fervid, because what we finally achieve is on top of node.

  1. For most of our node subprojects, such as napi and example, we can even move playground into the fervid project as a subpackage, so we need monorepo to manage the repo.

  2. Optimizing the development experience is similar to farm, Farm has a bootstrap command (javaScript command) that can directly build our entire package to achieve the final effect we want. where we write a set of node scripts to help us build all the scripts that our development environment needs to build, and now maybe we need to build them in different packages to achieve what we ultimately want.

If you think it's possible, I'm will to pr.

ErKeLost commented 8 months ago

one way to do arm testing is to use docker to simulate the arm architecture. I think we can optimize github ci later.

phoenix-ru commented 8 months ago

one way to do arm testing is to use docker to simulate the arm architecture. I think we can optimize github ci later.

Yes, that is possible using QEMU

  1. For most of our node subprojects, such as napi and example, we can even move playground into the fervid project as a subpackage, so we need monorepo to manage the repo.

I didn't understand that

2. Optimizing the development experience is similar to farm, Farm has a bootstrap command (javaScript command) that can directly build our entire package to achieve the final effect we want. where we write a set of node scripts to help us build all the scripts that our development environment needs to build, and now maybe we need to build them in different packages to achieve what we ultimately want.

That I also didn't understand. This is a Rust project managed by Cargo, what do we need Node scripts for?

ErKeLost commented 8 months ago

The first point can be understood that we use monorepo to manage projects related to node.

The second point is to check https://github.com/farm-fe/farm/blob/main/scripts/build.mjs, and we can all give it to the js script to do.

phoenix-ru commented 8 months ago

Okay, I checked the Pull Request. It seems that at the moment we won't have ARM testing, but I will create a separate issue for it.

I'd gladly merge it as soon as you resolve my review comments, please.

ErKeLost commented 8 months ago

The first point can also be understood that if I'm going to run example locally on the browser, then I need to build fervid/core and then build fervid/napi before I can run example. If we set it to monorepo plus script, we only need one command to run example directly, and I think this will speed up our development efficiency and development experience. It also allows other developers to quickly join our project. It is more convenient to understand our repo

ErKeLost commented 8 months ago

Okay, I checked the Pull Request. It seems that at the moment we won't have ARM testing, but I will create a separate issue for it.好的,我检查了拉取请求。目前我们似乎不会进行 ARM 测试,但我会为它创建一个单独的问题。

I'd gladly merge it as soon as you resolve my review comments, please.我很乐意在您解决我的评论评论后立即合并它,请。

What do you mean by resolve comment? I didn't find the button for resolve. What should I do?

phoenix-ru commented 8 months ago

The first point can also be understood that if I'm going to run example locally on the browser, then I need to build fervid/core and then build fervid/napi before I can run example. If we set it to monorepo plus script, we only need one command to run example directly, and I think this will speed up our development efficiency and development experience. It also allows other developers to quickly join our project. It is more convenient to understand our repo

Thanks. Yes, I agree to that. But I also don't like the way Farm does it (using scripts and execa). It's powerful and all, but I have to jump around the scripts/, package.json and code to understand that it just runs a simple pnpm build or whatever. Tbh, I'd rather use a combination of Yarn + NX for that. Or Bash (MacOS is compatible with ZSH, Win can use GitBash or WSL2).

phoenix-ru commented 8 months ago

What should I do?

Please, add a link from where you took the ARM config, and return the

needs:
  - test-linux-x64-gnu-binding
ErKeLost commented 8 months ago

What should I do?我该怎么办?

Please, add a link from where you took the ARM config, and return the请添加一个链接,从您获取 ARM 配置的位置,并返回

needs:
  - test-linux-x64-gnu-binding

Oh sorry, I forgot to unlock this comment.

ErKeLost commented 8 months ago

You're right, and I agree with you that if we do this, we need to set up some script in different packages to ensure the versatility of the script. Nx and turborepo are also good.

phoenix-ru commented 8 months ago

Thanks for the PR, it was merged. I will publish the new NAPI version shortly