-
Notifications
You must be signed in to change notification settings - Fork 164
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
Simplifying the build process by using Zig's toolchain #94
base: main
Are you sure you want to change the base?
Conversation
You can find the successful run of the new build system in the Github actions here: |
Thank you very much for the suggestion and this simplified build script 😃👍 We have a Adding: Those build scripts should do what those scripts do: Let's start with |
Thank you for your reply. Regarding:
This could be said regarding the current model as well 😁, but unlike the current model, getting a compiler toolchain installed in Windows for example is not a straightforward process (where installing Zig is relatively small and self-contained), and it's impossible to cross-compile with the current toolchain, which as a developer building my application with WebUI is something that I want to be able to easily do.
This statement is not completely accurate. From purely a language perspective, perhaps they compete, but unlike Rust, Zig is also a self-contained compiler/toolchain build system. Here's a wonderful article on Uber's decision to use Zig's toolchain to power their infrastructure.
Exactly! This is the exact problem that I'm proposing that we fix by using Zig's toolchain.
IMO this only introduces more complexities and dependencies instead of simplifying and removing them, and defaulting to a single and powerful build system that is also able to cross-compile. Before dismissing my proposal, I highly encourage you to take some time to learn about Zig purely from a build system/toolchain perspective and not as a language competitor to other languages. I'm including a couple of interesting links below:
|
I liked this article Cross-compile a C/C++ Project with Zig. Please, from this list, what Zig can do? I know Zig can't do all of it, but I'm new to the Zig toolchains, and I would like to know the Zig capabilities. x86-64Bit
ARM-64Bit
|
Let's say we run the Zing build toolchain from an |
The links I included previously provide an in-depth list of all of its capabilities. Please take a moment to review them.
Cross-compilation means being able to compile across platform architectures and OS, and not cross-compile between the compilers you have listed. For example, in Windows I could run the following command and build WebUI for ARM Linux:
In the same machine, Zig would remove the need to use any of those listed compilers, as it is a compiler itself. |
Any additional thoughts on this proposal? If you're not ready for it I'll close the PR and maintain my own fork, as I do need this simpler build system. Thanks |
First of all, thank you for the suggestion. I really appreciate it. The Zig build tools is a great system to use. And many people needs it. But others may need CMake or a simple make file. My suggestion is to add the Zig script and keep the old script as well to support different needs. |
The build process was simplified and some of the mentioned problems were solved since the PR was opened. As it works on old code, maybe we can close this as superseded. And re-submit or re-open when it is finished over the current code base. |
Let's keep it as a draft for now, if we close it we will forget about it! |
Problem statement:
The current build process seems quite repetitive and requires different compiler toolchains per platform, making it quite a difficult task to maintain the build process. I also don't think that we should be including the built artifacts in the source code, as this is something that can be provided as artifacts when creating releases.
Proposal:
Here I'm introducing Zig as a build system that allows us to have a single (and simple) build file and build the appropriate artifacts regardless of platform. By utilizing this approach we make it quite trivial to maintain the build process of this library. I have also updated the Github workflow action to utilize this build system to build on the three major platforms. In addition, my next task is to simplify the process of building the examples, which also suffers from the problem statement.
The draft status of this PR is such that I can have something for you to have a look while I continue working on migrating and simplifying all examples to also use Zig.
Thank you! 🎉