Skip to content
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

Provide a single build system #203

Open
christopher-kleine opened this issue Dec 16, 2021 · 6 comments
Open

Provide a single build system #203

christopher-kleine opened this issue Dec 16, 2021 · 6 comments

Comments

@christopher-kleine
Copy link
Contributor

Currently we have several different ways to compile the cart.wasm.
At the same time, we have w4 watch that uses language specific build commands.

I suggest we add something like w4 build. This could build the different languages.
Also it might be a good idea to not use makefiles.
Those are less common on Windows than on *nix Systems.

@aduros
Copy link
Owner

aduros commented Dec 16, 2021

What would the benefits be?

@christopher-kleine
Copy link
Contributor Author

The docs could be more concise. Instead of "If you use AS, use npm. If you use C/C++, D, Go, Odin use make. If you use ..." we could simple say "run w4 build".

Windows doesn't provide Make out of the box. A w4 build could replace them completly.

Using wasm-opt. This could be applied to all targets with the same level of quality. Currently the targets have different level settings for wasm-opt. And some have none at all.

@aduros
Copy link
Owner

aduros commented Dec 21, 2021

Wouldn't we still need to rely on the source language's build system? Eg: cargo for Rust, node/npm for Assemblyscript, nimble for Nim, etc. I'd rather have users use their language's existing build system rather than trying to force our own.

I guess what we could do is have w4 build just call out to the build command similar to what w4 watch does for building. But I'm not really sure it's worth it...

Bundling wasm-opt with w4 and exposing it with w4 optimize <cart.wasm> could be pretty nice though.

@christopher-kleine
Copy link
Contributor Author

What I mean is more like "Copy the contents of the Makefile to the CLI."
This way you can still use a Makefile if you want. But on systems that don't come with GNU Make (I'm looking at you, Windows), can simply run "w4 build". We could reduce the dependencies to 3rd Party tools this way. We have enough as it is.

@aduros
Copy link
Owner

aduros commented Dec 22, 2021

For languages like Go where the Makefile is just wrapping a single command that maybe makes sense, but for C/C++ we actually use the dependency tracking features of Make and reimplementing that ourselves would be way too much work.

@christopher-kleine
Copy link
Contributor Author

Okay, let's do it the other way around: Provide a Makefile for all languages. But languages like Rust still get the mention of the "usual" way.

This should make the CLI easier to maintain, since we don't have to include several commands to build the cart.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants