8000 Compile Biome to WASIX by TaKO8Ki · Pull Request #1 · TaKO8Ki/biome · GitHub
[go: up one dir, main page]

Skip to content

Compile Biome to WASIX - #1

Open
TaKO8Ki wants to merge 2 commits into
mainfrom
wasix-debug
Open

TaKO8Ki wants to merge 2 commits into
mainfrom
wasix-debug

Conversation

@TaKO8Ki
@TaKO8Ki TaKO8Ki commented Nov 27, 2023 •
Copy link
Copy Markdown
Owner

Summary

This is just a challenge. I have removed lsp deamon, libc dependency and so on for compiling Biome to WASIX. In detail, lsp implementation is deeply integrated with tokio and it seems difficult to resolve the issues quickly. I mean we need to add some changes to https://github.com/wasix-org/tokio and If the lsp implementation is unnecessary for WASIX, we can remove libc.

This is a messy way. If we compile Biome into WASIX in an original repository. I think we need to use conditional compilation.

Please check a GitHub Actions job for compiling Biome to WASIX here.
https://github.com/TaKO8Ki/biome/actions/runs/7009000801/job/19066556111?pr=1

$ cargo wasix run --release
Screenshot 2023-11-28 at 2 10 53

Test Plan

@TaKO8Ki TaKO8Ki changed the title Wasix debug Compile Biome to Wasix Nov 27, 2023
@TaKO8Ki TaKO8Ki changed the title Compile Biome to Wasix Compile Biome to WASIX Nov 27, 2023
@syrusakbary
Copy link
Copy Markdown

This is awesome @TaKO8Ki! Great work, it may make sense to publish this into a package in the Biome's namespace in Wasmer so people can start trying it?

Let me know if you need any help with that!

@TaKO8Ki
TaKO8Ki commented Nov 27, 2023
Copy link
Copy Markdown
Owner Author

@syrusakbary Thanks! After discussion with other maintainers, I will publish this into the namespace!

Comment thread crates/biome_wasm/build.rs Outdated
Comment on lines +1 to +3
use std::{env, fs, io, path::PathBuf};
// use std::{env, fs, io, path::PathBuf};

use quote::{format_ident, quote};
// use quote::{format_ident, quote};
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This file should not be affected by using wasix?

@@ -22,42 +22,42 @@ pub(crate) fn start(
session: CliSession,
config_path: Option<PathBuf>,
) -> Result<(), CliDiagnostic> {
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We can probably un-do all changes on the daemon file, and just skip this option when compiling the cli to WASIX. Thoughts?

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I agree, and if that's possible, I think it would be the best approach.

@TaKO8Ki
TaKO8Ki commented Nov 28, 2023
Copy link
Copy Markdown
Owner Author

Since it's necessary to change several dependency versions and sources for WASIX, the main challenge is how to integrate these changes into the main branch.

@syrusakbary
syrusakbary commented Nov 28, 2023 •
Copy link
Copy Markdown

Hey @TaKO8Ki I think it may make sense to have a secondary Cargo.toml only used for WASIX? (that includes the patch). Thoughts?

@TaKO8Ki
TaKO8Ki commented Nov 28, 2023
Copy link
Copy Markdown
Owner Author

@syrusakbary Thank you for the advice. I think that's one approach, but as far as I know, merging multiple Cargo.toml files is not possible. In that case, it seems we would end up managing Biome's dependencies that are not directly related to WASIX in duplicate. What I'm currently considering is simply creating a wasix feature in Biome and switching dependencies based on whether this feature is used or not. At least for now, I think this is the cleanest way to implement it.

I'll work on it a bit more.

@syrusakbary
Copy link
Copy Markdown

What I'm currently considering is simply creating a wasix feature in Biome and switching dependencies based on whether this feature is used or not

Oh, I think what this strategy is actually much better than what I was proposing! Yup, makes sense

@unvalley
unvalley commented Dec 1, 2023
Copy link
Copy Markdown

If there is anything I can do to help, please let me know:)

move jobs

remove lsp implementations

disable `run_server`

use bininstall

remove libc

WASIX job

use pull_request:

fix

remove a job

stop using bininstall

use moonrepo/setup-rust@v1

use bins

revert changes in biome_wasm

update

Revert "update"

This reverts commit 1ca031e.

add `build-wasix` alias

format

format

remove .node-version

create wasix.rs

This branch had an error being deployed

1 failed deployment
Website deployment — 7462c497 Deployed Dec 6, 2023 by TaKO8Ki
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

Successfully merging this pull request may close these issues.

4 participants

0